Fix save edited = true on load

Move some logic around; populating the GameSync/Secure Value fields was
triggering 'edited=true'.
Closes #422
This commit is contained in:
Kurt
2016-11-16 07:46:54 -08:00
parent b9ede740a0
commit bea263a8d2

View File

@@ -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)
{