misc loading fix

gen1/2 games with new pkm editor no longer cause an exception on init
load
This commit is contained in:
Kurt 2017-05-23 08:28:53 -07:00
parent 11b2dc35d7
commit 2e1c0b9c48

View File

@ -166,13 +166,11 @@ public void setPKMFormatMode(int Format)
// Load Extra Byte List
GB_ExtraBytes.Visible = GB_ExtraBytes.Enabled = extraBytes.Length != 0;
CB_ExtraBytes.Items.Clear();
foreach (byte b in extraBytes)
CB_ExtraBytes.Items.Add($"0x{b:X2}");
if (GB_ExtraBytes.Enabled)
{
CB_ExtraBytes.Items.Clear();
foreach (byte b in extraBytes)
CB_ExtraBytes.Items.Add($"0x{b:X2}");
CB_ExtraBytes.SelectedIndex = 0;
}
}
public void populateFields(PKM pk, bool focus = true)
{
@ -1835,7 +1833,8 @@ public void TemplateFields(PKM template)
{
if (template != null)
{ populateFields(template); return; }
CB_GameOrigin.SelectedIndex = 0;
if (CB_GameOrigin.Items.Count > 0)
CB_GameOrigin.SelectedIndex = 0;
CB_Move1.SelectedValue = 1;
TB_OT.Text = "PKHeX";
TB_TID.Text = 12345.ToString();