From fac5182d4bbc942af703dce3d84840c1d9f0cdab Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 18 Nov 2019 16:25:27 -0800 Subject: [PATCH] Add a ChangeAllCount to current value dropdown --- .../Saves/Substructures/PokeDex/Zukan8.cs | 9 +++++++ .../Gen8/SAV_PokedexSWSH.Designer.cs | 24 +++++++++++++------ .../Save Editors/Gen8/SAV_PokedexSWSH.cs | 8 +++++++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/PKHeX.Core/Saves/Substructures/PokeDex/Zukan8.cs b/PKHeX.Core/Saves/Substructures/PokeDex/Zukan8.cs index 92c352f7d..43b39b14b 100644 --- a/PKHeX.Core/Saves/Substructures/PokeDex/Zukan8.cs +++ b/PKHeX.Core/Saves/Substructures/PokeDex/Zukan8.cs @@ -442,6 +442,15 @@ public override void ClearDexEntryAll(int species) Array.Clear(Block.Data, ofs, EntrySize); } + public void SetAllBattledCount(uint count = 500) + { + foreach (var kvp in DexLookup) + { + var species = kvp.Key; + SetBattledCount(species, count); + } + } + private static readonly HashSet SpeciesWithGigantamaxData = new HashSet { (int)Species.Charizard, diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.Designer.cs index 2a84ed496..1bc79dd01 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.Designer.cs @@ -74,6 +74,7 @@ private void InitializeComponent() this.CLB_4 = new System.Windows.Forms.CheckedListBox(); this.CLB_1 = new System.Windows.Forms.CheckedListBox(); this.CLB_2 = new System.Windows.Forms.CheckedListBox(); + this.mnuBattleCount = new System.Windows.Forms.ToolStripMenuItem(); this.GB_Language.SuspendLayout(); this.modifyMenu.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Battled)).BeginInit(); @@ -286,42 +287,43 @@ private void InitializeComponent() this.mnuSeenAll, this.mnuCaughtNone, this.mnuCaughtAll, - this.mnuComplete}); + this.mnuComplete, + this.mnuBattleCount}); this.modifyMenu.Name = "modifyMenu"; - this.modifyMenu.Size = new System.Drawing.Size(149, 114); + this.modifyMenu.Size = new System.Drawing.Size(202, 158); // // mnuSeenNone // this.mnuSeenNone.Name = "mnuSeenNone"; - this.mnuSeenNone.Size = new System.Drawing.Size(148, 22); + this.mnuSeenNone.Size = new System.Drawing.Size(201, 22); this.mnuSeenNone.Text = "Seen none"; this.mnuSeenNone.Click += new System.EventHandler(this.SeenNone); // // mnuSeenAll // this.mnuSeenAll.Name = "mnuSeenAll"; - this.mnuSeenAll.Size = new System.Drawing.Size(148, 22); + this.mnuSeenAll.Size = new System.Drawing.Size(201, 22); this.mnuSeenAll.Text = "Seen all"; this.mnuSeenAll.Click += new System.EventHandler(this.SeenAll); // // mnuCaughtNone // this.mnuCaughtNone.Name = "mnuCaughtNone"; - this.mnuCaughtNone.Size = new System.Drawing.Size(148, 22); + this.mnuCaughtNone.Size = new System.Drawing.Size(201, 22); this.mnuCaughtNone.Text = "Caught none"; this.mnuCaughtNone.Click += new System.EventHandler(this.CaughtNone); // // mnuCaughtAll // this.mnuCaughtAll.Name = "mnuCaughtAll"; - this.mnuCaughtAll.Size = new System.Drawing.Size(148, 22); + this.mnuCaughtAll.Size = new System.Drawing.Size(201, 22); this.mnuCaughtAll.Text = "Caught all"; this.mnuCaughtAll.Click += new System.EventHandler(this.CaughtAll); // // mnuComplete // this.mnuComplete.Name = "mnuComplete"; - this.mnuComplete.Size = new System.Drawing.Size(148, 22); + this.mnuComplete.Size = new System.Drawing.Size(201, 22); this.mnuComplete.Text = "Complete Dex"; this.mnuComplete.Click += new System.EventHandler(this.CompleteDex); // @@ -549,6 +551,13 @@ private void InitializeComponent() this.CLB_2.Size = new System.Drawing.Size(102, 374); this.CLB_2.TabIndex = 30; // + // mnuBattleCount + // + this.mnuBattleCount.Name = "mnuBattleCount"; + this.mnuBattleCount.Size = new System.Drawing.Size(201, 22); + this.mnuBattleCount.Text = "Change All Battle Count"; + this.mnuBattleCount.Click += new System.EventHandler(this.ChangeAllCounts); + // // SAV_PokedexSWSH // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -638,5 +647,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckedListBox CLB_1; private System.Windows.Forms.CheckedListBox CLB_2; private System.Windows.Forms.ComboBox CB_Gender; + private System.Windows.Forms.ToolStripMenuItem mnuBattleCount; } } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.cs index 8588b84fb..e6b52bedb 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_PokedexSWSH.cs @@ -226,5 +226,13 @@ private void CompleteDex(object sender, EventArgs e) System.Media.SystemSounds.Asterisk.Play(); GetEntry(); } + + private void ChangeAllCounts(object sender, EventArgs e) + { + SetEntry(); + Dex.SetAllBattledCount((uint)NUD_Battled.Value); + System.Media.SystemSounds.Asterisk.Play(); + GetEntry(); + } } }