From 805cedcea3f6c52bb0a69863b6897a9333349885 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 25 Mar 2017 16:38:40 -0700 Subject: [PATCH] Add CheckIdentifier tostring method Closes #984 --- PKHeX/Legality/Analysis.cs | 4 ++-- PKHeX/Legality/Checks.cs | 17 +++++++++++++++++ PKHeX/Legality/LegalityCheckStrings.cs | 11 +++++++++++ .../text/en/LegalityCheckStrings_en.txt | 5 +++++ .../text/zh/LegalityCheckStrings_zh.txt | 5 +++++ 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/PKHeX/Legality/Analysis.cs b/PKHeX/Legality/Analysis.cs index 30a508cdc..a17d56403 100644 --- a/PKHeX/Legality/Analysis.cs +++ b/PKHeX/Legality/Analysis.cs @@ -257,7 +257,7 @@ private string getLegalityReport() // Build result string... var outputLines = Parse.Where(chk => !chk.Valid); // Only invalid - r += string.Join(Environment.NewLine, outputLines.Select(chk => string.Format(V196, chk.Judgement, chk.Comment))); + r += string.Join(Environment.NewLine, outputLines.Select(chk => string.Format(V196, getString(chk.Judgement), chk.Comment))); if (r.Length == 0) r = V190; @@ -285,7 +285,7 @@ private string getVerboseLegalityReport() r += Environment.NewLine; var outputLines = Parse.Where(chk => chk != null && chk.Valid && chk.Comment != V).OrderBy(chk => chk.Judgement); // Fishy sorted to top - r += string.Join(Environment.NewLine, outputLines.Select(chk => string.Format(V196, chk.Judgement, chk.Comment))); + r += string.Join(Environment.NewLine, outputLines.Select(chk => string.Format(V196, getString(chk.Judgement), chk.Comment))); r += Environment.NewLine; r += "===" + Environment.NewLine + Environment.NewLine; diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs index d73dbebaf..960bdc928 100644 --- a/PKHeX/Legality/Checks.cs +++ b/PKHeX/Legality/Checks.cs @@ -2585,5 +2585,22 @@ private CheckResult verifyEggMoves() "Premier", "Event", "Birthday", "Special", "Souvenir", "Wishing", "Battle Champ", "Regional Champ", "National Champ", "World Champ" }; + + /// + /// Converts a Check result Severity determination (Valid/Invalid/etc) to the localized string. + /// + /// value to convert to string. + /// Localized . + private static string getString(Severity s) + { + switch (s) + { + case Severity.Indeterminate: return V500; + case Severity.Invalid: return V501; + case Severity.Fishy: return V502; + case Severity.Valid: return V503; + default: return V504; + } + } } } diff --git a/PKHeX/Legality/LegalityCheckStrings.cs b/PKHeX/Legality/LegalityCheckStrings.cs index 432d9ca0c..ba283e673 100644 --- a/PKHeX/Legality/LegalityCheckStrings.cs +++ b/PKHeX/Legality/LegalityCheckStrings.cs @@ -25,6 +25,17 @@ public static class LegalityCheckStrings /// Format text for exporting the type of Encounter that was matched for the the public static string V195 {get; set;} = "Encounter Type: {0}"; + /// Severity string for + public static string V500 { get; set; } = "Indeterminate"; + /// Severity string for + public static string V501 { get; set; } = "Invalid"; + /// Severity string for + public static string V502 { get; set; } = "Fishy"; + /// Severity string for + public static string V503 { get; set; } = "Valid"; + /// Severity string for + public static string V504 { get; set; } = "Not Implemented"; + /// Original Trainer string used in various string formats such as Memories. public static string V205 { get; set; } = "OT"; /// Handling Trainer string used in various string formats such as Memories. diff --git a/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt b/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt index 7636968c4..0672342f1 100644 --- a/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt +++ b/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt @@ -6,6 +6,11 @@ V196 = {0}: {1} V191 = {0} Move {1}: {2} V192 = {0} Relearn Move {1}: {2} V195 = Encounter Type: {0} +V500 = Indeterminate +V501 = Invalid +V502 = Fishy +V503 = Valid +V504 = Not Implemented V205 = OT V206 = HT V167 = Empty Move. diff --git a/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt b/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt index 933f572c5..f6ba36ad2 100644 --- a/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt +++ b/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt @@ -6,6 +6,11 @@ V196 = {0}: {1} V191 = {0} 招式 {1}: {2} V192 = {0} 回忆招式 {1}: {2} V195 = 相遇方式: {0} +V500 = 不定 +V501 = 无效 +V502 = 腥 +V503 = 有效 +V504 = 未实现 V205 = 初训家 V206 = 持有人 V167 = 空招式。