From 7ea0e21b7df6d85bef24f9800ad4c729d56ac4cd Mon Sep 17 00:00:00 2001 From: Jonathan Herbert Date: Thu, 6 Apr 2023 23:54:42 -0400 Subject: [PATCH] Add Button To Unlock All Fashion in BDSP Misc Edits (#3856) --- .../Saves/Editors/EventUnlock/EventUnlocker8b.cs | 9 +++++++++ .../Save Editors/Gen8/SAV_Misc8b.Designer.cs | 15 ++++++++++++++- .../Subforms/Save Editors/Gen8/SAV_Misc8b.cs | 8 +++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Editing/Saves/Editors/EventUnlock/EventUnlocker8b.cs b/PKHeX.Core/Editing/Saves/Editors/EventUnlock/EventUnlocker8b.cs index d4b41d39a..449fc052f 100644 --- a/PKHeX.Core/Editing/Saves/Editors/EventUnlock/EventUnlocker8b.cs +++ b/PKHeX.Core/Editing/Saves/Editors/EventUnlock/EventUnlocker8b.cs @@ -97,4 +97,13 @@ public void RespawnCresselia() SAV.FlagWork.SetFlag(532, false); // clear vanish SAV.Encounter.Roamer2Encount = 0; // not actively roaming } + + public void UnlockFashion() + { + const int FASHION_START = 1246; + const int FASHION_END = 1257; + for (int i = FASHION_START; i <= FASHION_END; i++) + SAV.FlagWork.SetFlag(i, true); + } + } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.Designer.cs index bc589fbef..8ddac605e 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.Designer.cs @@ -41,6 +41,7 @@ private void InitializeComponent() this.B_Darkrai = new System.Windows.Forms.Button(); this.B_Shaymin = new System.Windows.Forms.Button(); this.B_Spiritomb = new System.Windows.Forms.Button(); + this.B_Fashion = new System.Windows.Forms.Button(); this.TC_Misc.SuspendLayout(); this.TAB_Main.SuspendLayout(); this.SuspendLayout(); @@ -81,7 +82,8 @@ private void InitializeComponent() this.TC_Misc.TabIndex = 0; // // TAB_Main - // + // + this.TAB_Main.Controls.Add(this.B_Fashion); this.TAB_Main.Controls.Add(this.B_Arceus); this.TAB_Main.Controls.Add(this.B_Zones); this.TAB_Main.Controls.Add(this.B_RebattleEyecatch); @@ -189,6 +191,16 @@ private void InitializeComponent() this.B_Spiritomb.UseVisualStyleBackColor = true; this.B_Spiritomb.Click += new System.EventHandler(this.B_Spiritomb_Click); // + // B_Fashion + // + this.B_Fashion.Location = new System.Drawing.Point(136, 262); + this.B_Fashion.Name = "B_Fashion"; + this.B_Fashion.Size = new System.Drawing.Size(124, 58); + this.B_Fashion.TabIndex = 9; + this.B_Fashion.Text = "Unlock All Fashion"; + this.B_Fashion.UseVisualStyleBackColor = true; + this.B_Fashion.Click += new System.EventHandler(this.B_Fashion_Click); + // // SAV_Misc8b // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -223,5 +235,6 @@ private void InitializeComponent() private System.Windows.Forms.Button B_RebattleEyecatch; private System.Windows.Forms.Button B_Zones; private System.Windows.Forms.Button B_Arceus; + private System.Windows.Forms.Button B_Fashion; } } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.cs index eaedde1d6..b994b6cb1 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Misc8b.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows.Forms; using PKHeX.Core; namespace PKHeX.WinForms; @@ -108,4 +108,10 @@ private void B_RebattleEyecatch_Click(object sender, EventArgs e) B_RebattleEyecatch.Enabled = false; B_DefeatEyecatch.Enabled = true; } + + private void B_Fashion_Click(object sender, EventArgs e) + { + Unlocker.UnlockFashion(); + System.Media.SystemSounds.Asterisk.Play(); + } }