From 58d79d5955c79babc3b1ca6e8ed6b33d3fd24822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Sun, 19 Jan 2025 19:35:16 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d1fcb9c21d7836fb1a01307ea61904adf4c6aa74. --- .../Core/Recorder/KeyMouseRecorderJsonLine.cs | 11 +++----- BetterGenshinImpact/View/Pages/HomePage.xaml | 3 --- .../View/Pages/HomePage.xaml.cs | 26 +------------------ 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/BetterGenshinImpact/Core/Recorder/KeyMouseRecorderJsonLine.cs b/BetterGenshinImpact/Core/Recorder/KeyMouseRecorderJsonLine.cs index ef09ea05..bd31a583 100644 --- a/BetterGenshinImpact/Core/Recorder/KeyMouseRecorderJsonLine.cs +++ b/BetterGenshinImpact/Core/Recorder/KeyMouseRecorderJsonLine.cs @@ -72,7 +72,7 @@ public class KeyMouseRecorderJsonLine _consumerTask = Task.Run(async () => await ConsumeEventsAsync(_path)); } - + public KeyMouseRecorderJsonLine Start() { StartTick = Kernel32.GetTickCount(); @@ -124,11 +124,6 @@ public class KeyMouseRecorderJsonLine public void KeyDown(KeyEventArgsExt e) { var time = e.Timestamp - StartTick; - if (e.KeyCode == Keys.F) - { - TaskControl.Logger.LogInformation($"{DateTime.Now:HH:mm:ss.ffff}按下F"); - } - AddEvent(_macroEventsChannel, new MacroEvent { Type = MacroEventType.KeyDown, @@ -201,12 +196,12 @@ public class KeyMouseRecorderJsonLine Time = time }); } - + public void MouseMoveBy(MouseState state, uint tick, bool save = false) { User32.GetCursorPos(out var p); - + var mEvent = new MacroEvent { Type = MacroEventType.MouseMoveBy, diff --git a/BetterGenshinImpact/View/Pages/HomePage.xaml b/BetterGenshinImpact/View/Pages/HomePage.xaml index 2b7e59b7..39d544e0 100644 --- a/BetterGenshinImpact/View/Pages/HomePage.xaml +++ b/BetterGenshinImpact/View/Pages/HomePage.xaml @@ -510,8 +510,5 @@ - 启动时间 - 当前时间 - tickCount \ No newline at end of file diff --git a/BetterGenshinImpact/View/Pages/HomePage.xaml.cs b/BetterGenshinImpact/View/Pages/HomePage.xaml.cs index f4a849e2..025bd0dd 100644 --- a/BetterGenshinImpact/View/Pages/HomePage.xaml.cs +++ b/BetterGenshinImpact/View/Pages/HomePage.xaml.cs @@ -1,7 +1,4 @@ -using System; -using System.Threading.Tasks; -using BetterGenshinImpact.ViewModel.Pages; -using Vanara.PInvoke; +using BetterGenshinImpact.ViewModel.Pages; namespace BetterGenshinImpact.View.Pages { @@ -15,27 +12,6 @@ namespace BetterGenshinImpact.View.Pages InitializeComponent(); // hotKeyPageViewModel 放在这里是为了在首页就初始化热键 - - Task.Run(async () => - { - bool first = true; - // 显示当前时间 - while (true) - { - Dispatcher.Invoke(() => - { - if (first) - { - first = false; - ClockStartBlock.Text = DateTime.Now.ToString("HH:mm:ss.fff") + " | " + Kernel32.GetTickCount().ToString(); - } - - ClockBlock.Text = DateTime.Now.ToString("HH:mm:ss.fff"); - TickBlock.Text = Kernel32.GetTickCount().ToString(); - }); - await Task.Delay(10); - } - }); } } } \ No newline at end of file