mirror of
https://github.com/kwsch/pkNX.git
synced 2026-10-02 14:16:55 -05:00
Fix species/form overwrite on load
https://projectpokemon.org/home/forums/topic/48647-pknx-nintendo-switch-rom-editor-randomizer/?do=findComment&comment=240379
This commit is contained in:
@@ -175,8 +175,10 @@ private void RefreshFormAbility(object sender, EventArgs e)
|
||||
{
|
||||
if (entry < 0)
|
||||
return;
|
||||
pkm.Form = CB_Forme.SelectedIndex;
|
||||
RefreshPKMSlotAbility();
|
||||
if (loadingPKM)
|
||||
return;
|
||||
pkm.Form = CB_Forme.SelectedIndex;
|
||||
|
||||
if (!Stats.UpdatingFields)
|
||||
Stats.UpdateStats();
|
||||
@@ -186,8 +188,10 @@ private void RefreshSpeciesAbility(object sender, EventArgs e)
|
||||
{
|
||||
if (entry < 0)
|
||||
return;
|
||||
pkm.Species = (ushort)CB_Species.SelectedIndex;
|
||||
FormUtil.SetForms(CB_Species.SelectedIndex, CB_Forme, AltForms);
|
||||
if (loadingPKM)
|
||||
return;
|
||||
pkm.Species = (ushort)CB_Species.SelectedIndex;
|
||||
RefreshPKMSlotAbility();
|
||||
|
||||
if (!Stats.UpdatingFields)
|
||||
@@ -305,11 +309,13 @@ private void UpdateTrainerName(object sender, EventArgs e)
|
||||
|
||||
private TrainerPoke pkm;
|
||||
|
||||
private bool loadingPKM;
|
||||
|
||||
private void PopulateFields(TrainerPoke pk)
|
||||
{
|
||||
pkm = pk.Clone();
|
||||
|
||||
Stats.UpdatingFields = true;
|
||||
Stats.UpdatingFields = loadingPKM = true;
|
||||
|
||||
CB_Species.SelectedIndex = pkm.Species;
|
||||
CB_Forme.SelectedIndex = pkm.Form;
|
||||
@@ -339,6 +345,7 @@ private void PopulateFields(TrainerPoke pk)
|
||||
}
|
||||
|
||||
Stats.LoadStats(pk);
|
||||
loadingPKM = false;
|
||||
}
|
||||
|
||||
private TrainerPoke PreparePKM()
|
||||
|
||||
Reference in New Issue
Block a user