Move sizecp update to Stat Update method

Closes #2182
This commit is contained in:
Kurt 2018-11-26 15:37:44 -08:00
parent 5ca597d44b
commit 105c466ab3

View file

@ -53,7 +53,13 @@ namespace PKHeX.WinForms.Controls
TID_Trainer.UpdatedID += Update_ID; TID_Trainer.UpdatedID += Update_ID;
} }
private void UpdateStats() => Stats.UpdateStats(); private void UpdateStats()
{
Stats.UpdateStats();
if (pkm is PB7)
SizeCP.TryResetStats();
}
private void LoadPartyStats(PKM pk) => Stats.LoadPartyStats(pk); private void LoadPartyStats(PKM pk) => Stats.LoadPartyStats(pk);
private void SavePartyStats(PKM pk) private void SavePartyStats(PKM pk)
@ -862,7 +868,7 @@ namespace PKHeX.WinForms.Controls
pkm.EXP = Util.ToUInt32(TB_EXP.Text); pkm.EXP = Util.ToUInt32(TB_EXP.Text);
pkm.Stat_Level = Util.ToInt32((HaX ? MT_Level : TB_Level).Text); pkm.Stat_Level = Util.ToInt32((HaX ? MT_Level : TB_Level).Text);
} }
Stats.UpdateStats(); UpdateStats();
UpdateLegality(); UpdateLegality();
} }
@ -912,10 +918,8 @@ namespace PKHeX.WinForms.Controls
if (CB_Form == sender && FieldsLoaded) if (CB_Form == sender && FieldsLoaded)
pkm.AltForm = CB_Form.SelectedIndex; pkm.AltForm = CB_Form.SelectedIndex;
Stats.UpdateStats(); UpdateStats();
SetAbilityList(); SetAbilityList();
if (pkm is PB7)
SizeCP.TryResetStats();
// Gender Forms // Gender Forms
if (WinFormsUtil.GetIndex(CB_Species) == 201 && FieldsLoaded) if (WinFormsUtil.GetIndex(CB_Species) == 201 && FieldsLoaded)
@ -1113,10 +1117,6 @@ namespace PKHeX.WinForms.Controls
if (!CHK_Nicknamed.Checked) if (!CHK_Nicknamed.Checked)
UpdateNickname(sender, e); UpdateNickname(sender, e);
// Refresh more derived stats
if (pkm is PB7)
SizeCP.TryResetStats();
UpdateLegality(); UpdateLegality();
} }