From bea263a8d2d337954b0049a334b89dc0e709a77a Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 16 Nov 2016 07:46:54 -0800 Subject: [PATCH] Fix save edited = true on load Move some logic around; populating the GameSync/Secure Value fields was triggering 'edited=true'. Closes #422 --- PKHeX/MainWindow/Main.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PKHeX/MainWindow/Main.cs b/PKHeX/MainWindow/Main.cs index 16b96d5f2..4b91e5b63 100644 --- a/PKHeX/MainWindow/Main.cs +++ b/PKHeX/MainWindow/Main.cs @@ -1088,6 +1088,9 @@ private void openSAV(SaveFile sav, string path) // Recenter PKM SubEditors FLP_PKMEditors.Location = new Point((Tab_OTMisc.Width - FLP_PKMEditors.Width) / 2, FLP_PKMEditors.Location.Y); + bool init = fieldsInitialized; + fieldsInitialized = fieldsLoaded = false; + switch (SAV.Generation) { case 1: @@ -1156,8 +1159,6 @@ private void openSAV(SaveFile sav, string path) TB_Secure2.Text = SAV.Secure2?.ToString("X16"); break; } - bool init = fieldsInitialized; - fieldsInitialized = fieldsLoaded = false; pkm = pkm.GetType() != SAV.PKMType ? SAV.BlankPKM : pk; if (pkm.Format < 3) pkm = SAV.BlankPKM; @@ -3362,6 +3363,9 @@ private void updateEggRNGSeed(object sender, EventArgs e) } private void updateU64(object sender, EventArgs e) { + if (!fieldsLoaded) + return; + TextBox tb = sender as TextBox; if (tb?.Text.Length == 0) {