From 4d5480e64c83856fdff0ea8f303958d970ae9b5a Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 14 Dec 2025 20:06:07 -0600 Subject: [PATCH] Update DonutEditor9a.cs --- .../Subforms/Save Editors/Gen9/DonutEditor9a.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs index d9d6b2e7a..08c297da2 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs @@ -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 flavors, ReadOnlySpan items, ReadOnlySpan donutNames) @@ -55,6 +53,7 @@ public void InitializeLists(ReadOnlySpan flavors, ReadOnlySpan 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()