From 08adb4c2cb9164cf837eb0106956b1001cbf0a2f Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 26 Jan 2017 08:45:23 -0800 Subject: [PATCH] Disable super training flags on format!=6 Closes #752 --- .../SuperTrainingEditor.Designer.cs | 1 - .../PKM Editors/SuperTrainingEditor.cs | 24 +++++++++++++------ PKHeX/Legality/Checks.cs | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.Designer.cs b/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.Designer.cs index 978070632..699a94d99 100644 --- a/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.Designer.cs +++ b/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.Designer.cs @@ -155,7 +155,6 @@ // CHK_SecretComplete // this.CHK_SecretComplete.AutoSize = true; - this.CHK_SecretComplete.Enabled = false; this.CHK_SecretComplete.Location = new System.Drawing.Point(3, 17); this.CHK_SecretComplete.Name = "CHK_SecretComplete"; this.CHK_SecretComplete.Size = new System.Drawing.Size(145, 17); diff --git a/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.cs b/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.cs index 1b8681f6d..9e2bf6bc3 100644 --- a/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.cs +++ b/PKHeX.WinForms/Subforms/PKM Editors/SuperTrainingEditor.cs @@ -27,8 +27,6 @@ namespace PKHeX.WinForms CHK_SecretUnlocked.Checked = pkm.SecretSuperTrainingUnlocked; CHK_SecretComplete.Checked = pkm.SecretSuperTrainingComplete; - if (!CHK_SecretUnlocked.Checked) // force update to disable checkboxes - CHK_Secret_CheckedChanged(null, null); if (pkm is PK6) { @@ -40,10 +38,14 @@ namespace PKHeX.WinForms PK6 pk6 = (PK6) pkm; CB_Bag.SelectedIndex = pk6.TrainingBag; NUD_BagHits.Value = pk6.TrainingBagHits; + + if (!CHK_SecretUnlocked.Checked) // force update to disable checkboxes + CHK_Secret_CheckedChanged(null, null); } else { L_Bag.Visible = CB_Bag.Visible = L_Hits.Visible = NUD_BagHits.Visible = false; + CHK_SecretUnlocked.Visible = CHK_SecretComplete.Visible = false; } } @@ -139,16 +141,22 @@ namespace PKHeX.WinForms if (CHK_SecretUnlocked.Checked) // only give dist if Secret is Unlocked (None -> All -> All*) foreach (var c in TLP_DistSuperTrain.Controls.OfType()) c.Checked = true; - - CHK_SecretUnlocked.Checked = true; - CHK_SecretComplete.Checked = true; + + if (pkm is PK6) + { + CHK_SecretUnlocked.Checked = true; + CHK_SecretComplete.Checked = true; + } foreach (var c in TLP_SuperTrain.Controls.OfType()) c.Checked = true; } private void B_None_Click(object sender, EventArgs e) { - CHK_SecretUnlocked.Checked = false; - CHK_SecretComplete.Checked = false; + if (pkm is PK6) + { + CHK_SecretUnlocked.Checked = false; + CHK_SecretComplete.Checked = false; + } foreach (var c in TLP_SuperTrain.Controls.OfType()) c.Checked = false; foreach (var c in TLP_DistSuperTrain.Controls.OfType()) @@ -156,6 +164,8 @@ namespace PKHeX.WinForms } private void CHK_Secret_CheckedChanged(object sender, EventArgs e) { + if (!(pkm is PK6)) + return; CHK_SecretComplete.Checked &= CHK_SecretUnlocked.Checked; CHK_SecretComplete.Enabled = CHK_SecretUnlocked.Checked; foreach (var c in TLP_SuperTrain.Controls.OfType().Where(chk => Convert.ToInt16(chk.Name[14]+"") >= 4)) diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs index 4e7c3edc3..ce3ab71ea 100644 --- a/PKHeX/Legality/Checks.cs +++ b/PKHeX/Legality/Checks.cs @@ -517,7 +517,7 @@ namespace PKHeX.Core if (pkm.IsEgg && TrainCount > 0) { AddLine(Severity.Invalid, "Super Training missions on Egg.", CheckIdentifier.Training); } else if (TrainCount > 0 && pkm.GenNumber != 6) - { AddLine(Severity.Invalid, "Distribution Super Training missions are not available in game.", CheckIdentifier.Training); } + { AddLine(Severity.Invalid, "Super Training missions are not available in game.", CheckIdentifier.Training); } else { if (pkm.Format >= 7)