View current box instead of Box 1 on load (closes #294)

This commit is contained in:
Michael Scire
2016-10-02 16:48:12 -07:00
parent 4ce29b392d
commit 0266fd1eb7

View File

@@ -3536,7 +3536,6 @@ private void setBoxNames()
{
if (!SAV.HasBox)
return;
int selectedbox = CB_BoxSelect.SelectedIndex; // precache selected box
// Build ComboBox Dropdown Items
try
{
@@ -3550,8 +3549,8 @@ private void setBoxNames()
for (int i = 1; i <= SAV.BoxCount; i++)
CB_BoxSelect.Items.Add($"BOX {i}");
}
if (selectedbox < CB_BoxSelect.Items.Count)
CB_BoxSelect.SelectedIndex = selectedbox; // restore selected box
if (SAV.CurrentBox < CB_BoxSelect.Items.Count)
CB_BoxSelect.SelectedIndex = SAV.CurrentBox; // restore selected box
}
private void getQuickFiller(PictureBox pb, PKM pk = null)
{
@@ -3601,7 +3600,11 @@ private void getSlotColor(int slot, Image color)
}
private void getBox(object sender, EventArgs e)
{
SAV.CurrentBox = CB_BoxSelect.SelectedIndex;
if (SAV.CurrentBox != CB_BoxSelect.SelectedIndex)
{
SAV.CurrentBox = CB_BoxSelect.SelectedIndex;
SAV.Edited = true; // Dumb
}
setPKXBoxes();
}
private void switchDaycare(object sender, EventArgs e)