Add Command Version Control

Add more comments(zh)
Optimize code structure
Update the loading order to avoid repeated loading to optimize startup speed.
This commit is contained in:
2022-08-28 00:35:21 +08:00
parent eba9db1e35
commit aff13c2a97
11 changed files with 7756 additions and 5473 deletions

View File

@ -17,7 +17,7 @@
<value>10001</value> <value>10001</value>
</setting> </setting>
<setting name="DefaultLanguage" serializeAs="String"> <setting name="DefaultLanguage" serializeAs="String">
<value>zh-CN</value> <value />
</setting> </setting>
<setting name="ResourcesDirPath" serializeAs="String"> <setting name="ResourcesDirPath" serializeAs="String">
<value /> <value />
@ -38,7 +38,7 @@
<value /> <value />
</setting> </setting>
<setting name="CommandVersion" serializeAs="String"> <setting name="CommandVersion" serializeAs="String">
<value>1.2.2</value> <value />
</setting> </setting>
<setting name="IsTopMost" serializeAs="String"> <setting name="IsTopMost" serializeAs="String">
<value>False</value> <value>False</value>

View File

@ -75,7 +75,6 @@ namespace GrasscutterTools.Forms
this.DTPBanEndTime = new System.Windows.Forms.DateTimePicker(); this.DTPBanEndTime = new System.Windows.Forms.DateTimePicker();
this.BtnUnban = new System.Windows.Forms.Button(); this.BtnUnban = new System.Windows.Forms.Button();
this.BtnBan = new System.Windows.Forms.Button(); this.BtnBan = new System.Windows.Forms.Button();
this.TxtBanReason = new GrasscutterTools.Controls.TextBoxXP();
this.NUDBanUID = new System.Windows.Forms.NumericUpDown(); this.NUDBanUID = new System.Windows.Forms.NumericUpDown();
this.LblBanUID = new System.Windows.Forms.Label(); this.LblBanUID = new System.Windows.Forms.Label();
this.GrpAccount = new System.Windows.Forms.GroupBox(); this.GrpAccount = new System.Windows.Forms.GroupBox();
@ -219,13 +218,15 @@ namespace GrasscutterTools.Forms
this.GrasscutterToolsIcon = new System.Windows.Forms.PictureBox(); this.GrasscutterToolsIcon = new System.Windows.Forms.PictureBox();
this.GrpSettings = new System.Windows.Forms.GroupBox(); this.GrpSettings = new System.Windows.Forms.GroupBox();
this.ChkTopMost = new System.Windows.Forms.CheckBox(); this.ChkTopMost = new System.Windows.Forms.CheckBox();
this.ChkNewCommand = new System.Windows.Forms.CheckBox();
this.CmbLanguage = new System.Windows.Forms.ComboBox(); this.CmbLanguage = new System.Windows.Forms.ComboBox();
this.LblLanguage = new System.Windows.Forms.Label(); this.LblLanguage = new System.Windows.Forms.Label();
this.NUDUid = new System.Windows.Forms.NumericUpDown(); this.NUDUid = new System.Windows.Forms.NumericUpDown();
this.ChkIncludeUID = new System.Windows.Forms.CheckBox(); this.ChkIncludeUID = new System.Windows.Forms.CheckBox();
this.LblDefaultUid = new System.Windows.Forms.Label(); this.LblDefaultUid = new System.Windows.Forms.Label();
this.TCMain = new System.Windows.Forms.TabControl(); this.TCMain = new System.Windows.Forms.TabControl();
this.CmbGcVersions = new System.Windows.Forms.ComboBox();
this.LblGCVersion = new System.Windows.Forms.Label();
this.TxtBanReason = new GrasscutterTools.Controls.TextBoxXP();
this.GrpCommand.SuspendLayout(); this.GrpCommand.SuspendLayout();
this.TPRemoteCall.SuspendLayout(); this.TPRemoteCall.SuspendLayout();
this.GrpServerStatus.SuspendLayout(); this.GrpServerStatus.SuspendLayout();
@ -322,7 +323,6 @@ namespace GrasscutterTools.Forms
// //
// TPRemoteCall // TPRemoteCall
// //
resources.ApplyResources(this.TPRemoteCall, "TPRemoteCall");
this.TPRemoteCall.Controls.Add(this.LnkLinks); this.TPRemoteCall.Controls.Add(this.LnkLinks);
this.TPRemoteCall.Controls.Add(this.LnkGOODHelp); this.TPRemoteCall.Controls.Add(this.LnkGOODHelp);
this.TPRemoteCall.Controls.Add(this.LnkInventoryKamera); this.TPRemoteCall.Controls.Add(this.LnkInventoryKamera);
@ -334,6 +334,7 @@ namespace GrasscutterTools.Forms
this.TPRemoteCall.Controls.Add(this.TxtHost); this.TPRemoteCall.Controls.Add(this.TxtHost);
this.TPRemoteCall.Controls.Add(this.BtnQueryServerStatus); this.TPRemoteCall.Controls.Add(this.BtnQueryServerStatus);
this.TPRemoteCall.Controls.Add(this.LblHost); this.TPRemoteCall.Controls.Add(this.LblHost);
resources.ApplyResources(this.TPRemoteCall, "TPRemoteCall");
this.TPRemoteCall.Name = "TPRemoteCall"; this.TPRemoteCall.Name = "TPRemoteCall";
this.TPRemoteCall.UseVisualStyleBackColor = true; this.TPRemoteCall.UseVisualStyleBackColor = true;
// //
@ -430,15 +431,14 @@ namespace GrasscutterTools.Forms
// //
// TPOpenCommandCheck // TPOpenCommandCheck
// //
resources.ApplyResources(this.TPOpenCommandCheck, "TPOpenCommandCheck");
this.TPOpenCommandCheck.Controls.Add(this.TPPlayerCheck); this.TPOpenCommandCheck.Controls.Add(this.TPPlayerCheck);
this.TPOpenCommandCheck.Controls.Add(this.TPConsoleCheck); this.TPOpenCommandCheck.Controls.Add(this.TPConsoleCheck);
resources.ApplyResources(this.TPOpenCommandCheck, "TPOpenCommandCheck");
this.TPOpenCommandCheck.Name = "TPOpenCommandCheck"; this.TPOpenCommandCheck.Name = "TPOpenCommandCheck";
this.TPOpenCommandCheck.SelectedIndex = 0; this.TPOpenCommandCheck.SelectedIndex = 0;
// //
// TPPlayerCheck // TPPlayerCheck
// //
resources.ApplyResources(this.TPPlayerCheck, "TPPlayerCheck");
this.TPPlayerCheck.Controls.Add(this.LnkRCHelp); this.TPPlayerCheck.Controls.Add(this.LnkRCHelp);
this.TPPlayerCheck.Controls.Add(this.NUDRemotePlayerId); this.TPPlayerCheck.Controls.Add(this.NUDRemotePlayerId);
this.TPPlayerCheck.Controls.Add(this.BtnConnectOpenCommand); this.TPPlayerCheck.Controls.Add(this.BtnConnectOpenCommand);
@ -446,6 +446,7 @@ namespace GrasscutterTools.Forms
this.TPPlayerCheck.Controls.Add(this.BtnSendVerificationCode); this.TPPlayerCheck.Controls.Add(this.BtnSendVerificationCode);
this.TPPlayerCheck.Controls.Add(this.NUDVerificationCode); this.TPPlayerCheck.Controls.Add(this.NUDVerificationCode);
this.TPPlayerCheck.Controls.Add(this.LblRemotePlayerId); this.TPPlayerCheck.Controls.Add(this.LblRemotePlayerId);
resources.ApplyResources(this.TPPlayerCheck, "TPPlayerCheck");
this.TPPlayerCheck.Name = "TPPlayerCheck"; this.TPPlayerCheck.Name = "TPPlayerCheck";
this.TPPlayerCheck.UseVisualStyleBackColor = true; this.TPPlayerCheck.UseVisualStyleBackColor = true;
// //
@ -517,11 +518,11 @@ namespace GrasscutterTools.Forms
// //
// TPConsoleCheck // TPConsoleCheck
// //
resources.ApplyResources(this.TPConsoleCheck, "TPConsoleCheck");
this.TPConsoleCheck.Controls.Add(this.BtnConsoleConnect); this.TPConsoleCheck.Controls.Add(this.BtnConsoleConnect);
this.TPConsoleCheck.Controls.Add(this.TxtToken); this.TPConsoleCheck.Controls.Add(this.TxtToken);
this.TPConsoleCheck.Controls.Add(this.LblToken); this.TPConsoleCheck.Controls.Add(this.LblToken);
this.TPConsoleCheck.Controls.Add(this.LblConsoleTip); this.TPConsoleCheck.Controls.Add(this.LblConsoleTip);
resources.ApplyResources(this.TPConsoleCheck, "TPConsoleCheck");
this.TPConsoleCheck.Name = "TPConsoleCheck"; this.TPConsoleCheck.Name = "TPConsoleCheck";
this.TPConsoleCheck.UseVisualStyleBackColor = true; this.TPConsoleCheck.UseVisualStyleBackColor = true;
// //
@ -566,10 +567,10 @@ namespace GrasscutterTools.Forms
// //
// TPAbout // TPAbout
// //
resources.ApplyResources(this.TPAbout, "TPAbout");
this.TPAbout.Controls.Add(this.GrasscutterToolsSupport); this.TPAbout.Controls.Add(this.GrasscutterToolsSupport);
this.TPAbout.Controls.Add(this.LnkGithub); this.TPAbout.Controls.Add(this.LnkGithub);
this.TPAbout.Controls.Add(this.LblSupportDescription); this.TPAbout.Controls.Add(this.LblSupportDescription);
resources.ApplyResources(this.TPAbout, "TPAbout");
this.TPAbout.Name = "TPAbout"; this.TPAbout.Name = "TPAbout";
this.TPAbout.UseVisualStyleBackColor = true; this.TPAbout.UseVisualStyleBackColor = true;
// //
@ -594,10 +595,10 @@ namespace GrasscutterTools.Forms
// //
// TPManage // TPManage
// //
resources.ApplyResources(this.TPManage, "TPManage");
this.TPManage.Controls.Add(this.GrpBanPlayer); this.TPManage.Controls.Add(this.GrpBanPlayer);
this.TPManage.Controls.Add(this.GrpAccount); this.TPManage.Controls.Add(this.GrpAccount);
this.TPManage.Controls.Add(this.GrpPermission); this.TPManage.Controls.Add(this.GrpPermission);
resources.ApplyResources(this.TPManage, "TPManage");
this.TPManage.Name = "TPManage"; this.TPManage.Name = "TPManage";
this.TPManage.UseVisualStyleBackColor = true; this.TPManage.UseVisualStyleBackColor = true;
// //
@ -615,8 +616,8 @@ namespace GrasscutterTools.Forms
// //
// DTPBanEndTime // DTPBanEndTime
// //
resources.ApplyResources(this.DTPBanEndTime, "DTPBanEndTime");
this.DTPBanEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Short; this.DTPBanEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Short;
resources.ApplyResources(this.DTPBanEndTime, "DTPBanEndTime");
this.DTPBanEndTime.MaxDate = new System.DateTime(2034, 12, 31, 0, 0, 0, 0); this.DTPBanEndTime.MaxDate = new System.DateTime(2034, 12, 31, 0, 0, 0, 0);
this.DTPBanEndTime.MinDate = new System.DateTime(2022, 6, 28, 0, 0, 0, 0); this.DTPBanEndTime.MinDate = new System.DateTime(2022, 6, 28, 0, 0, 0, 0);
this.DTPBanEndTime.Name = "DTPBanEndTime"; this.DTPBanEndTime.Name = "DTPBanEndTime";
@ -636,14 +637,6 @@ namespace GrasscutterTools.Forms
this.BtnBan.UseVisualStyleBackColor = true; this.BtnBan.UseVisualStyleBackColor = true;
this.BtnBan.Click += new System.EventHandler(this.BtnBan_Click); this.BtnBan.Click += new System.EventHandler(this.BtnBan_Click);
// //
// TxtBanReason
//
resources.ApplyResources(this.TxtBanReason, "TxtBanReason");
this.TxtBanReason.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.TxtBanReason.Maximum = 0F;
this.TxtBanReason.Minimum = 0F;
this.TxtBanReason.Name = "TxtBanReason";
//
// NUDBanUID // NUDBanUID
// //
resources.ApplyResources(this.NUDBanUID, "NUDBanUID"); resources.ApplyResources(this.NUDBanUID, "NUDBanUID");
@ -737,10 +730,10 @@ namespace GrasscutterTools.Forms
// //
// CmbPerm // CmbPerm
// //
resources.ApplyResources(this.CmbPerm, "CmbPerm");
this.CmbPerm.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; this.CmbPerm.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.CmbPerm.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.CmbPerm.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
this.CmbPerm.FormattingEnabled = true; this.CmbPerm.FormattingEnabled = true;
resources.ApplyResources(this.CmbPerm, "CmbPerm");
this.CmbPerm.Name = "CmbPerm"; this.CmbPerm.Name = "CmbPerm";
// //
// NUDPermUID // NUDPermUID
@ -786,7 +779,6 @@ namespace GrasscutterTools.Forms
// //
// TPScene // TPScene
// //
resources.ApplyResources(this.TPScene, "TPScene");
this.TPScene.Controls.Add(this.TxtSceneFilter); this.TPScene.Controls.Add(this.TxtSceneFilter);
this.TPScene.Controls.Add(this.ChkIncludeSceneId); this.TPScene.Controls.Add(this.ChkIncludeSceneId);
this.TPScene.Controls.Add(this.LblTp); this.TPScene.Controls.Add(this.LblTp);
@ -801,6 +793,7 @@ namespace GrasscutterTools.Forms
this.TPScene.Controls.Add(this.LblClimateType); this.TPScene.Controls.Add(this.LblClimateType);
this.TPScene.Controls.Add(this.LblSceneDescription); this.TPScene.Controls.Add(this.LblSceneDescription);
this.TPScene.Controls.Add(this.ListScenes); this.TPScene.Controls.Add(this.ListScenes);
resources.ApplyResources(this.TPScene, "TPScene");
this.TPScene.Name = "TPScene"; this.TPScene.Name = "TPScene";
this.TPScene.UseVisualStyleBackColor = true; this.TPScene.UseVisualStyleBackColor = true;
// //
@ -935,7 +928,6 @@ namespace GrasscutterTools.Forms
// //
// TPItem // TPItem
// //
resources.ApplyResources(this.TPItem, "TPItem");
this.TPItem.Controls.Add(this.LblClearGiveItemLogs); this.TPItem.Controls.Add(this.LblClearGiveItemLogs);
this.TPItem.Controls.Add(this.BtnSaveGiveItemLog); this.TPItem.Controls.Add(this.BtnSaveGiveItemLog);
this.TPItem.Controls.Add(this.BtnRemoveGiveItemLog); this.TPItem.Controls.Add(this.BtnRemoveGiveItemLog);
@ -948,6 +940,7 @@ namespace GrasscutterTools.Forms
this.TPItem.Controls.Add(this.NUDGameItemAmout); this.TPItem.Controls.Add(this.NUDGameItemAmout);
this.TPItem.Controls.Add(this.NUDGameItemLevel); this.TPItem.Controls.Add(this.NUDGameItemLevel);
this.TPItem.Controls.Add(this.LblGiveCommandDescription); this.TPItem.Controls.Add(this.LblGiveCommandDescription);
resources.ApplyResources(this.TPItem, "TPItem");
this.TPItem.Name = "TPItem"; this.TPItem.Name = "TPItem";
this.TPItem.UseVisualStyleBackColor = true; this.TPItem.UseVisualStyleBackColor = true;
// //
@ -1065,7 +1058,6 @@ namespace GrasscutterTools.Forms
// //
// TPWeapon // TPWeapon
// //
resources.ApplyResources(this.TPWeapon, "TPWeapon");
this.TPWeapon.Controls.Add(this.TxtWeaponFilter); this.TPWeapon.Controls.Add(this.TxtWeaponFilter);
this.TPWeapon.Controls.Add(this.LblWeaponDescription); this.TPWeapon.Controls.Add(this.LblWeaponDescription);
this.TPWeapon.Controls.Add(this.LblWeaponRefinement); this.TPWeapon.Controls.Add(this.LblWeaponRefinement);
@ -1075,6 +1067,7 @@ namespace GrasscutterTools.Forms
this.TPWeapon.Controls.Add(this.NUDWeaponAmout); this.TPWeapon.Controls.Add(this.NUDWeaponAmout);
this.TPWeapon.Controls.Add(this.NUDWeaponLevel); this.TPWeapon.Controls.Add(this.NUDWeaponLevel);
this.TPWeapon.Controls.Add(this.ListWeapons); this.TPWeapon.Controls.Add(this.ListWeapons);
resources.ApplyResources(this.TPWeapon, "TPWeapon");
this.TPWeapon.Name = "TPWeapon"; this.TPWeapon.Name = "TPWeapon";
this.TPWeapon.UseVisualStyleBackColor = true; this.TPWeapon.UseVisualStyleBackColor = true;
// //
@ -1171,10 +1164,10 @@ namespace GrasscutterTools.Forms
// //
// TPStats // TPStats
// //
resources.ApplyResources(this.TPStats, "TPStats");
this.TPStats.Controls.Add(this.GrpSetStats); this.TPStats.Controls.Add(this.GrpSetStats);
this.TPStats.Controls.Add(this.GrpTalentLevel); this.TPStats.Controls.Add(this.GrpTalentLevel);
this.TPStats.Controls.Add(this.LblStatsDescription); this.TPStats.Controls.Add(this.LblStatsDescription);
resources.ApplyResources(this.TPStats, "TPStats");
this.TPStats.Name = "TPStats"; this.TPStats.Name = "TPStats";
this.TPStats.UseVisualStyleBackColor = true; this.TPStats.UseVisualStyleBackColor = true;
// //
@ -1206,9 +1199,9 @@ namespace GrasscutterTools.Forms
// //
// LblStatTip // LblStatTip
// //
resources.ApplyResources(this.LblStatTip, "LblStatTip");
this.LblStatTip.AutoEllipsis = true; this.LblStatTip.AutoEllipsis = true;
this.LblStatTip.ForeColor = System.Drawing.SystemColors.GrayText; this.LblStatTip.ForeColor = System.Drawing.SystemColors.GrayText;
resources.ApplyResources(this.LblStatTip, "LblStatTip");
this.LblStatTip.Name = "LblStatTip"; this.LblStatTip.Name = "LblStatTip";
// //
// LblStatPercent // LblStatPercent
@ -1234,9 +1227,9 @@ namespace GrasscutterTools.Forms
// //
// CmbStat // CmbStat
// //
resources.ApplyResources(this.CmbStat, "CmbStat");
this.CmbStat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CmbStat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CmbStat.FormattingEnabled = true; this.CmbStat.FormattingEnabled = true;
resources.ApplyResources(this.CmbStat, "CmbStat");
this.CmbStat.Name = "CmbStat"; this.CmbStat.Name = "CmbStat";
this.CmbStat.SelectedIndexChanged += new System.EventHandler(this.SetStatsInputChanged); this.CmbStat.SelectedIndexChanged += new System.EventHandler(this.SetStatsInputChanged);
// //
@ -1296,7 +1289,6 @@ namespace GrasscutterTools.Forms
// //
// TPAvatar // TPAvatar
// //
resources.ApplyResources(this.TPAvatar, "TPAvatar");
this.TPAvatar.Controls.Add(this.BtnGiveAllChar); this.TPAvatar.Controls.Add(this.BtnGiveAllChar);
this.TPAvatar.Controls.Add(this.LblConstellationTip); this.TPAvatar.Controls.Add(this.LblConstellationTip);
this.TPAvatar.Controls.Add(this.LblAvatarConstellation); this.TPAvatar.Controls.Add(this.LblAvatarConstellation);
@ -1306,6 +1298,7 @@ namespace GrasscutterTools.Forms
this.TPAvatar.Controls.Add(this.LblAvatarLevel); this.TPAvatar.Controls.Add(this.LblAvatarLevel);
this.TPAvatar.Controls.Add(this.NUDAvatarLevel); this.TPAvatar.Controls.Add(this.NUDAvatarLevel);
this.TPAvatar.Controls.Add(this.CmbAvatar); this.TPAvatar.Controls.Add(this.CmbAvatar);
resources.ApplyResources(this.TPAvatar, "TPAvatar");
this.TPAvatar.Name = "TPAvatar"; this.TPAvatar.Name = "TPAvatar";
this.TPAvatar.UseVisualStyleBackColor = true; this.TPAvatar.UseVisualStyleBackColor = true;
// //
@ -1391,7 +1384,6 @@ namespace GrasscutterTools.Forms
// //
// TPSpawn // TPSpawn
// //
resources.ApplyResources(this.TPSpawn, "TPSpawn");
this.TPSpawn.Controls.Add(this.LblClearSpawnLogs); this.TPSpawn.Controls.Add(this.LblClearSpawnLogs);
this.TPSpawn.Controls.Add(this.BtnSaveSpawnLog); this.TPSpawn.Controls.Add(this.BtnSaveSpawnLog);
this.TPSpawn.Controls.Add(this.BtnRemoveSpawnLog); this.TPSpawn.Controls.Add(this.BtnRemoveSpawnLog);
@ -1404,6 +1396,7 @@ namespace GrasscutterTools.Forms
this.TPSpawn.Controls.Add(this.NUDEntityLevel); this.TPSpawn.Controls.Add(this.NUDEntityLevel);
this.TPSpawn.Controls.Add(this.TxtEntityFilter); this.TPSpawn.Controls.Add(this.TxtEntityFilter);
this.TPSpawn.Controls.Add(this.ListEntity); this.TPSpawn.Controls.Add(this.ListEntity);
resources.ApplyResources(this.TPSpawn, "TPSpawn");
this.TPSpawn.Name = "TPSpawn"; this.TPSpawn.Name = "TPSpawn";
this.TPSpawn.UseVisualStyleBackColor = true; this.TPSpawn.UseVisualStyleBackColor = true;
// //
@ -1544,13 +1537,13 @@ namespace GrasscutterTools.Forms
// //
// TPQuest // TPQuest
// //
resources.ApplyResources(this.TPQuest, "TPQuest");
this.TPQuest.Controls.Add(this.GrpQuestFilters); this.TPQuest.Controls.Add(this.GrpQuestFilters);
this.TPQuest.Controls.Add(this.BtnFinishQuest); this.TPQuest.Controls.Add(this.BtnFinishQuest);
this.TPQuest.Controls.Add(this.BtnAddQuest); this.TPQuest.Controls.Add(this.BtnAddQuest);
this.TPQuest.Controls.Add(this.LblQuestDescription); this.TPQuest.Controls.Add(this.LblQuestDescription);
this.TPQuest.Controls.Add(this.TxtQuestFilter); this.TPQuest.Controls.Add(this.TxtQuestFilter);
this.TPQuest.Controls.Add(this.ListQuest); this.TPQuest.Controls.Add(this.ListQuest);
resources.ApplyResources(this.TPQuest, "TPQuest");
this.TPQuest.Name = "TPQuest"; this.TPQuest.Name = "TPQuest";
this.TPQuest.UseVisualStyleBackColor = true; this.TPQuest.UseVisualStyleBackColor = true;
// //
@ -1622,7 +1615,6 @@ namespace GrasscutterTools.Forms
// //
// TPArtifact // TPArtifact
// //
resources.ApplyResources(this.TPArtifact, "TPArtifact");
this.TPArtifact.Controls.Add(this.LblArtifactLevelTip); this.TPArtifact.Controls.Add(this.LblArtifactLevelTip);
this.TPArtifact.Controls.Add(this.BtnAddSubAttr); this.TPArtifact.Controls.Add(this.BtnAddSubAttr);
this.TPArtifact.Controls.Add(this.LblArtifactName); this.TPArtifact.Controls.Add(this.LblArtifactName);
@ -1642,6 +1634,7 @@ namespace GrasscutterTools.Forms
this.TPArtifact.Controls.Add(this.NUDArtifactLevel); this.TPArtifact.Controls.Add(this.NUDArtifactLevel);
this.TPArtifact.Controls.Add(this.LblArtifactStars); this.TPArtifact.Controls.Add(this.LblArtifactStars);
this.TPArtifact.Controls.Add(this.NUDArtifactStars); this.TPArtifact.Controls.Add(this.NUDArtifactStars);
resources.ApplyResources(this.TPArtifact, "TPArtifact");
this.TPArtifact.Name = "TPArtifact"; this.TPArtifact.Name = "TPArtifact";
this.TPArtifact.UseVisualStyleBackColor = true; this.TPArtifact.UseVisualStyleBackColor = true;
// //
@ -1807,7 +1800,6 @@ namespace GrasscutterTools.Forms
// //
// TPCustom // TPCustom
// //
resources.ApplyResources(this.TPCustom, "TPCustom");
this.TPCustom.Controls.Add(this.BtnExportCustomCommands); this.TPCustom.Controls.Add(this.BtnExportCustomCommands);
this.TPCustom.Controls.Add(this.BtnLoadCustomCommands); this.TPCustom.Controls.Add(this.BtnLoadCustomCommands);
this.TPCustom.Controls.Add(this.LblCustomName); this.TPCustom.Controls.Add(this.LblCustomName);
@ -1815,6 +1807,7 @@ namespace GrasscutterTools.Forms
this.TPCustom.Controls.Add(this.BtnRemoveCustomCommand); this.TPCustom.Controls.Add(this.BtnRemoveCustomCommand);
this.TPCustom.Controls.Add(this.BtnSaveCustomCommand); this.TPCustom.Controls.Add(this.BtnSaveCustomCommand);
this.TPCustom.Controls.Add(this.TxtCustomName); this.TPCustom.Controls.Add(this.TxtCustomName);
resources.ApplyResources(this.TPCustom, "TPCustom");
this.TPCustom.Name = "TPCustom"; this.TPCustom.Name = "TPCustom";
this.TPCustom.UseVisualStyleBackColor = true; this.TPCustom.UseVisualStyleBackColor = true;
// //
@ -1878,12 +1871,12 @@ namespace GrasscutterTools.Forms
// //
// TPHome // TPHome
// //
resources.ApplyResources(this.TPHome, "TPHome");
this.TPHome.Controls.Add(this.LblAbout); this.TPHome.Controls.Add(this.LblAbout);
this.TPHome.Controls.Add(this.BtnOpenTextMap); this.TPHome.Controls.Add(this.BtnOpenTextMap);
this.TPHome.Controls.Add(this.BtnOpenGachaBannerEditor); this.TPHome.Controls.Add(this.BtnOpenGachaBannerEditor);
this.TPHome.Controls.Add(this.GrasscutterToolsIcon); this.TPHome.Controls.Add(this.GrasscutterToolsIcon);
this.TPHome.Controls.Add(this.GrpSettings); this.TPHome.Controls.Add(this.GrpSettings);
resources.ApplyResources(this.TPHome, "TPHome");
this.TPHome.Name = "TPHome"; this.TPHome.Name = "TPHome";
this.TPHome.UseVisualStyleBackColor = true; this.TPHome.UseVisualStyleBackColor = true;
// //
@ -1916,8 +1909,9 @@ namespace GrasscutterTools.Forms
// GrpSettings // GrpSettings
// //
resources.ApplyResources(this.GrpSettings, "GrpSettings"); resources.ApplyResources(this.GrpSettings, "GrpSettings");
this.GrpSettings.Controls.Add(this.LblGCVersion);
this.GrpSettings.Controls.Add(this.CmbGcVersions);
this.GrpSettings.Controls.Add(this.ChkTopMost); this.GrpSettings.Controls.Add(this.ChkTopMost);
this.GrpSettings.Controls.Add(this.ChkNewCommand);
this.GrpSettings.Controls.Add(this.CmbLanguage); this.GrpSettings.Controls.Add(this.CmbLanguage);
this.GrpSettings.Controls.Add(this.LblLanguage); this.GrpSettings.Controls.Add(this.LblLanguage);
this.GrpSettings.Controls.Add(this.NUDUid); this.GrpSettings.Controls.Add(this.NUDUid);
@ -1931,22 +1925,13 @@ namespace GrasscutterTools.Forms
resources.ApplyResources(this.ChkTopMost, "ChkTopMost"); resources.ApplyResources(this.ChkTopMost, "ChkTopMost");
this.ChkTopMost.Name = "ChkTopMost"; this.ChkTopMost.Name = "ChkTopMost";
this.ChkTopMost.UseVisualStyleBackColor = true; this.ChkTopMost.UseVisualStyleBackColor = true;
this.ChkTopMost.CheckedChanged += new System.EventHandler(this.ChkTopMost_CheckedChanged);
//
// ChkNewCommand
//
resources.ApplyResources(this.ChkNewCommand, "ChkNewCommand");
this.ChkNewCommand.Name = "ChkNewCommand";
this.ChkNewCommand.UseVisualStyleBackColor = true;
this.ChkNewCommand.CheckedChanged += new System.EventHandler(this.ChkNewCommand_CheckedChanged);
// //
// CmbLanguage // CmbLanguage
// //
resources.ApplyResources(this.CmbLanguage, "CmbLanguage");
this.CmbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CmbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CmbLanguage.FormattingEnabled = true; this.CmbLanguage.FormattingEnabled = true;
resources.ApplyResources(this.CmbLanguage, "CmbLanguage");
this.CmbLanguage.Name = "CmbLanguage"; this.CmbLanguage.Name = "CmbLanguage";
this.CmbLanguage.SelectedIndexChanged += new System.EventHandler(this.CmbLanguage_SelectedIndexChanged);
// //
// LblLanguage // LblLanguage
// //
@ -1998,6 +1983,26 @@ namespace GrasscutterTools.Forms
this.TCMain.Name = "TCMain"; this.TCMain.Name = "TCMain";
this.TCMain.SelectedIndex = 0; this.TCMain.SelectedIndex = 0;
// //
// CmbGcVersions
//
this.CmbGcVersions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CmbGcVersions.FormattingEnabled = true;
resources.ApplyResources(this.CmbGcVersions, "CmbGcVersions");
this.CmbGcVersions.Name = "CmbGcVersions";
//
// LblGCVersion
//
resources.ApplyResources(this.LblGCVersion, "LblGCVersion");
this.LblGCVersion.Name = "LblGCVersion";
//
// TxtBanReason
//
this.TxtBanReason.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
resources.ApplyResources(this.TxtBanReason, "TxtBanReason");
this.TxtBanReason.Maximum = 0F;
this.TxtBanReason.Minimum = 0F;
this.TxtBanReason.Name = "TxtBanReason";
//
// FormMain // FormMain
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@ -2272,7 +2277,6 @@ namespace GrasscutterTools.Forms
private System.Windows.Forms.PictureBox GrasscutterToolsIcon; private System.Windows.Forms.PictureBox GrasscutterToolsIcon;
private System.Windows.Forms.GroupBox GrpSettings; private System.Windows.Forms.GroupBox GrpSettings;
private System.Windows.Forms.CheckBox ChkTopMost; private System.Windows.Forms.CheckBox ChkTopMost;
private System.Windows.Forms.CheckBox ChkNewCommand;
private System.Windows.Forms.ComboBox CmbLanguage; private System.Windows.Forms.ComboBox CmbLanguage;
private System.Windows.Forms.Label LblLanguage; private System.Windows.Forms.Label LblLanguage;
private System.Windows.Forms.NumericUpDown NUDUid; private System.Windows.Forms.NumericUpDown NUDUid;
@ -2294,5 +2298,7 @@ namespace GrasscutterTools.Forms
private System.Windows.Forms.LinkLabel LnkLinks; private System.Windows.Forms.LinkLabel LnkLinks;
private System.Windows.Forms.Button BtnUnlockStat; private System.Windows.Forms.Button BtnUnlockStat;
private System.Windows.Forms.Button BtnLockStat; private System.Windows.Forms.Button BtnLockStat;
private System.Windows.Forms.Label LblGCVersion;
private System.Windows.Forms.ComboBox CmbGcVersions;
} }
} }

