Reset cp/size on species/form change

This commit is contained in:
Kurt 2018-11-17 19:57:53 -08:00
parent c268d5ad05
commit 16e51a81ff
2 changed files with 11 additions and 1 deletions

View file

@ -914,6 +914,8 @@ namespace PKHeX.WinForms.Controls
Stats.UpdateStats(); Stats.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)
@ -1111,6 +1113,10 @@ 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();
} }

View file

@ -15,10 +15,14 @@ namespace PKHeX.WinForms.Controls
pkm = pk as PB7; pkm = pk as PB7;
if (pkm == null) if (pkm == null)
return; return;
TryResetStats();
LoadStoredValues();
}
public void TryResetStats()
{
if (CHK_Auto.Checked) if (CHK_Auto.Checked)
pkm.ResetCalculatedValues(); pkm.ResetCalculatedValues();
LoadStoredValues();
} }
private void LoadStoredValues() private void LoadStoredValues()