PKHeX/PKHeX.WinForms/Controls/PKM Editor/CatchRate.cs
2020-07-18 20:07:55 -05:00

22 lines
773 B
C#

using System;
using System.Windows.Forms;
using PKHeX.Core;
namespace PKHeX.WinForms.Controls
{
public partial class CatchRate : UserControl
{
private PK1 pk1;
public CatchRate() => InitializeComponent();
public void LoadPK1(PK1 pk) => NUD_CatchRate.Value = (pk1 = pk).Catch_Rate;
private void ChangeValue(object sender, EventArgs e) => pk1.Catch_Rate = (int)NUD_CatchRate.Value;
private void Clear(object sender, EventArgs e) => NUD_CatchRate.Value = 0;
private void Reset(object sender, EventArgs e)
{
var sav = WinFormsUtil.FindFirstControlOfType<IMainEditor>(this).RequestSaveFile;
NUD_CatchRate.Value = CatchRateApplicator.GetSuggestedCatchRate(pk1, sav);
}
}
}