mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-28 13:38:19 -05:00
Update DonutEditor9a.cs
This commit is contained in:
@@ -11,12 +11,10 @@ public sealed partial class DonutEditor9a : UserControl
|
||||
{
|
||||
private Donut9a _donut;
|
||||
public event EventHandler? ValueChanged;
|
||||
private readonly bool Initialized;
|
||||
|
||||
public DonutEditor9a()
|
||||
{
|
||||
InitializeComponent();
|
||||
Initialized = true;
|
||||
}
|
||||
|
||||
public void InitializeLists(ReadOnlySpan<string> flavors, ReadOnlySpan<string> items, ReadOnlySpan<string> donutNames)
|
||||
@@ -55,6 +53,7 @@ public void InitializeLists(ReadOnlySpan<string> flavors, ReadOnlySpan<string> i
|
||||
SetDataSource(CB_Donut, donutList);
|
||||
|
||||
CB_Donut.SelectedIndexChanged += OnValueChanged;
|
||||
CB_Donut.SelectedIndexChanged += CB_Donut_SelectedIndexChanged;
|
||||
|
||||
// Not really necessary to indicate value changes (name wouldn't be different), but for consistency...
|
||||
CAL_Date.ValueChanged += OnValueChanged;
|
||||
@@ -158,7 +157,6 @@ public void LoadDonut(Donut9a donut)
|
||||
}
|
||||
|
||||
TB_Unknown.Text = donut.Unknown.ToString();
|
||||
PB_Donut.Image = DonutSpriteUtil.Sprite(donut);
|
||||
|
||||
return;
|
||||
|
||||
@@ -236,14 +234,10 @@ private static ulong GetDonutFlavorHash(ComboBox cb)
|
||||
return hash;
|
||||
}
|
||||
|
||||
// todo please fix this Kurt <3
|
||||
private void CB_Donut_SelectedIndexChanged(object sender, EventArgs e)
|
||||
private void CB_Donut_SelectedIndexChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (!Initialized)
|
||||
return;
|
||||
|
||||
_donut.Donut = (ushort)CB_Donut.SelectedIndex;
|
||||
PB_Donut.Image = DonutSpriteUtil.Sprite(_donut);
|
||||
PB_Donut.Image = _donut.Sprite();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
||||
Reference in New Issue
Block a user