Merge pull request #417 from kwsch/b/gen4-box-layout

Fixed crash when opening SAV_BoxLayout with Gen 4 save
This commit is contained in:
Kaphotics 2016-11-16 21:21:47 -08:00 committed by GitHub
commit f78bbb48a0

View file

@ -15,11 +15,21 @@ namespace PKHeX
// Repopulate Wallpaper names
CB_BG.Items.Clear();
if (SAV.Generation == 6)
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames);
else if (SAV.Generation == 7)
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames.Take(16).ToArray());
switch (SAV.Generation)
{
case 4:
case 5:
case 6:
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames);
break;
case 7:
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames.Take(16).ToArray());
break;
default:
Util.Error("Box layout is not supported for this game.");
return;
}
// Go
LB_BoxSelect.Items.Clear();
for (int i = 0; i < SAV.BoxCount; i++)