mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
perf: 雷电截图增强支持自动检测模拟器安装路径
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inited/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=iter/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ldconsole/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ldplayer/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=LD_0027s/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=leidian/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lolicon/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
@@ -4320,6 +4320,38 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
if (value)
|
||||
{
|
||||
MessageBoxHelper.Show(LocalizationHelper.GetString("LdExtrasEnabledTip"));
|
||||
|
||||
// 读取 LD 注册表地址 并填充GUI
|
||||
if (string.IsNullOrEmpty(EmulatorPath))
|
||||
{
|
||||
try
|
||||
{
|
||||
const string UninstallKeyPath = @"Software\leidian\ldplayer9";
|
||||
const string InstallDirValueName = "InstallDir";
|
||||
|
||||
using RegistryKey? driverKey = Registry.CurrentUser.OpenSubKey(UninstallKeyPath);
|
||||
if (driverKey == null)
|
||||
{
|
||||
EmulatorPath = string.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
string? installDir = driverKey.GetValue(InstallDirValueName) as string;
|
||||
|
||||
if (string.IsNullOrEmpty(installDir))
|
||||
{
|
||||
EmulatorPath = string.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
EmulatorPath = installDir;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Warning($"An error occurred: {e.Message}");
|
||||
EmulatorPath = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Instances.AsstProxy.Connected = false;
|
||||
|
||||
Reference in New Issue
Block a user