Fix Stat Tooltips (#3057)

Was only updating based on Stat Nature?
This commit is contained in:
ReignOfComputer 2020-10-28 00:18:12 +08:00 committed by GitHub
parent e22be71a26
commit 3767a61171
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -277,7 +277,7 @@ namespace PKHeX.WinForms.Controls
Stats.UpdateIVs(this, EventArgs.Empty);
UpdatePKRSInfected(this, EventArgs.Empty);
UpdatePKRSCured(this, EventArgs.Empty);
UpdateNatureModification(CB_StatNature);
UpdateNatureModification(CB_StatNature, 1);
if (HaX) // Load original values from pk not pkm
{
@ -1245,9 +1245,10 @@ namespace PKHeX.WinForms.Controls
TB_ExtraByte.Text = Entity.Data[Convert.ToInt32(CB_ExtraBytes.Text, 16)].ToString();
}
private void UpdateNatureModification(ComboBox cb)
private void UpdateNatureModification(ComboBox cb, int type)
{
string text = Stats.UpdateNatureModification(Entity.StatNature);
// 0 = Nature, 1 = Stat Nature
string text = Stats.UpdateNatureModification((type == 0) ? Entity.Nature : Entity.StatNature);
NatureTip.SetToolTip(cb, text);
}
@ -1602,14 +1603,14 @@ namespace PKHeX.WinForms.Controls
if (Entity.Format <= 4)
UpdateRandomPID(sender, e);
Entity.Nature = WinFormsUtil.GetIndex(CB_Nature);
UpdateNatureModification(CB_Nature);
UpdateNatureModification(CB_Nature, 0);
Stats.UpdateIVs(sender, EventArgs.Empty); // updating Nature will trigger stats to update as well
UpdateLegality();
}
else if (sender == CB_StatNature)
{
Entity.StatNature = WinFormsUtil.GetIndex(CB_StatNature);
UpdateNatureModification(CB_StatNature);
UpdateNatureModification(CB_StatNature, 1);
Stats.UpdateIVs(sender, EventArgs.Empty); // updating Nature will trigger stats to update as well
UpdateLegality();
}