From a5e1478ecfd559ffa5684f7a85c04edbd3958a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Fri, 24 Jan 2025 19:48:45 +0800 Subject: [PATCH] revert & dash --- .../AutoPathing/Model/Enum/MoveModeEnum.cs | 1 + .../GameTask/AutoPathing/PathExecutor.cs | 18 +++++++++++++++++- BetterGenshinImpact/Helpers/Ui/WindowHelper.cs | 13 +++++++------ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/BetterGenshinImpact/GameTask/AutoPathing/Model/Enum/MoveModeEnum.cs b/BetterGenshinImpact/GameTask/AutoPathing/Model/Enum/MoveModeEnum.cs index 505ea03f..7301da39 100644 --- a/BetterGenshinImpact/GameTask/AutoPathing/Model/Enum/MoveModeEnum.cs +++ b/BetterGenshinImpact/GameTask/AutoPathing/Model/Enum/MoveModeEnum.cs @@ -6,6 +6,7 @@ public class MoveModeEnum(string code, string msg) { public static readonly MoveModeEnum Walk = new("walk", "步行"); public static readonly MoveModeEnum Run = new("run", "奔跑"); + public static readonly MoveModeEnum Dash = new("dash", "持续冲刺"); public static readonly MoveModeEnum Climb = new("climb", "攀爬"); public static readonly MoveModeEnum Fly = new("fly", "飞行"); public static readonly MoveModeEnum Jump = new("jump", "跳跃"); diff --git a/BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs b/BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs index e6b444d0..82e56065 100644 --- a/BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs +++ b/BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs @@ -680,7 +680,23 @@ public class PathExecutor // 只有设置为run才会一直疾跑 if (waypoint.MoveMode == MoveModeEnum.Run.Code) { - if (distance > 25) // 距离大于25时可以使用疾跑 + if (distance > 20 != fastMode) // 距离大于20时可以使用疾跑/自由泳 + { + if (fastMode) + { + Simulation.SendInput.SimulateAction(GIActions.SprintMouse, KeyType.KeyUp); + } + else + { + Simulation.SendInput.SimulateAction(GIActions.SprintMouse, KeyType.KeyDown); + } + + fastMode = !fastMode; + } + } + else if (waypoint.MoveMode == MoveModeEnum.Dash.Code) + { + if (distance > 20) // 距离大于25时可以使用疾跑 { if (Math.Abs((fastModeColdTime - DateTime.UtcNow).TotalMilliseconds) > 1000) //冷却一会 { diff --git a/BetterGenshinImpact/Helpers/Ui/WindowHelper.cs b/BetterGenshinImpact/Helpers/Ui/WindowHelper.cs index c6c5d8c1..36cd3278 100644 --- a/BetterGenshinImpact/Helpers/Ui/WindowHelper.cs +++ b/BetterGenshinImpact/Helpers/Ui/WindowHelper.cs @@ -24,15 +24,16 @@ public class WindowHelper return; } - if (WindowBackdrop.IsSupported(WindowBackdropType.Acrylic)) - { - window.Background = new SolidColorBrush(Color.FromArgb(100, 0, 0, 0)); - WindowBackdrop.ApplyBackdrop(window, WindowBackdropType.Acrylic); - } - else if (WindowBackdrop.IsSupported(WindowBackdropType.Mica)) + + if (WindowBackdrop.IsSupported(WindowBackdropType.Mica)) { window.Background = new SolidColorBrush(Colors.Transparent); WindowBackdrop.ApplyBackdrop(window, WindowBackdropType.Mica); } + else if (WindowBackdrop.IsSupported(WindowBackdropType.Acrylic)) + { + window.Background = new SolidColorBrush(Color.FromArgb(100, 0, 0, 0)); + WindowBackdrop.ApplyBackdrop(window, WindowBackdropType.Acrylic); + } } } \ No newline at end of file