mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-14 16:27:21 +00:00
Fix hacked stats clearing on save
UpdateStats would ovewrite stats when saving a pkm; only overwrite stat values if hacked stats is not checked or no stats have been loaded yet.
This commit is contained in:
parent
b13a7c9624
commit
3a3ffe0d00
1 changed files with 15 additions and 14 deletions
|
@ -467,14 +467,16 @@ namespace PKHeX.WinForms.Controls
|
|||
private void UpdateStats()
|
||||
{
|
||||
// Generate the stats.
|
||||
pkm.SetStats(pkm.GetStats(pkm.PersonalInfo));
|
||||
|
||||
Stat_HP.Text = pkm.Stat_HPCurrent.ToString();
|
||||
Stat_ATK.Text = pkm.Stat_ATK.ToString();
|
||||
Stat_DEF.Text = pkm.Stat_DEF.ToString();
|
||||
Stat_SPA.Text = pkm.Stat_SPA.ToString();
|
||||
Stat_SPD.Text = pkm.Stat_SPD.ToString();
|
||||
Stat_SPE.Text = pkm.Stat_SPE.ToString();
|
||||
if (!CHK_HackedStats.Checked || pkm.Stat_HPCurrent == 0) // no stats when initially loaded from non-partyformat slot
|
||||
{
|
||||
pkm.SetStats(pkm.GetStats(pkm.PersonalInfo));
|
||||
Stat_HP.Text = pkm.Stat_HPCurrent.ToString();
|
||||
Stat_ATK.Text = pkm.Stat_ATK.ToString();
|
||||
Stat_DEF.Text = pkm.Stat_DEF.ToString();
|
||||
Stat_SPA.Text = pkm.Stat_SPA.ToString();
|
||||
Stat_SPD.Text = pkm.Stat_SPD.ToString();
|
||||
Stat_SPE.Text = pkm.Stat_SPE.ToString();
|
||||
}
|
||||
|
||||
// Recolor the Stat Labels based on boosted stats.
|
||||
{
|
||||
|
@ -1078,12 +1080,11 @@ namespace PKHeX.WinForms.Controls
|
|||
}
|
||||
private void UpdateHackedStats(object sender, EventArgs e)
|
||||
{
|
||||
Stat_HP.Enabled =
|
||||
Stat_ATK.Enabled =
|
||||
Stat_DEF.Enabled =
|
||||
Stat_SPA.Enabled =
|
||||
Stat_SPD.Enabled =
|
||||
Stat_SPE.Enabled = CHK_HackedStats.Checked;
|
||||
var stats = new[] {Stat_HP, Stat_ATK, Stat_DEF, Stat_SPA, Stat_SPD, Stat_SPE};
|
||||
foreach (var s in stats)
|
||||
s.Enabled = CHK_HackedStats.Enabled;
|
||||
if (!CHK_HackedStats.Checked)
|
||||
UpdateStats();
|
||||
}
|
||||
private void UpdateHackedStatText(object sender, EventArgs e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue