From 2779dcdcc955cb7ec300344d5b2d8a8ddd5eace3 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Fri, 2 Aug 2024 20:49:21 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=A7=BB=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index e56979bbee..7ec5349bfc 100644 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -3892,14 +3892,12 @@ namespace MaaWpfGui.ViewModels.UI MessageBoxHelper.Show(LocalizationHelper.GetString("MuMu12ExtrasEnabledTip")); // 读取mumu注册表地址 并填充GUI - #if WINDOWS - if (string.Empty.Equals(EmulatorPath)) + if (string.IsNullOrEmpty(EmulatorPath)) { try { RegistryKey driverKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MuMuPlayer-12.0"); string result = (String)driverKey.GetValue("UninstallString"); - // MessageBoxHelper.Show(result.Substring(1, result.IndexOf("\\uninstall.exe") - 1)); EmulatorPath = result.Substring(1, result.IndexOf("\\uninstall.exe") - 1); } catch(Exception e) @@ -3907,7 +3905,6 @@ namespace MaaWpfGui.ViewModels.UI // 暂不处理 } } - #endif } Instances.AsstProxy.Connected = false; @@ -3927,7 +3924,7 @@ namespace MaaWpfGui.ViewModels.UI get => _emulatorPath; set { - if (!Directory.Exists(value) && _enable) + if (_enable && !Directory.Exists(value)) { MessageBoxHelper.Show("MuMu Emulator 12 Path Not Found"); value = string.Empty;