Fix updateLegality on sav load

Legality indication disappeared when save was loading, just defer all
checks to the updateLegality method
This commit is contained in:
Kaphotics 2016-08-18 18:10:22 -07:00
parent 53a6aacd7d
commit 0dcd5b22e8

View file

@ -821,7 +821,6 @@ namespace PKHeX
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;
PB_MarkPentagon.Visible = SAV.Generation == 6; PB_MarkPentagon.Visible = SAV.Generation == 6;
PB_Legal.Visible = PB_WarnMove1.Visible = PB_WarnMove2.Visible = PB_WarnMove3.Visible = PB_WarnMove4.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;
CB_Form.Visible = Label_Form.Visible = CHK_AsEgg.Visible = GB_EggConditions.Visible = CB_Form.Visible = Label_Form.Visible = CHK_AsEgg.Visible = GB_EggConditions.Visible =
@ -876,7 +875,6 @@ namespace PKHeX
// Common HaX Interface // Common HaX Interface
CHK_HackedStats.Enabled = CHK_HackedStats.Visible = MT_Level.Enabled = MT_Level.Visible = MT_Form.Enabled = MT_Form.Visible = HaX; CHK_HackedStats.Enabled = CHK_HackedStats.Visible = MT_Level.Enabled = MT_Level.Visible = MT_Form.Enabled = MT_Form.Visible = HaX;
PB_Legal.Visible = PB_WarnMove1.Visible = PB_WarnMove2.Visible = PB_WarnMove3.Visible = PB_WarnMove4.Visible &= !HaX;
TB_Level.Visible = !HaX; TB_Level.Visible = !HaX;
// Load Extra Byte List // Load Extra Byte List
@ -2272,13 +2270,13 @@ namespace PKHeX
return; return;
Legality = la ?? new LegalityAnalysis((PK6) pkm); Legality = la ?? new LegalityAnalysis((PK6) pkm);
PB_Legal.Image = Legality.Valid ? Properties.Resources.valid : Properties.Resources.warn; PB_Legal.Image = Legality.Valid ? Properties.Resources.valid : Properties.Resources.warn;
PB_Legal.Visible = pkm.Gen6 /*&& pkm is PK6*/; PB_Legal.Visible = pkm.Gen6 /*&& pkm is PK6*/ && !HaX;
// Refresh Move Legality // Refresh Move Legality
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
movePB[i].Visible = !Legality.vMoves[i].Valid; movePB[i].Visible = !Legality.vMoves[i].Valid && !HaX;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
relearnPB[i].Visible = !Legality.vRelearn[i].Valid; relearnPB[i].Visible = !Legality.vRelearn[i].Valid && !HaX;
} }
private void updateStats() private void updateStats()
{ {