From 1ba271db50b885e45d60005ce51f552ef606c280 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 26 Jan 2020 09:24:00 -0800 Subject: [PATCH] Fix block dump changing type on load Loading the window and assigning the datasource fired the index changed event, changing the first block (array) to the (selected index of type), which was bool1. Exporting the save caused a bad block type write, yielding a bad size. Only add the event after the constructor is finished, so that it only fires via user interaction. Similarly reported but not exactly noticed in #2658 Closes #2663 Gonna update the release with a hotfix --- .../Subforms/Save Editors/Gen8/SAV_BlockDump8.Designer.cs | 1 - PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.cs | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.Designer.cs index 6a8eefbc8..33cc6326a 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.Designer.cs @@ -265,7 +265,6 @@ private void InitializeComponent() this.CB_TypeToggle.Size = new System.Drawing.Size(97, 21); this.CB_TypeToggle.TabIndex = 12; this.CB_TypeToggle.Visible = false; - this.CB_TypeToggle.SelectedIndexChanged += new System.EventHandler(this.CB_TypeToggle_SelectedIndexChanged); // // Tab_Compare // diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.cs index b6c19c6d4..94bad832c 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_BlockDump8.cs @@ -37,6 +37,8 @@ public SAV_BlockDump8(SaveFile sav) }; CB_TypeToggle.InitializeBinding(); CB_TypeToggle.DataSource = boolToggle; + + CB_TypeToggle.SelectedIndexChanged += CB_TypeToggle_SelectedIndexChanged; } private void CB_Key_SelectedIndexChanged(object sender, EventArgs e)