mirror of
https://github.com/kwsch/PKHeX
synced 2025-01-05 09:08:45 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
32 lines
890 B
C#
32 lines
890 B
C#
using System;
|
|
using System.Windows.Forms;
|
|
using PKHeX.Core;
|
|
|
|
namespace PKHeX.WinForms.Controls;
|
|
|
|
public partial class CatchRate : UserControl
|
|
{
|
|
private PK1? Entity;
|
|
public CatchRate() => InitializeComponent();
|
|
|
|
public void LoadPK1(PK1 pk) => NUD_CatchRate.Value = (Entity = pk).Catch_Rate;
|
|
|
|
private void ChangeValue(object sender, EventArgs e)
|
|
{
|
|
if (Entity is null)
|
|
return;
|
|
Entity.Catch_Rate = (int)NUD_CatchRate.Value;
|
|
}
|
|
|
|
private void Clear(object sender, EventArgs e) => NUD_CatchRate.Value = 0;
|
|
|
|
private void Reset(object sender, EventArgs e)
|
|
{
|
|
if (Entity is null)
|
|
return;
|
|
var sav = WinFormsUtil.FindFirstControlOfType<IMainEditor>(this)?.RequestSaveFile;
|
|
if (sav == null)
|
|
return;
|
|
NUD_CatchRate.Value = CatchRateApplicator.GetSuggestedCatchRate(Entity, sav);
|
|
}
|
|
}
|