Tweak level/exp changing events

move from validated to textchanged as the user expects the values to
live update
only use the value-cap on validation if the input is not associated with
another control's value
this is now consistent with the IV/EV updating stats

#1163
This commit is contained in:
Kurt 2017-05-23 17:46:32 -07:00
parent 2e1c0b9c48
commit a98c904168
2 changed files with 9 additions and 4 deletions

View file

@ -680,7 +680,7 @@
this.TB_EXP.Size = new System.Drawing.Size(46, 20);
this.TB_EXP.TabIndex = 7;
this.TB_EXP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.TB_EXP.Validated += new System.EventHandler(this.updateEXPLevel);
this.TB_EXP.TextChanged += new System.EventHandler(this.updateEXPLevel);
//
// Label_CurLevel
//
@ -703,7 +703,7 @@
this.TB_Level.Size = new System.Drawing.Size(22, 20);
this.TB_Level.TabIndex = 8;
this.TB_Level.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.TB_Level.Validated += new System.EventHandler(this.updateEXPLevel);
this.TB_Level.TextChanged += new System.EventHandler(this.updateEXPLevel);
//
// MT_Level
//
@ -717,7 +717,7 @@
this.MT_Level.TabIndex = 17;
this.MT_Level.Visible = false;
this.MT_Level.Click += new System.EventHandler(this.clickLevel);
this.MT_Level.Validated += new System.EventHandler(this.updateEXPLevel);
this.MT_Level.TextChanged += new System.EventHandler(this.updateEXPLevel);
//
// FLP_Nature
//

View file

@ -883,7 +883,12 @@ namespace PKHeX.WinForms.Controls
{
// Change the XP
int Level = Util.ToInt32((HaX ? MT_Level : TB_Level).Text);
if (Level > 100) TB_Level.Text = "100";
if (Level > 100)
{
TB_Level.Text = "100";
if (!HaX)
Level = 100;
}
if (Level > byte.MaxValue) MT_Level.Text = "255";
if (Level <= 100)