Fix extrabytes

Visible returns false if the tab is not active -- even if it is defined
as true in an earlier line, so use Enabled instead.

Move the AbilityNumber visibility to the end so that the logic isn't
repeated.
This commit is contained in:
Kaphotics 2016-09-05 15:57:28 -07:00
parent ed76235e9a
commit 421dbf31f3

View file

@ -869,9 +869,6 @@ namespace PKHeX
Label_EncryptionConstant.Visible = BTN_RerollEC.Visible = TB_EC.Visible = SAV.Generation >= 6; Label_EncryptionConstant.Visible = BTN_RerollEC.Visible = TB_EC.Visible = SAV.Generation >= 6;
GB_nOT.Visible = GB_RelearnMoves.Visible = BTN_Medals.Visible = BTN_History.Visible = SAV.Generation >= 6; GB_nOT.Visible = GB_RelearnMoves.Visible = BTN_Medals.Visible = BTN_History.Visible = SAV.Generation >= 6;
PB_Legal.Visible = PB_WarnMove1.Visible = PB_WarnMove2.Visible = PB_WarnMove3.Visible = PB_WarnMove4.Visible = SAV.Generation >= 6; PB_Legal.Visible = PB_WarnMove1.Visible = PB_WarnMove2.Visible = PB_WarnMove3.Visible = PB_WarnMove4.Visible = SAV.Generation >= 6;
TB_AbilityNumber.Visible = SAV.Generation >= 6 && DEV_Ability.Enabled;
if (HaX && SAV.Generation >= 6)
TB_AbilityNumber.Visible = true;
PB_MarkPentagon.Visible = SAV.Generation == 6; PB_MarkPentagon.Visible = SAV.Generation == 6;
TB_GameSync.Visible = TB_Secure1.Visible = TB_Secure2.Visible = L_GameSync.Visible = L_Secure1.Visible = L_Secure2.Visible = SAV.Exportable && SAV.Generation == 6; TB_GameSync.Visible = TB_Secure1.Visible = TB_Secure2.Visible = L_GameSync.Visible = L_Secure1.Visible = L_Secure2.Visible = SAV.Exportable && SAV.Generation == 6;
@ -885,7 +882,7 @@ namespace PKHeX
FLP_Nature.Visible = SAV.Generation >= 3; FLP_Nature.Visible = SAV.Generation >= 3;
FLP_Ability.Visible = SAV.Generation >= 3; FLP_Ability.Visible = SAV.Generation >= 3;
FLP_Language.Visible = SAV.Generation >= 3; FLP_Language.Visible = SAV.Generation >= 3;
GB_ExtraBytes.Visible = SAV.Generation >= 3; GB_ExtraBytes.Enabled = SAV.Generation >= 3;
GB_Markings.Visible = SAV.Generation >= 3; GB_Markings.Visible = SAV.Generation >= 3;
BTN_Ribbons.Visible = SAV.Generation >= 3; BTN_Ribbons.Visible = SAV.Generation >= 3;
CB_HPType.Enabled = CB_Form.Enabled = SAV.Generation >= 3; CB_HPType.Enabled = CB_Form.Enabled = SAV.Generation >= 3;
@ -895,10 +892,11 @@ namespace PKHeX
FLP_FriendshipForm.Visible = SAV.Generation >= 2; FLP_FriendshipForm.Visible = SAV.Generation >= 2;
FLP_HeldItem.Visible = SAV.Generation >= 2; FLP_HeldItem.Visible = SAV.Generation >= 2;
CHK_IsEgg.Visible = Label_Gender.Visible = SAV.Generation >= 2; CHK_IsEgg.Visible = Label_Gender.Visible = SAV.Generation >= 2;
// HaX override, needs to be after DEV_Ability enabled assignment.
TB_AbilityNumber.Visible = SAV.Generation >= 6 && DEV_Ability.Enabled;
// Met Tab // Met Tab
FLP_MetDate.Visible = SAV.Generation >= 4; FLP_MetDate.Visible = SAV.Generation >= 4;
FLP_Fateful.Visible = FLP_Ball.Visible = FLP_OriginGame.Visible = SAV.Generation >= 3; FLP_Fateful.Visible = FLP_Ball.Visible = FLP_OriginGame.Visible = SAV.Generation >= 3;
@ -1014,7 +1012,7 @@ namespace PKHeX
TB_Level.Visible = !HaX; TB_Level.Visible = !HaX;
// Load Extra Byte List // Load Extra Byte List
if (GB_ExtraBytes.Visible) if (GB_ExtraBytes.Enabled)
{ {
CB_ExtraBytes.Items.Clear(); CB_ExtraBytes.Items.Clear();
foreach (byte b in extraBytes) foreach (byte b in extraBytes)