From 96fa4da6b3fd4884d1f9dc10ee905e46bef3d1e9 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Wed, 3 Apr 2024 13:48:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A3=B0=E9=9F=B3=E5=88=A4?= =?UTF-8?q?=E6=96=AD=20#341?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.cs | 25 +++++++++++++++---- VPet-Simulator.Windows/MainWindow_Property.cs | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 854ee73..da67258 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -973,8 +973,15 @@ namespace VPet_Simulator.Windows { using (var enumerator = new MMDeviceEnumerator()) { - var device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console); - return device.AudioMeterInformation.MasterPeakValue; + if (enumerator.HasDefaultAudioEndpoint(DataFlow.Render, Role.Console)) + { + var device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console); + return device.AudioMeterInformation.MasterPeakValue; + } + else + { + return -1; + } } } catch @@ -1189,12 +1196,20 @@ namespace VPet_Simulator.Windows //看看是否超模 if (HashCheck && work.IsOverLoad()) { - if (MessageBoxX.Show("当前工作数据属性超模,是否继续工作?\n超模工作可能会导致游戏发生不可预料的错误\n超模工作不影响大部分成就解锁\n可以在设置中开启自动计算自动为工作设置合理数值" - .Translate(), "超模工作提醒".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes) + if (Set["gameconfig"].GetBool("noAutoCal")) { + if (MessageBoxX.Show("当前工作数据属性超模,是否继续工作?\n超模工作可能会导致游戏发生不可预料的错误\n超模工作不影响大部分成就解锁\n可以在设置中开启自动计算自动为工作设置合理数值" + .Translate(), "超模工作提醒".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes) + { + return false; + } + HashCheck = false; + } + else + { + MessageBoxX.Show("当前工作数据属性超模,已自动取消".Translate(), "超模工作提醒".Translate()); return false; } - HashCheck = false; } return true; } diff --git a/VPet-Simulator.Windows/MainWindow_Property.cs b/VPet-Simulator.Windows/MainWindow_Property.cs index 0143afe..ed83d5b 100644 --- a/VPet-Simulator.Windows/MainWindow_Property.cs +++ b/VPet-Simulator.Windows/MainWindow_Property.cs @@ -18,7 +18,7 @@ public partial class MainWindow /// /// 版本号 /// - public int version { get; } = 11002; + public int version { get; } = 11003; /// /// 版本号 ///