2017-06-25 17:57:35 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.WinForms.Controls
|
|
|
|
|
{
|
2020-12-24 08:06:40 +00:00
|
|
|
|
public partial class ContestStat : UserControl, IContestStats, IContestStatsMutable
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
|
|
|
|
public ContestStat()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-01 21:39:08 +00:00
|
|
|
|
public byte CNT_Cool
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
2021-01-01 21:39:08 +00:00
|
|
|
|
get => (byte)Util.ToInt32(TB_Cool.Text);
|
2017-06-25 17:57:35 +00:00
|
|
|
|
set => TB_Cool.Text = value.ToString();
|
|
|
|
|
}
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2021-01-01 21:39:08 +00:00
|
|
|
|
public byte CNT_Beauty
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
2021-01-01 21:39:08 +00:00
|
|
|
|
get => (byte)Util.ToInt32(TB_Beauty.Text);
|
2017-06-25 17:57:35 +00:00
|
|
|
|
set => TB_Beauty.Text = value.ToString();
|
|
|
|
|
}
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2021-01-01 21:39:08 +00:00
|
|
|
|
public byte CNT_Cute
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
2021-01-01 21:39:08 +00:00
|
|
|
|
get => (byte)Util.ToInt32(TB_Cute.Text);
|
2017-06-25 17:57:35 +00:00
|
|
|
|
set => TB_Cute.Text = value.ToString();
|
|
|
|
|
}
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2021-01-01 21:39:08 +00:00
|
|
|
|
public byte CNT_Smart
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
2021-01-01 21:39:08 +00:00
|
|
|
|
get => (byte)Util.ToInt32(TB_Smart.Text);
|
2017-06-25 17:57:35 +00:00
|
|
|
|
set => TB_Smart.Text = value.ToString();
|
|
|
|
|
}
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2021-01-01 21:39:08 +00:00
|
|
|
|
public byte CNT_Tough
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
2021-01-01 21:39:08 +00:00
|
|
|
|
get => (byte)Util.ToInt32(TB_Tough.Text);
|
2017-06-25 17:57:35 +00:00
|
|
|
|
set => TB_Tough.Text = value.ToString();
|
|
|
|
|
}
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2021-01-01 21:39:08 +00:00
|
|
|
|
public byte CNT_Sheen
|
|
|
|
|
{
|
|
|
|
|
get => (byte)Util.ToInt32(TB_Sheen.Text);
|
|
|
|
|
set => TB_Sheen.Text = value.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-25 17:57:35 +00:00
|
|
|
|
private void Update255_MTB(object sender, EventArgs e)
|
|
|
|
|
{
|
2020-12-23 05:24:41 +00:00
|
|
|
|
if (sender is not MaskedTextBox tb) return;
|
2017-06-25 17:57:35 +00:00
|
|
|
|
if (Util.ToInt32(tb.Text) > byte.MaxValue)
|
|
|
|
|
tb.Text = "255";
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-03 05:04:32 +00:00
|
|
|
|
public void ToggleInterface(object o, int gen = PKX.Generation)
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
2020-12-29 08:58:08 +00:00
|
|
|
|
if (o is not IContestStats)
|
2017-06-25 17:57:35 +00:00
|
|
|
|
{
|
|
|
|
|
Visible = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Visible = true;
|
|
|
|
|
bool smart = gen < 6;
|
|
|
|
|
Label_Smart.Visible = smart; // show smart gen3-5
|
|
|
|
|
Label_Clever.Visible = !smart; // show clever gen6+
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|