From 02dc49641c6648d6bc20d24c3d3edc10db5c24bb Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 4 May 2018 17:59:04 -0700 Subject: [PATCH] Rearrange version changing logic set the new version, then update the controls #1923 ; exist logic overrode rby/gsc to gen7 locations, which didn't trigger the TID view update. --- PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index 47cd33980..72188b556 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -1021,8 +1021,14 @@ private void UpdateSpecies(object sender, EventArgs e) private void UpdateOriginGame(object sender, EventArgs e) { GameVersion Version = (GameVersion)WinFormsUtil.GetIndex(CB_GameOrigin); + // check if differs GameVersion newTrack = GameUtil.GetMetLocationVersionGroup(Version); + if (newTrack != origintrack && FieldsLoaded) + { + pkm.Version = (int)Version; + TID_Trainer.LoadIDValues(pkm); + } if (newTrack == GameVersion.GSC && pkm.Format >= 7) newTrack = GameVersion.USUM; else if (pkm.Format < 3) @@ -1036,7 +1042,6 @@ private void UpdateOriginGame(object sender, EventArgs e) if (FieldsLoaded) { SetMarkings(); // Set/Remove the Nativity marking when gamegroup changes too - pkm.Version = (int)Version; int metLoc = EncounterSuggestion.GetSuggestedTransferLocation(pkm); CB_MetLocation.SelectedValue = Math.Max(0, metLoc); } @@ -1057,12 +1062,6 @@ private void UpdateOriginGame(object sender, EventArgs e) if (!FieldsLoaded) CB_GameOrigin.Focus(); // hacky validation forcing - - if (FieldsLoaded) - { - pkm.Version = (int)Version; - TID_Trainer.LoadIDValues(pkm); - } } // Visibility logic for Gen 4 encounter type; only show for Gen 4 Pokemon.