mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-04 20:47:24 -05:00
* Update to .NET 10 * Property fields * API signature updates * Extension method blocks * Completed dark mode support Outside of my control: - vertical tab control (pkm editor) - datetimepicker controls - lgpe event flags (no idea) - some control types having white-borders when they should really be gray Box background is 50% transparency to effectively darken the image. * Custom legality report popup * Event diff dialog, version select dialog * Add quick overwrite popup for export sav * Extension methods * Dark Mode: glow currently editing sprite * Add invalid encounter hint for trade evolutions * Extension properties * Append legality hint on hover card * Slot image loading: clear the screen-reader description if a slot is empty/invalid, rather than retain the previous description. Changing boxes would easily confuse users on this.
31 lines
852 B
C#
31 lines
852 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).CatchRate;
|
|
|
|
private void ChangeValue(object sender, EventArgs e)
|
|
{
|
|
Entity?.CatchRate = (byte)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;
|
|
if (!WinFormsUtil.TryFindFirstControlOfType<IMainEditor>(this, out var main))
|
|
return;
|
|
var sav = main.RequestSaveFile;
|
|
NUD_CatchRate.Value = CatchRateApplicator.GetSuggestedCatchRate(Entity, sav);
|
|
}
|
|
}
|