The UI was checking wrong if a pokemon is shadow or purified

The internal data of GC games for purification for shadow pokemon does not have values from 0-non shadow to 100-total shadow, it have values sarting from the initial shadow hearth gauge to 0-non shadow.
This commit is contained in:
javierhimura 2017-04-02 17:10:40 +02:00
parent b53a101f20
commit 699dadcccb
4 changed files with 7 additions and 19 deletions

View file

@ -1597,16 +1597,8 @@
// //
this.NUD_Purification.Location = new System.Drawing.Point(110, 1); this.NUD_Purification.Location = new System.Drawing.Point(110, 1);
this.NUD_Purification.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0); this.NUD_Purification.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
this.NUD_Purification.Maximum = new decimal(new int[] { this.NUD_Purification.Maximum = new decimal(int.MaxValue);
0, this.NUD_Purification.Minimum = new decimal(0);
0,
0,
0});
this.NUD_Purification.Minimum = new decimal(new int[] {
100,
0,
0,
-2147483648});
this.NUD_Purification.Name = "NUD_Purification"; this.NUD_Purification.Name = "NUD_Purification";
this.NUD_Purification.Size = new System.Drawing.Size(51, 20); this.NUD_Purification.Size = new System.Drawing.Size(51, 20);
this.NUD_Purification.TabIndex = 103; this.NUD_Purification.TabIndex = 103;

View file

@ -2975,7 +2975,7 @@ namespace PKHeX.WinForms
if (!fieldsLoaded) if (!fieldsLoaded)
return; return;
fieldsLoaded = false; fieldsLoaded = false;
CHK_Shadow.Checked = NUD_Purification.Value == 0; CHK_Shadow.Checked = NUD_Purification.Value > 0;
fieldsLoaded = true; fieldsLoaded = true;
} }
private void updateShadowCHK(object sender, EventArgs e) private void updateShadowCHK(object sender, EventArgs e)

View file

@ -102,13 +102,11 @@ namespace PKHeX.WinForms
if (ck3.ShadowID > 0) if (ck3.ShadowID > 0)
{ {
int puri = ck3.Purification; int puri = ck3.Purification;
if (puri > NUD_Purification.Maximum) if (puri < NUD_Purification.Minimum)
puri = 0;
else if (puri < NUD_Purification.Minimum)
puri = (int)NUD_Purification.Minimum; puri = (int)NUD_Purification.Minimum;
NUD_Purification.Value = puri; NUD_Purification.Value = puri;
CHK_Shadow.Checked = puri < 0; CHK_Shadow.Checked = puri > 0;
NUD_ShadowID.Value = Math.Max(ck3.ShadowID, 0); NUD_ShadowID.Value = Math.Max(ck3.ShadowID, 0);
} }

View file

@ -102,13 +102,11 @@ namespace PKHeX.WinForms
if (xk3.ShadowID > 0) if (xk3.ShadowID > 0)
{ {
int puri = xk3.Purification; int puri = xk3.Purification;
if (puri > NUD_Purification.Maximum) if (puri < NUD_Purification.Minimum)
puri = 0;
else if (puri < NUD_Purification.Minimum)
puri = (int)NUD_Purification.Minimum; puri = (int)NUD_Purification.Minimum;
NUD_Purification.Value = puri; NUD_Purification.Value = puri;
CHK_Shadow.Checked = puri < 0; CHK_Shadow.Checked = puri > 0;
NUD_ShadowID.Value = Math.Max(xk3.ShadowID, 0); NUD_ShadowID.Value = Math.Max(xk3.ShadowID, 0);
} }