Hold include uid setting

This commit is contained in:
2022-11-27 16:38:24 +08:00
parent ba4837f1f8
commit 74ddb428ee
6 changed files with 36 additions and 4 deletions

View File

@ -61,6 +61,9 @@
<setting name="BannersJsonPath" serializeAs="String"> <setting name="BannersJsonPath" serializeAs="String">
<value /> <value />
</setting> </setting>
<setting name="IsIncludeUID" serializeAs="String">
<value>False</value>
</setting>
</GrasscutterTools.Properties.Settings> </GrasscutterTools.Properties.Settings>
</userSettings> </userSettings>
</configuration> </configuration>

View File

@ -230,9 +230,9 @@ namespace GrasscutterTools.Forms
/// <param name="args">参数</param> /// <param name="args">参数</param>
private void SetCommand(string command, string args) private void SetCommand(string command, string args)
{ {
//if (ChkIncludeUID.Checked) if (Settings.Default.IsIncludeUID)
// SetCommand($"{command} @{NUDUid.Value} {args.Trim()}"); SetCommand($"{command} @{Settings.Default.Uid} {args.Trim()}");
//else else
SetCommand($"{command} {args.Trim()}"); SetCommand($"{command} {args.Trim()}");
} }

View File

@ -46,6 +46,10 @@ namespace GrasscutterTools.Pages
NUDUid.Value = Settings.Default.Uid; NUDUid.Value = Settings.Default.Uid;
NUDUid.ValueChanged += (o, e) => Settings.Default.Uid = NUDUid.Value; NUDUid.ValueChanged += (o, e) => Settings.Default.Uid = NUDUid.Value;
// 是否包含UID
ChkIncludeUID.Checked = Settings.Default.IsIncludeUID;
ChkIncludeUID.CheckedChanged += (o, e) => Settings.Default.IsIncludeUID = ChkIncludeUID.Checked;
// 置顶 // 置顶
ChkTopMost.Checked = Settings.Default.IsTopMost; ChkTopMost.Checked = Settings.Default.IsTopMost;
ChkTopMost.CheckedChanged += (o, e) => Settings.Default.IsTopMost = ParentForm.TopMost = ChkTopMost.Checked; ChkTopMost.CheckedChanged += (o, e) => Settings.Default.IsTopMost = ParentForm.TopMost = ChkTopMost.Checked;

View File

@ -226,5 +226,17 @@ namespace GrasscutterTools.Properties {
this["BannersJsonPath"] = value; this["BannersJsonPath"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool IsIncludeUID {
get {
return ((bool)(this["IsIncludeUID"]));
}
set {
this["IsIncludeUID"] = value;
}
}
} }
} }

View File

@ -53,5 +53,8 @@
<Setting Name="BannersJsonPath" Type="System.String" Scope="User"> <Setting Name="BannersJsonPath" Type="System.String" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="IsIncludeUID" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -31,5 +31,15 @@ namespace GrasscutterTools.Utils
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"GrasscutterTools", "GrasscutterTools",
filename); filename);
/// <summary>
/// UID
/// </summary>
public static int UID { get; set; }
/// <summary>
/// 生成命令是否包含UID
/// </summary>
public static bool IsIncludeUID { get; set; }
} }
} }