From 16e51a81ffb83288476b76947f951a82a121a007 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 17 Nov 2018 19:57:53 -0800 Subject: [PATCH] Reset cp/size on species/form change --- PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs | 6 ++++++ PKHeX.WinForms/Controls/PKM Editor/SizeCP.cs | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index 8297eda95..621e3c4be 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -914,6 +914,8 @@ namespace PKHeX.WinForms.Controls Stats.UpdateStats(); SetAbilityList(); + if (pkm is PB7) + SizeCP.TryResetStats(); // Gender Forms if (WinFormsUtil.GetIndex(CB_Species) == 201 && FieldsLoaded) @@ -1111,6 +1113,10 @@ namespace PKHeX.WinForms.Controls if (!CHK_Nicknamed.Checked) UpdateNickname(sender, e); + // Refresh more derived stats + if (pkm is PB7) + SizeCP.TryResetStats(); + UpdateLegality(); } diff --git a/PKHeX.WinForms/Controls/PKM Editor/SizeCP.cs b/PKHeX.WinForms/Controls/PKM Editor/SizeCP.cs index 104c5fe6e..7ae2e99e0 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/SizeCP.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/SizeCP.cs @@ -15,10 +15,14 @@ namespace PKHeX.WinForms.Controls pkm = pk as PB7; if (pkm == null) return; + TryResetStats(); + LoadStoredValues(); + } + public void TryResetStats() + { if (CHK_Auto.Checked) pkm.ResetCalculatedValues(); - LoadStoredValues(); } private void LoadStoredValues()