Fix entree species change

thanks KR for finding
This commit is contained in:
Kurt 2018-09-09 15:36:58 -07:00
parent f444c41ee3
commit e03e6cb2ff

View File

@ -578,6 +578,7 @@ private void SaveForest()
}
private IList<EntreeSlot> 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);
}