View File

@ -23,6 +23,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
@ -39,7 +40,7 @@ namespace GrasscutterTools.Forms
{ {
public partial class FormMain : Form public partial class FormMain : Form
{ {
#region - - #region - Init -
public FormMain() public FormMain()
{ {
@ -52,7 +53,6 @@ namespace GrasscutterTools.Forms
private void FormMain_Load(object sender, EventArgs e) private void FormMain_Load(object sender, EventArgs e)
{ {
MultiLanguage.LoadLanguage(this, typeof(FormMain));
#if DEBUG #if DEBUG
Text += " - by jie65535 - v" + AppVersion.ToString(3) + "-debug"; Text += " - by jie65535 - v" + AppVersion.ToString(3) + "-debug";
#else #else
@ -74,7 +74,6 @@ namespace GrasscutterTools.Forms
ChangeTPArtifact(); ChangeTPArtifact();
ChangeBtnGiveAllChar(); ChangeBtnGiveAllChar();
} }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
@ -82,31 +81,40 @@ namespace GrasscutterTools.Forms
SaveSettings(); SaveSettings();
} }
private readonly string[] LanguageNames = new string[] { "简体中文", "繁體中文", "English", "Русский" };
private readonly string[] Languages = new string[] { "zh-CN", "zh-TW", "en-US", "ru-RU" };
/// <summary>
/// 应用版本
/// </summary>
private Version AppVersion; private Version AppVersion;
/// <summary>
/// 加载应用版本
/// </summary>
private void LoadVersion() private void LoadVersion()
{ {
AppVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; AppVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
} }
/// <summary>
/// 载入设置
/// </summary>
private void LoadSettings() private void LoadSettings()
{ {
try try
{ {
// 恢复自动复制选项状态
ChkAutoCopy.Checked = Settings.Default.AutoCopy; ChkAutoCopy.Checked = Settings.Default.AutoCopy;
NUDUid.Value = Settings.Default.Uid;
ChkTopMost.Checked = Settings.Default.IsTopMost; // 初始化首页设置
ChkNewCommand.Checked = Settings.Default.CommandVersion == "1.2.2"; InitHomeSettings();
CmbLanguage.Items.AddRange(LanguageNames);
CmbLanguage.SelectedIndex = Array.IndexOf(Languages, Settings.Default.DefaultLanguage);
// 初始化获取物品记录
InitGiveItemRecord(); InitGiveItemRecord();
// 初始化生成记录
InitSpawnRecord(); InitSpawnRecord();
// 初始化开放命令
InitOpenCommand(); InitOpenCommand();
} }
catch (Exception ex) catch (Exception ex)
@ -115,14 +123,14 @@ namespace GrasscutterTools.Forms
} }
} }
/// <summary>
/// 保存设置
/// </summary>
private void SaveSettings() private void SaveSettings()
{ {
try try
{ {
Settings.Default.AutoCopy = ChkAutoCopy.Checked; Settings.Default.AutoCopy = ChkAutoCopy.Checked;
Settings.Default.Uid = NUDUid.Value;
Settings.Default.IsTopMost = ChkTopMost.Checked;
Settings.Default.CommandVersion = ChkNewCommand.Checked ? "1.2.2" : string.Empty;
SaveCustomCommands(); SaveCustomCommands();
SaveGiveItemRecord(); SaveGiveItemRecord();
SaveSpawnRecord(); SaveSpawnRecord();
@ -172,12 +180,60 @@ namespace GrasscutterTools.Forms
#endif #endif
} }
#endregion - - #endregion - Init -
#region - - #region - Home -
/// <summary>
/// 命令版本
/// </summary>
private CommandVersion CommandVersion;
/// <summary>
/// 卡池编辑器窗口实例
/// </summary>
private Form GachaBannerEditor; private Form GachaBannerEditor;
/// <summary>
/// 初始化首页设置
/// </summary>
private void InitHomeSettings()
{
// 玩家UID
NUDUid.Value = Settings.Default.Uid;
NUDUid.ValueChanged += (o, e) => Settings.Default.Uid = NUDUid.Value;
// 置顶
ChkTopMost.Checked = Settings.Default.IsTopMost;
ChkTopMost.CheckedChanged += (o, e) => Settings.Default.IsTopMost = TopMost = ChkTopMost.Checked;
// 命令版本初始化
CommandVersion = Version.TryParse(Settings.Default.CommandVersion, out Version current) ? new CommandVersion(current) : CommandVersion.Latest();
CmbGcVersions.DataSource = CommandVersion.List.Select(it => it.ToString(3)).ToList();
CmbGcVersions.SelectedIndex = Array.IndexOf(CommandVersion.List, CommandVersion.Current);
CmbGcVersions.SelectedIndexChanged += (o, e) => CommandVersion.Current = CommandVersion.List[CmbGcVersions.SelectedIndex];
CommandVersion.VersionChanged += OnCommandVersionChanged;
// 初始化多语言
CmbLanguage.DataSource = MultiLanguage.LanguageNames;
if (string.IsNullOrEmpty(Settings.Default.DefaultLanguage))
{
// 如果未选择语言,则默认载入本地语言
var i = Array.IndexOf(MultiLanguage.Languages, Thread.CurrentThread.CurrentUICulture);
// 仅支持时切换,避免重复加载
if (i > 0) CmbLanguage.SelectedIndex = i;
}
else
{
CmbLanguage.SelectedIndex = Array.IndexOf(MultiLanguage.Languages, Settings.Default.DefaultLanguage);
}
CmbLanguage.SelectedIndexChanged += CmbLanguage_SelectedIndexChanged;
}
/// <summary>
/// 点击打开卡池编辑器时触发
/// </summary>
private void BtnOpenGachaBannerEditor_Click(object sender, EventArgs e) private void BtnOpenGachaBannerEditor_Click(object sender, EventArgs e)
{ {
if (GachaBannerEditor == null || GachaBannerEditor.IsDisposed) if (GachaBannerEditor == null || GachaBannerEditor.IsDisposed)
@ -192,6 +248,9 @@ namespace GrasscutterTools.Forms
} }
} }
/// <summary>
/// 文本浏览器窗口实例
/// </summary>
private FormTextMapBrowser TextMapBrowser; private FormTextMapBrowser TextMapBrowser;
private void BtnOpenTextMap_Click(object sender, EventArgs e) private void BtnOpenTextMap_Click(object sender, EventArgs e)
@ -207,151 +266,50 @@ namespace GrasscutterTools.Forms
TextMapBrowser.TopMost = false; TextMapBrowser.TopMost = false;
} }
} }
async private void ButtonOpenGOODImport_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog
{
Filter = "GOOD file (*.GOOD;*.json)|*.GOOD;*.json|All files (*.*)|*.*",
};
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
if (DialogResult.Yes != MessageBox.Show(Resources.GOODImportText + openFileDialog1.FileName + "?",
Resources.GOODImportTitle, MessageBoxButtons.YesNo))
return;
try
{
GOOD.GOOD good = JsonConvert.DeserializeObject<GOOD.GOOD>(File.ReadAllText(openFileDialog1.FileName));
var commands_list = new List<string>();
var missingItems = new List<string>();
if (good.Characters != null)
{
foreach (var character in good.Characters)
{
if (character.Name != "Traveler")
{
if (GOODData.Avatars.TryGetValue(character.Name, out var character_id))
commands_list.Add("/give " + character_id + " lv" + character.Level + "c" + character.Constellation);
else
missingItems.Add(character.Name);
// TODO: Implement command to set talent level when giving character in Grasscutter
}
}
}
if (good.Weapons != null)
{
foreach (var weapon in good.Weapons)
{
if (GOODData.Weapons.TryGetValue(weapon.Name, out var weapon_id))
commands_list.Add("/give " + weapon_id + " lv" + weapon.Level + "r" + weapon.RefinementLevel);
else
missingItems.Add(weapon.Name);
// TODO: Implement command to give weapon directly to character in Grasscutter
}
}
if (good.Artifacts != null)
{
foreach (var artifact in good.Artifacts)
{
// Format: set rarity slot
if (!GOODData.ArtifactCats.TryGetValue(artifact.SetName, out var artifact_set_id))
{
missingItems.Add(artifact.SetName);
continue;
}
var artifact_id = artifact_set_id.ToString() + artifact.Rarity.ToString() + GOODData.ArtifactSlotMap[artifact.GearSlot] + "4";
var artifact_mainStat_id = GOODData.ArtifactMainAttribution[artifact.MainStat];
var artifact_substats = "";
var artifact_substat_prefix = artifact.Rarity + "0";
int substat_count = 0;
foreach (var substat in artifact.SubStats)
{
if (substat.Value <= 0)
continue;
substat_count++;
var substat_key = substat.Stat;
var substat_key_id = GOODData.ArtifactSubAttribution[substat_key];
var substat_indices = ArtifactUtils.SplitSubstats(substat_key, artifact.Rarity, substat.Value);
foreach (int index in substat_indices)
{
artifact_substats += artifact_substat_prefix + substat_key_id + index.ToString() + " ";
}
}
// HACK: Add def+2 substat to counteract Grasscutter automatically adding another substat
if (substat_count == 4)
artifact_substats += "101081 ";
commands_list.Add("/give " + artifact_id + " lv" + artifact.Level + " " + artifact_mainStat_id + " " + artifact_substats);
// TODO: Implement command to give artifact directly to character in Grasscutter
}
}
// TODO: Materials
//if (good.Materials != null)
//{
// foreach (var material in good.Materials)
// {
// }
//}
var msg = string.Format("Loaded {0} Characters\nLoaded {1} Weapons\nLoaded {2} Artifacts\n",
good.Characters?.Count ?? 0,
good.Weapons?.Count ?? 0,
good.Artifacts?.Count ?? 0
);
if (missingItems.Count > 0)
{
msg += string.Format("There are {0} pieces of data that cannot be parsed, including:\n{1}",
missingItems.Count,
string.Join("\n", missingItems.Take(10)));
if (missingItems.Count > 10)
msg += "......";
}
msg += "Do you want to start?";
if (DialogResult.Yes != MessageBox.Show(msg, Resources.Tips, MessageBoxButtons.YesNo, MessageBoxIcon.Information))
return;
if (await RunCommands(commands_list.ToArray()))
MessageBox.Show(Resources.GOODImportSuccess);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
/// <summary>
/// 语言选中项改变时触发
/// </summary>
private void CmbLanguage_SelectedIndexChanged(object sender, EventArgs e) private void CmbLanguage_SelectedIndexChanged(object sender, EventArgs e)
{ {
MultiLanguage.SetDefaultLanguage(Languages[CmbLanguage.SelectedIndex]); if (CmbLanguage.SelectedIndex < 0) return;
// 切换默认语言
MultiLanguage.SetDefaultLanguage(MultiLanguage.Languages[CmbLanguage.SelectedIndex]);
// 动态更改语言
MultiLanguage.LoadLanguage(this, typeof(FormMain));
// 重新载入页面资源
FormMain_Load(this, EventArgs.Empty); FormMain_Load(this, EventArgs.Empty);
} }
private void ChkTopMost_CheckedChanged(object sender, EventArgs e) /// <summary>
{ /// 命令版本改变时触发
TopMost = ChkTopMost.Checked; /// </summary>
} /// <param name="sender"></param>
/// <param name="e"></param>
private void ChkNewCommand_CheckedChanged(object sender, EventArgs e) private void OnCommandVersionChanged(object sender, EventArgs e)
{ {
Settings.Default.CommandVersion = CommandVersion.Current.ToString(3);
ChangeTPArtifact(); ChangeTPArtifact();
ChangeBtnGiveAllChar(); ChangeBtnGiveAllChar();
} }
#endregion - - #endregion - Home -
#region - - #region - Custom -
/// <summary>
/// 自定义命令保存位置
/// </summary>
private readonly string CustomCommandsFilePath = Path.Combine(Application.LocalUserAppDataPath, "CustomCommands.txt"); private readonly string CustomCommandsFilePath = Path.Combine(Application.LocalUserAppDataPath, "CustomCommands.txt");
/// <summary>
/// 自定义命令是否存在更改
/// </summary>
private bool CustomCommandsChanged; private bool CustomCommandsChanged;
/// <summary>
/// 加载自定义命令
/// </summary>
private void LoadCustomCommands() private void LoadCustomCommands()
{ {
if (File.Exists(CustomCommandsFilePath)) if (File.Exists(CustomCommandsFilePath))
@ -360,6 +318,10 @@ namespace GrasscutterTools.Forms
LoadCustomCommandControls(Resources.CustomCommands); LoadCustomCommandControls(Resources.CustomCommands);
} }
/// <summary>
/// 加载自定义命令控件列表
/// </summary>
/// <param name="commands">命令集(示例:"标签1\n命令1\n标签2\n命令2"</param>
private void LoadCustomCommandControls(string commands) private void LoadCustomCommandControls(string commands)
{ {
FLPCustomCommands.Controls.Clear(); FLPCustomCommands.Controls.Clear();
@ -368,12 +330,19 @@ namespace GrasscutterTools.Forms
AddCustomCommand(lines[i].Trim(), lines[i + 1].Trim()); AddCustomCommand(lines[i].Trim(), lines[i + 1].Trim());
} }
/// <summary>
/// 保存自定义命令
/// </summary>
private void SaveCustomCommands() private void SaveCustomCommands()
{ {
if (CustomCommandsChanged) if (CustomCommandsChanged)
File.WriteAllText(CustomCommandsFilePath, SaveCustomCommandControls()); File.WriteAllText(CustomCommandsFilePath, SaveCustomCommandControls());
} }
/// <summary>
/// 保存自定义命令控件列表
/// </summary>
/// <returns>命令集(示例:"标签1\n命令1\n标签2\n命令2"</returns>
private string SaveCustomCommandControls() private string SaveCustomCommandControls()
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
@ -385,6 +354,9 @@ namespace GrasscutterTools.Forms
return builder.ToString(); return builder.ToString();
} }
/// <summary>
/// 自定义命令点击时触发
/// </summary>
private void CustomCommand_Click(object sender, LinkLabelLinkClickedEventArgs e) private void CustomCommand_Click(object sender, LinkLabelLinkClickedEventArgs e)
{ {
if (sender is LinkLabel lnk && lnk.Tag is string command) if (sender is LinkLabel lnk && lnk.Tag is string command)
@ -394,6 +366,11 @@ namespace GrasscutterTools.Forms
} }
} }
/// <summary>
/// 点击保存自定义命令列表时触发
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void BtnSaveCustomCommand_Click(object sender, EventArgs e) private async void BtnSaveCustomCommand_Click(object sender, EventArgs e)
{ {
if (string.IsNullOrWhiteSpace(TxtCustomName.Text)) if (string.IsNullOrWhiteSpace(TxtCustomName.Text))
@ -425,6 +402,11 @@ namespace GrasscutterTools.Forms
await ButtonComplete(BtnSaveCustomCommand); await ButtonComplete(BtnSaveCustomCommand);
} }
/// <summary>
/// 添加自定义命令
/// </summary>
/// <param name="name">标签</param>
/// <param name="command">命令</param>
private void AddCustomCommand(string name, string command) private void AddCustomCommand(string name, string command)
{ {
var lnk = new LinkLabel var lnk = new LinkLabel
@ -437,6 +419,9 @@ namespace GrasscutterTools.Forms
FLPCustomCommands.Controls.Add(lnk); FLPCustomCommands.Controls.Add(lnk);
} }
/// <summary>
/// 点击移除自定义命令按钮时触发
/// </summary>
private async void BtnRemoveCustomCommand_Click(object sender, EventArgs e) private async void BtnRemoveCustomCommand_Click(object sender, EventArgs e)
{ {
if (string.IsNullOrWhiteSpace(TxtCustomName.Text)) if (string.IsNullOrWhiteSpace(TxtCustomName.Text))
@ -462,6 +447,9 @@ namespace GrasscutterTools.Forms
MessageBox.Show(Resources.CommandNotFound, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(Resources.CommandNotFound, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
/// <summary>
/// 点击导入自定义命令时触发
/// </summary>
private void BtnImport_Click(object sender, EventArgs e) private void BtnImport_Click(object sender, EventArgs e)
{ {
var dialog = new OpenFileDialog var dialog = new OpenFileDialog
@ -479,6 +467,11 @@ namespace GrasscutterTools.Forms
} }
} }
/// <summary>
/// 点击导出自定义命令时触发
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnExport_Click(object sender, EventArgs e) private void BtnExport_Click(object sender, EventArgs e)
{ {
var dialog = new SaveFileDialog var dialog = new SaveFileDialog
@ -496,6 +489,9 @@ namespace GrasscutterTools.Forms
} }
} }
/// <summary>
/// 点击重置链接按钮时触发
/// </summary>
private void LnkResetCustomCommands_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void LnkResetCustomCommands_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{ {
if (MessageBox.Show(Resources.RestoreCustomCommands, Resources.Tips, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) if (MessageBox.Show(Resources.RestoreCustomCommands, Resources.Tips, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
@ -506,9 +502,9 @@ namespace GrasscutterTools.Forms
} }
} }
#endregion - - #endregion - Custom -
#region - - #region - Artifact -
private Dictionary<string, List<KeyValuePair<int, string>>> subAttrs; private Dictionary<string, List<KeyValuePair<int, string>>> subAttrs;
@ -620,7 +616,7 @@ namespace GrasscutterTools.Forms
id = id / 1000 * 1000 + (int)NUDArtifactStars.Value * 100 + id % 100; id = id / 1000 * 1000 + (int)NUDArtifactStars.Value * 100 + id % 100;
if (CmbMainAttribution.SelectedIndex < 0) if (CmbMainAttribution.SelectedIndex < 0)
{ {
if (ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
SetCommand("/give", $"{id} lv{NUDArtifactLevel.Value}"); SetCommand("/give", $"{id} lv{NUDArtifactLevel.Value}");
else else
SetCommand("/giveart", $"{id} {NUDArtifactLevel.Value}"); SetCommand("/giveart", $"{id} {NUDArtifactLevel.Value}");
@ -652,7 +648,7 @@ namespace GrasscutterTools.Forms
subAttrs += $"{kv.Key} "; subAttrs += $"{kv.Key} ";
} }
} }
if (ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
SetCommand("/give", $"{id} lv{NUDArtifactLevel.Value} {mainAttr} {subAttrs}"); SetCommand("/give", $"{id} lv{NUDArtifactLevel.Value} {mainAttr} {subAttrs}");
else else
SetCommand("/giveart", $"{id} {mainAttr} {subAttrs}{NUDArtifactLevel.Value}"); SetCommand("/giveart", $"{id} {mainAttr} {subAttrs}{NUDArtifactLevel.Value}");
@ -678,7 +674,7 @@ namespace GrasscutterTools.Forms
private void ChangeTPArtifact() private void ChangeTPArtifact()
{ {
if (ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
{ {
NUDArtifactLevel.Minimum = 0; NUDArtifactLevel.Minimum = 0;
NUDArtifactLevel.Maximum = 20; NUDArtifactLevel.Maximum = 20;
@ -691,9 +687,9 @@ namespace GrasscutterTools.Forms
LblArtifactLevelTip.Text = $"[{NUDArtifactLevel.Minimum}-{NUDArtifactLevel.Maximum}]"; LblArtifactLevelTip.Text = $"[{NUDArtifactLevel.Minimum}-{NUDArtifactLevel.Maximum}]";
} }
#endregion - - #endregion - Artifact -
#region - - #region - Weapons -
private void InitWeapons() private void InitWeapons()
{ {
@ -716,16 +712,16 @@ namespace GrasscutterTools.Forms
if (!string.IsNullOrEmpty(name)) if (!string.IsNullOrEmpty(name))
{ {
var id = name.Substring(0, name.IndexOf(':')).Trim(); var id = name.Substring(0, name.IndexOf(':')).Trim();
if (ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
SetCommand("/give", $"{id} x{NUDWeaponAmout.Value} lv{NUDWeaponLevel.Value} r{NUDWeaponRefinement.Value}"); SetCommand("/give", $"{id} x{NUDWeaponAmout.Value} lv{NUDWeaponLevel.Value} r{NUDWeaponRefinement.Value}");
else else
SetCommand("/give", $"{id} {NUDWeaponAmout.Value} {NUDWeaponLevel.Value} {NUDWeaponRefinement.Value}"); SetCommand("/give", $"{id} {NUDWeaponAmout.Value} {NUDWeaponLevel.Value} {NUDWeaponRefinement.Value}");
} }
} }
#endregion - - #endregion - Weapons -
#region - - #region - Items -
private void InitGameItemList() private void InitGameItemList()
{ {
@ -757,7 +753,7 @@ namespace GrasscutterTools.Forms
else else
{ {
NUDGameItemLevel.Enabled = true; NUDGameItemLevel.Enabled = true;
if (ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
SetCommand("/give", $"{id} x{NUDGameItemAmout.Value} lv{NUDGameItemLevel.Value}"); SetCommand("/give", $"{id} x{NUDGameItemAmout.Value} lv{NUDGameItemLevel.Value}");
else else
SetCommand("/give", $"{id} {NUDGameItemAmout.Value} {NUDGameItemLevel.Value}"); SetCommand("/give", $"{id} {NUDGameItemAmout.Value} {NUDGameItemLevel.Value}");
@ -838,9 +834,9 @@ namespace GrasscutterTools.Forms
#endregion -- -- #endregion -- --
#endregion - - #endregion - Items -
#region - - #region - Avatars -
private void InitAvatars() private void InitAvatars()
{ {
@ -867,7 +863,7 @@ namespace GrasscutterTools.Forms
private void GenAvatar(int level) private void GenAvatar(int level)
{ {
if (ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
{ {
int avatarId = GameData.Avatars.Ids[CmbAvatar.SelectedIndex]; int avatarId = GameData.Avatars.Ids[CmbAvatar.SelectedIndex];
SetCommand("/give", $"{avatarId} lv{level}"); SetCommand("/give", $"{avatarId} lv{level}");
@ -888,15 +884,12 @@ namespace GrasscutterTools.Forms
private void ChangeBtnGiveAllChar() private void ChangeBtnGiveAllChar()
{ {
if (ChkNewCommand.Checked) BtnGiveAllChar.Enabled = Check(CommandVersion.V1_2_2);
BtnGiveAllChar.Enabled = true;
else
BtnGiveAllChar.Enabled = false;
} }
#endregion - - #endregion - Avatars -
#region - - #region - Spawns -
private void InitEntityList() private void InitEntityList()
{ {
@ -1021,9 +1014,9 @@ namespace GrasscutterTools.Forms
#endregion -- -- #endregion -- --
#endregion - - #endregion - Spawns -
#region - - #region - Scenes -
private void InitScenes() private void InitScenes()
{ {
@ -1055,7 +1048,7 @@ namespace GrasscutterTools.Forms
// 可以直接弃用 scene 命令 // 可以直接弃用 scene 命令
var name = ListScenes.SelectedItem as string; var name = ListScenes.SelectedItem as string;
var id = name.Substring(0, name.IndexOf(':')).Trim(); var id = name.Substring(0, name.IndexOf(':')).Trim();
if (!ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
{ {
SetCommand("/scene", id.ToString()); SetCommand("/scene", id.ToString());
} }
@ -1070,7 +1063,7 @@ namespace GrasscutterTools.Forms
{ {
if (CmbClimateType.SelectedIndex < 0) if (CmbClimateType.SelectedIndex < 0)
return; return;
if (ChkNewCommand.Checked) if (Check(CommandVersion.V1_2_2))
SetCommand("/weather", CmbClimateType.SelectedIndex < climateTypes.Length ? climateTypes[CmbClimateType.SelectedIndex] : "none"); SetCommand("/weather", CmbClimateType.SelectedIndex < climateTypes.Length ? climateTypes[CmbClimateType.SelectedIndex] : "none");
else else
SetCommand("/weather", $"0 {CmbClimateType.SelectedIndex}"); SetCommand("/weather", $"0 {CmbClimateType.SelectedIndex}");
@ -1084,9 +1077,9 @@ namespace GrasscutterTools.Forms
SetCommand("/tp", args); SetCommand("/tp", args);
} }
#endregion - - #endregion - Scenes -
#region - - #region - Stats -
private void InitStatList() private void InitStatList()
{ {
@ -1127,9 +1120,9 @@ namespace GrasscutterTools.Forms
SetCommand("/talent", $"{(sender as LinkLabel).Tag} {NUDTalentLevel.Value}"); SetCommand("/talent", $"{(sender as LinkLabel).Tag} {NUDTalentLevel.Value}");
} }
#endregion - - #endregion - Stats -
#region - - #region - Management -
private void InitPermList() private void InitPermList()
{ {
@ -1176,18 +1169,18 @@ namespace GrasscutterTools.Forms
SetCommand($"/unban @{NUDBanUID.Value}"); SetCommand($"/unban @{NUDBanUID.Value}");
} }
#endregion - - #endregion - Management -
#region - - #region - About -
private void LnkGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void LnkGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{ {
OpenURL("https://github.com/jie65535/GrasscutterCommandGenerator"); OpenURL("https://github.com/jie65535/GrasscutterCommandGenerator");
} }
#endregion - - #endregion - About -
#region - - #region - Command -
private void SetCommand(string command) private void SetCommand(string command)
{ {
@ -1315,9 +1308,9 @@ namespace GrasscutterTools.Forms
} }
} }
#endregion - - #endregion - Command -
#region - - #region - General -
private async Task ButtonComplete(Button btn) private async Task ButtonComplete(Button btn)
{ {
@ -1343,9 +1336,11 @@ namespace GrasscutterTools.Forms
TTip.Show(message, control, 0, control.Size.Height, 3000); TTip.Show(message, control, 0, control.Size.Height, 3000);
} }
#endregion - - private bool Check(Version version) => CommandVersion.Current >= version;
#region - - #endregion - General -
#region - Command Logs -
private List<GameCommand> GetCommands(string commandsText) private List<GameCommand> GetCommands(string commandsText)
{ {
@ -1367,9 +1362,9 @@ namespace GrasscutterTools.Forms
return builder.ToString(); return builder.ToString();
} }
#endregion - - #endregion - Command Logs -
#region - - #region - Remote -
private OpenCommandAPI OC; private OpenCommandAPI OC;
@ -1389,7 +1384,8 @@ namespace GrasscutterTools.Forms
} }
else else
{ {
// 自动尝试查询本地服务端地址,降低门槛 #if !DEBUG
// 自动尝试查询本地服务端地址,降低使用门槛
Task.Run(async () => Task.Run(async () =>
{ {
await Task.Delay(5000); await Task.Delay(5000);
@ -1416,6 +1412,7 @@ namespace GrasscutterTools.Forms
} }
} }
}); });
#endif
} }
} }
@ -1592,9 +1589,133 @@ namespace GrasscutterTools.Forms
} }
} }
#endregion - - #endregion - Remote -
#region - - #region - GOOD -
async private void ButtonOpenGOODImport_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog
{
Filter = "GOOD file (*.GOOD;*.json)|*.GOOD;*.json|All files (*.*)|*.*",
};
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
if (DialogResult.Yes != MessageBox.Show(Resources.GOODImportText + openFileDialog1.FileName + "?",
Resources.GOODImportTitle, MessageBoxButtons.YesNo))
return;
try
{
GOOD.GOOD good = JsonConvert.DeserializeObject<GOOD.GOOD>(File.ReadAllText(openFileDialog1.FileName));
var commands_list = new List<string>();
var missingItems = new List<string>();
if (good.Characters != null)
{
foreach (var character in good.Characters)
{
if (character.Name != "Traveler")
{
if (GOODData.Avatars.TryGetValue(character.Name, out var character_id))
commands_list.Add("/give " + character_id + " lv" + character.Level + "c" + character.Constellation);
else
missingItems.Add(character.Name);
// TODO: Implement command to set talent level when giving character in Grasscutter
}
}
}
if (good.Weapons != null)
{
foreach (var weapon in good.Weapons)
{
if (GOODData.Weapons.TryGetValue(weapon.Name, out var weapon_id))
commands_list.Add("/give " + weapon_id + " lv" + weapon.Level + "r" + weapon.RefinementLevel);
else
missingItems.Add(weapon.Name);
// TODO: Implement command to give weapon directly to character in Grasscutter
}
}
if (good.Artifacts != null)
{
foreach (var artifact in good.Artifacts)
{
// Format: set rarity slot
if (!GOODData.ArtifactCats.TryGetValue(artifact.SetName, out var artifact_set_id))
{
missingItems.Add(artifact.SetName);
continue;
}
var artifact_id = artifact_set_id.ToString() + artifact.Rarity.ToString() + GOODData.ArtifactSlotMap[artifact.GearSlot] + "4";
var artifact_mainStat_id = GOODData.ArtifactMainAttribution[artifact.MainStat];
var artifact_substats = "";
var artifact_substat_prefix = artifact.Rarity + "0";
int substat_count = 0;
foreach (var substat in artifact.SubStats)
{
if (substat.Value <= 0)
continue;
substat_count++;
var substat_key = substat.Stat;
var substat_key_id = GOODData.ArtifactSubAttribution[substat_key];
var substat_indices = ArtifactUtils.SplitSubstats(substat_key, artifact.Rarity, substat.Value);
foreach (int index in substat_indices)
{
artifact_substats += artifact_substat_prefix + substat_key_id + index.ToString() + " ";
}
}
// HACK: Add def+2 substat to counteract Grasscutter automatically adding another substat
if (substat_count == 4)
artifact_substats += "101081 ";
commands_list.Add("/give " + artifact_id + " lv" + artifact.Level + " " + artifact_mainStat_id + " " + artifact_substats);
// TODO: Implement command to give artifact directly to character in Grasscutter
}
}
// TODO: Materials
//if (good.Materials != null)
//{
// foreach (var material in good.Materials)
// {
// }
//}
var msg = string.Format("Loaded {0} Characters\nLoaded {1} Weapons\nLoaded {2} Artifacts\n",
good.Characters?.Count ?? 0,
good.Weapons?.Count ?? 0,
good.Artifacts?.Count ?? 0
);
if (missingItems.Count > 0)
{
msg += string.Format("There are {0} pieces of data that cannot be parsed, including:\n{1}",
missingItems.Count,
string.Join("\n", missingItems.Take(10)));
if (missingItems.Count > 10)
msg += "......";
}
msg += "Do you want to start?";
if (DialogResult.Yes != MessageBox.Show(msg, Resources.Tips, MessageBoxButtons.YesNo, MessageBoxIcon.Information))
return;
if (await RunCommands(commands_list.ToArray()))
MessageBox.Show(Resources.GOODImportSuccess);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
#endregion
#region - Quests -
private void InitQuestList() private void InitQuestList()
{ {
@ -1629,7 +1750,7 @@ namespace GrasscutterTools.Forms
SetCommand("/quest", $"{(sender as Button).Tag} {id}"); SetCommand("/quest", $"{(sender as Button).Tag} {id}");
} }
#endregion - - #endregion - Quests -
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,94 @@
using System;
namespace GrasscutterTools.Game
{
/// <summary>
/// 命令版本
///
/// 用法:
/// ver = Version.TryParse(input, out Version current) ? new CommandVersion(current) : CommandVersion.Latest();
///
/// </summary>
internal class CommandVersion
{
/// <summary>
/// 初始化当前版本
/// </summary>
/// <param name="current"></param>
public CommandVersion(Version current)
{
this.current = current ?? throw new ArgumentNullException(nameof(current));
}
private Version current;
/// <summary>
/// 当前命令版本
/// </summary>
public Version Current
{
get => current;
set
{
if (current != value)
{
current = value;
OnVersionChanged();
}
}
}
/// <summary>
/// 选中版本改变事件
/// </summary>
public event EventHandler VersionChanged;
/// <summary>
/// 触发版本更改事件
/// </summary>
private void OnVersionChanged() => VersionChanged?.Invoke(this, EventArgs.Empty);
/// <summary>
/// 当前支持的最新版本 - 当未选择版本时,默认为最新版本
/// </summary>
public static CommandVersion Latest() => new CommandVersion(List[List.Length - 1]);
#region - Version List -
// 忽略更早以前的版本
/// <summary>
/// v1.2.1 2022/6/18
/// git 30c7bb94439a123417a6a1e0116acd3c40f2d115
/// </summary>
public static readonly Version V1_2_1 = new Version(1, 2, 1);
/// <summary>
/// v1.2.1 -> v1.2.2 2022/6/22
/// git aa43943025fefcda9739c9fcf242e67f1a7b83b4
/// </summary>
public static readonly Version V1_2_2 = new Version(1, 2, 2);
/// <summary>
/// v1.2.2 -> v1.2.3 2022/7/21
/// git a07b3f21e6fbeb9abfad8862d6fa0dc4a1c3c1a3
/// </summary>
public static readonly Version V1_2_3 = new Version(1, 2, 3);
// More...
/// <summary>
/// v1.2.3 -> v1.2.4 2022/7/21
/// git hash
/// </summary>
//public static readonly Version V1_2_4 = new Version(1, 2, 4);
public static Version[] List { get; } = new Version[] {
V1_2_1,
V1_2_2,
V1_2_3,
//V1_2_4,
};
#endregion - Version List -
}
}

View File

@ -81,6 +81,7 @@
<Compile Include="Forms\FormTextMapBrowser.Designer.cs"> <Compile Include="Forms\FormTextMapBrowser.Designer.cs">
<DependentUpon>FormTextMapBrowser.cs</DependentUpon> <DependentUpon>FormTextMapBrowser.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Game\CommandVersion.cs" />
<Compile Include="Game\Gacha\GachaBanner2.cs" /> <Compile Include="Game\Gacha\GachaBanner2.cs" />
<Compile Include="Game\GameCommand.cs" /> <Compile Include="Game\GameCommand.cs" />
<Compile Include="Game\Gacha\BannerType.cs" /> <Compile Include="Game\Gacha\BannerType.cs" />
@ -103,6 +104,7 @@
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="Settings.cs" />
<Compile Include="Utils\ArtifactUtils.cs" /> <Compile Include="Utils\ArtifactUtils.cs" />
<Compile Include="Utils\HttpHelper.cs" /> <Compile Include="Utils\HttpHelper.cs" />
<Compile Include="Utils\ReleaseAPI.cs" /> <Compile Include="Utils\ReleaseAPI.cs" />

View File

@ -23,14 +23,20 @@ namespace GrasscutterTools
{ {
internal static class MultiLanguage internal static class MultiLanguage
{ {
public static string DefaultLanguage = "zh-CN"; /// <summary>
/// 语言名称列表
/// </summary>
public static readonly string[] LanguageNames = new string[] { "简体中文", "繁體中文", "English", "Русский" };
/// <summary>
/// 语言代码列表
/// </summary>
public static readonly string[] Languages = new string[] { "zh-CN", "zh-TW", "en-US", "ru-RU" };
public static void SetDefaultLanguage(string lang) public static void SetDefaultLanguage(string lang)
{ {
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang);
DefaultLanguage = lang;
Properties.Settings.Default.DefaultLanguage = lang; Properties.Settings.Default.DefaultLanguage = lang;
Properties.Settings.Default.Save();
} }
/// <summary> /// <summary>

View File

@ -72,6 +72,10 @@ namespace GrasscutterTools
//处理非UI线程异常 //处理非UI线程异常
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
// 初始化语言环境
if (!string.IsNullOrEmpty(Settings.Default.DefaultLanguage))
MultiLanguage.SetDefaultLanguage(Settings.Default.DefaultLanguage);
Application.Run(new Forms.FormMain()); Application.Run(new Forms.FormMain());
} }

View File

@ -12,7 +12,7 @@ namespace GrasscutterTools.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -49,7 +49,7 @@ namespace GrasscutterTools.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("zh-CN")] [global::System.Configuration.DefaultSettingValueAttribute("")]
public string DefaultLanguage { public string DefaultLanguage {
get { get {
return ((string)(this["DefaultLanguage"])); return ((string)(this["DefaultLanguage"]));
@ -133,7 +133,7 @@ namespace GrasscutterTools.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1.2.2")] [global::System.Configuration.DefaultSettingValueAttribute("")]
public string CommandVersion { public string CommandVersion {
get { get {
return ((string)(this["CommandVersion"])); return ((string)(this["CommandVersion"]));

View File

@ -9,7 +9,7 @@
<Value Profile="(Default)">10001</Value> <Value Profile="(Default)">10001</Value>
</Setting> </Setting>
<Setting Name="DefaultLanguage" Type="System.String" Scope="User"> <Setting Name="DefaultLanguage" Type="System.String" Scope="User">
<Value Profile="(Default)">zh-CN</Value> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="ResourcesDirPath" Type="System.String" Scope="User"> <Setting Name="ResourcesDirPath" Type="System.String" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)" />
@ -30,7 +30,7 @@
<Value Profile="(Default)" /> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="CommandVersion" Type="System.String" Scope="User"> <Setting Name="CommandVersion" Type="System.String" Scope="User">
<Value Profile="(Default)">1.2.2</Value> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="IsTopMost" Type="System.Boolean" Scope="User"> <Setting Name="IsTopMost" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">False</Value>

View File

@ -0,0 +1,28 @@
namespace GrasscutterTools.Properties {
// 通过此类可以处理设置类的特定事件:
// 在更改某个设置的值之前将引发 SettingChanging 事件。
// 在更改某个设置的值之后将引发 PropertyChanged 事件。
// 在加载设置值之后将引发 SettingsLoaded 事件。
// 在保存设置值之前将引发 SettingsSaving 事件。
internal sealed partial class Settings {
public Settings() {
// // 若要为保存和更改设置添加事件处理程序,请取消注释下列行:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// 在此处添加用于处理 SettingChangingEvent 事件的代码。
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// 在此处添加用于处理 SettingsSaving 事件的代码。
}
}
}