提交 57c393e7 编写于 作者: A Aigio Liu

🎨 重启生效设置项提示

上级 b51f4785
......@@ -327,6 +327,15 @@
"Summary": "禁用插件",
"IsRegionOrEndregion": null,
"IsValueType": null
},
{
"TypeName": "bool",
"PropertyName": "PluginSafeMode",
"DefaultValue": "true",
"DefaultValueIsConst": true,
"Summary": "插件安全模式",
"IsRegionOrEndregion": null,
"IsValueType": null
}
],
"Usings": ""
......
......@@ -24,7 +24,7 @@
<ui:FontIconSource FontFamily="Segoe Fluent Icons" Glyph="{StaticResource DefenderApp}" />
</ui:SettingsExpander.IconSource>
<ui:SettingsExpander.Footer>
<ToggleSwitch Classes="LeftContent" />
<ToggleSwitch Classes="LeftContent" IsChecked="{Binding Source={x:Static ms:GeneralSettings.PluginSafeMode}, Path=Value, Mode=TwoWay}" />
</ui:SettingsExpander.Footer>
</ui:SettingsExpander>
......
......@@ -6055,6 +6055,15 @@ namespace BD.WTTS.Client.Resources {
}
}
/// <summary>
/// 查找类似 设置已修改,需重启软件后生效 的本地化字符串。
/// </summary>
public static string SettingsModifiedRestartThisSoft {
get {
return ResourceManager.GetString("SettingsModifiedRestartThisSoft", resourceCulture);
}
}
/// <summary>
/// 查找类似 显示/隐藏 的本地化字符串。
/// </summary>
......
......@@ -2715,4 +2715,7 @@
<data name="Idle_StopAutoNext" xml:space="preserve">
<value>关闭自动切换游戏</value>
</data>
<data name="SettingsModifiedRestartThisSoft" xml:space="preserve">
<value>设置已修改,需重启软件后生效</value>
</data>
</root>
\ No newline at end of file
......@@ -140,5 +140,14 @@ public partial interface IGeneralSettings
/// </summary>
const HashSet<string>? DefaultDisablePlugins = null;
}
/// <summary>
/// 插件安全模式
/// </summary>
bool? PluginSafeMode { get; set; }
/// <summary>
/// 插件安全模式的默认值
/// </summary>
const bool DefaultPluginSafeMode = true;
}
......@@ -115,6 +115,12 @@ public sealed partial class GeneralSettings_ : IGeneralSettings, ISettings, ISet
[MPKey(11), MP2Key(11), JsonPropertyOrder(11)]
public HashSet<string>? DisablePlugins { get; set; }
/// <summary>
/// 插件安全模式
/// </summary>
[MPKey(12), MP2Key(12), JsonPropertyOrder(12)]
public bool? PluginSafeMode { get; set; }
}
public static partial class GeneralSettings
......@@ -191,4 +197,10 @@ public static partial class GeneralSettings
public static SettingsProperty<string, HashSet<string>, GeneralSettings_> DisablePlugins { get; }
= new(DefaultDisablePlugins);
/// <summary>
/// 插件安全模式
/// </summary>
public static SettingsStructProperty<bool, GeneralSettings_> PluginSafeMode { get; }
= new(DefaultPluginSafeMode);
}
......@@ -9,12 +9,28 @@ partial class Startup // OnStartup
}
protected static void ShowSettingsModifiedRestartThisSoft()
{
Toast.Show(ToastIcon.Info, Strings.SettingsModifiedRestartThisSoft);
}
public virtual void InitSettingSubscribe()
{
var a = IApplication.Instance;
UISettings.Theme.Subscribe(x => a.Theme = x);
UISettings.Language.Subscribe(ResourceService.ChangeLanguage);
GeneralSettings.GPU.Subscribe(x =>
{
if (x.HasValue) // null 为默认值时不提示
ShowSettingsModifiedRestartThisSoft();
});
GeneralSettings.PluginSafeMode.Subscribe(x =>
{
if (x.HasValue) // null 为默认值时不提示
ShowSettingsModifiedRestartThisSoft();
});
}
public virtual void OnStartup()
......
......@@ -164,7 +164,7 @@ Avalonia is a cross-platform UI framework for dotnet, providing a flexible styli
}
}));
// 账号注销
yield return new HL(Strings.DelAccount, (ICommand)null!);
yield return new HL(Strings.DelAccount, Constants.Urls.OfficialWebsite_Account_Safe);
// Bug 提交(GitHub) https://github.com/BeyondDimension/SteamTools/issues
yield return new HL($"{Strings.BugReport}(GitHub)", Constants.Urls.GitHub_Issues);
// Bug 提交(Gitee) https://gitee.com/rmbgame/SteamTools/issues
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册