From e03e6cb2ff7cc4e45c780a818be550b88aa466d4 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 9 Sep 2018 15:36:58 -0700 Subject: [PATCH] Fix entree species change thanks KR for finding --- PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs index 0b1b53e1c..b812270b1 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs @@ -578,6 +578,7 @@ private void SaveForest() } private IList CurrentSlots; + private int currentIndex = -1; private void ChangeArea(object sender, EventArgs e) { @@ -586,13 +587,15 @@ private void ChangeArea(object sender, EventArgs e) LB_Slots.Items.Clear(); foreach (var z in CurrentSlots.Select(z => GameInfo.Strings.Species[z.Species])) LB_Slots.Items.Add(z); - LB_Slots.SelectedIndex = 0; + LB_Slots.SelectedIndex = currentIndex = 0; } private void ChangeSlot(object sender, EventArgs e) { CurrentSlot = null; - var current = CurrentSlots[LB_Slots.SelectedIndex]; + if (LB_Slots.SelectedIndex >= 0) + currentIndex = LB_Slots.SelectedIndex; + var current = CurrentSlots[currentIndex]; CB_Species.SelectedValue = current.Species; SetForms(current); SetGenders(current); @@ -613,7 +616,7 @@ private void UpdateSlotValue(object sender, EventArgs e) if (sender == CB_Species) { CurrentSlot.Species = WinFormsUtil.GetIndex(CB_Species); - LB_Slots.Items[LB_Slots.SelectedIndex] = GameInfo.Strings.Species[CurrentSlot.Species]; + LB_Slots.Items[currentIndex] = GameInfo.Strings.Species[CurrentSlot.Species]; SetForms(CurrentSlot); SetGenders(CurrentSlot); }