From 09811c32e44bde5e8225c22f17fdaadf23f6e2e7 Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 3 Apr 2016 17:11:58 -0700 Subject: [PATCH] Add verbose export Partial commit error fixed --- Legality/Analysis.cs | 12 +++++++++++- Legality/Data.cs | 1 + PKX/f1-Main.cs | 13 ++++++------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Legality/Analysis.cs b/Legality/Analysis.cs index 93074fe11..c348051c6 100644 --- a/Legality/Analysis.cs +++ b/Legality/Analysis.cs @@ -17,6 +17,7 @@ public partial class LegalityAnalysis public LegalityCheck[] vMoves = new LegalityCheck[4]; public LegalityCheck[] vRelearn = new LegalityCheck[4]; public string Report => getLegalityReport(); + public string VerboseReport => getVerboseLegalityReport(); public LegalityAnalysis(PK6 pk) { @@ -78,7 +79,16 @@ private string getLegalityReport() // Build result string... r += chks.Where(chk => !chk.Valid).Aggregate("", (current, chk) => current + $"{chk.Judgement}: {chk.Comment}{Environment.NewLine}"); - return r; + return r.TrimEnd(); + } + private string getVerboseLegalityReport() + { + string r = getLegalityReport() + Environment.NewLine; + r += "===" + Environment.NewLine + Environment.NewLine; + + var chks = new[] { ECPID, Nickname, IVs, EVs, IDs, Encounter, Level, Ribbons, Ability, Ball, HandlerMemories }; + r += chks.Where(chk => chk.Valid && chk.Comment != "Valid").Aggregate("", (current, chk) => current + $"{chk.Judgement}: {chk.Comment}{Environment.NewLine}"); + return r.TrimEnd(); } public int[] getSuggestedRelearn() diff --git a/Legality/Data.cs b/Legality/Data.cs index 68b3e7fc3..174706250 100644 --- a/Legality/Data.cs +++ b/Legality/Data.cs @@ -204,6 +204,7 @@ public class EncounterLink public int[] RelearnMoves = new int[4]; public bool XY = true; public bool ORAS = true; + public bool? Shiny = false; } public enum Nature { diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index 6bd09e14e..af09de345 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -142,7 +142,8 @@ public Main() public static Color defaultControlText; public static string eggname = ""; public const string DatabasePath = "db"; - public const string WC6DatabasePath = "wc6"; + private const string WC6DatabasePath = "wc6"; + private const string BackupPath = "bak"; public static string[] gendersymbols = { "♂", "♀", "-" }; public static string[] specieslist, movelist, itemlist, abilitylist, types, natures, forms, memories, genloc, trainingbags, trainingstage, characteristics, @@ -164,7 +165,6 @@ public Main() private static bool HaX; private LegalityAnalysis Legality = new LegalityAnalysis(new PK6()); private static readonly Image mixedHighlight = Util.ChangeOpacity(Properties.Resources.slotSet, 0.5); - private static readonly string BackupPath = "bak"; private static readonly string[] lang_val = { "en", "ja", "fr", "it", "de", "es", "ko", "zh", "pt" }; private static readonly string[] main_langlist = { @@ -1048,7 +1048,6 @@ public void populateFields(PK6 pk, bool focus = true) // Reset a little. bool oldInit = fieldsInitialized; fieldsInitialized = fieldsLoaded = false; - CAL_EggDate.Value = new DateTime(2000, 01, 01); if (focus) Tab_Main.Focus(); @@ -1119,7 +1118,7 @@ public void populateFields(PK6 pk, bool focus = true) try { CAL_EggDate.Value = new DateTime(pk6.Egg_Year + 2000, pk6.Egg_Month, pk6.Egg_Day); } catch { CAL_MetDate.Value = new DateTime(2000, 1, 1); } } - else { CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; } + else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; } CB_MetLocation.SelectedValue = pk6.Met_Location; @@ -2163,12 +2162,12 @@ private void removedropCB(object sender, KeyEventArgs e) { ((ComboBox)sender).DroppedDown = false; } - private void showLegality(PK6 pk, bool tabs) + private void showLegality(PK6 pk, bool tabs, bool verbose) { LegalityAnalysis la = new LegalityAnalysis(pk); if (tabs) updateLegality(la); - Util.Alert(la.Report); // temp + Util.Alert(verbose ? la.VerboseReport : la.Report); } private void updateLegality(LegalityAnalysis la = null) { @@ -2776,7 +2775,7 @@ private void clickLegality(object sender, EventArgs e) if (pk.Species == 0 || !pk.ChecksumValid) { SystemSounds.Asterisk.Play(); return; } - showLegality(pk, slot < 0); + showLegality(pk, slot < 0, ModifierKeys == Keys.Control); } private void updateEggRNGSeed(object sender, EventArgs e) {