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.
This commit is contained in:
Kurt 2018-05-04 17:59:04 -07:00
parent 676b5905bf
commit 02dc49641c

View File

@ -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.