From 413cfddb6ca2e24e9e9fcce18a530867f39995a9 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 4 Oct 2017 17:21:51 -0700 Subject: [PATCH] Misc tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix ranch pkm hacks being treated as valid (wrong severity) fix xml docs relative to recent changes move kata/hiragana charmapping to be like the Farfetch'd alias {"'", 0xE0}, // Alias ' to ’ for Farfetch'd {"’", 0xE0}, --- PKHeX.Core/Legality/Checks.cs | 4 ++-- PKHeX.Core/PKM/StringConverter.cs | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/PKHeX.Core/Legality/Checks.cs b/PKHeX.Core/Legality/Checks.cs index ed5fda2ed..d99504820 100644 --- a/PKHeX.Core/Legality/Checks.cs +++ b/PKHeX.Core/Legality/Checks.cs @@ -348,9 +348,9 @@ private void VerifyNicknameTrade() return; } if (pkm.IsNicknamed) - AddLine(Severity.Valid, V9, CheckIdentifier.Nickname); + AddLine(Severity.Invalid, V9, CheckIdentifier.Nickname); else if (OTs[lang] != pkm.OT_Name) - AddLine(Severity.Valid, V10, CheckIdentifier.Trainer); + AddLine(Severity.Invalid, V10, CheckIdentifier.Trainer); else AddLine(Severity.Valid, V11, CheckIdentifier.Nickname); return; diff --git a/PKHeX.Core/PKM/StringConverter.cs b/PKHeX.Core/PKM/StringConverter.cs index 31ccc4f96..4dcf5c0cc 100644 --- a/PKHeX.Core/PKM/StringConverter.cs +++ b/PKHeX.Core/PKM/StringConverter.cs @@ -139,9 +139,6 @@ public static byte[] SetString1(string value, int maxLength, bool jp, int padTo if (value.Length > maxLength) value = value.Substring(0, maxLength); // Hard cap - if (jp) - value = value.Replace("\u30d8", "\u3078"); // Katakana ヘ => Hiragana へ - Dictionary dict = jp ? U2RBY_J : U2RBY_U; if (dict.ContainsKey(value)) // Handle "[TRAINER]" return new[] { dict[value], dict["\0"] }; @@ -454,6 +451,7 @@ public static string GetString7(byte[] data, int offset, int count) /// Language specific conversion (Chinese) /// Pad to given length /// Pad with value + /// Chinese string remapping should be attempted /// Encoded data. public static byte[] SetString7(string value, int maxLength, int language, int padTo = 0, ushort padWith = 0, bool chinese = false) { @@ -487,7 +485,7 @@ public static string GetG1Char(byte key, bool jp) /// Converts a Unicode string to Generation 7 in-game chinese string. /// /// Unicode string. - /// Pkm language is Traditional Chinese. + /// Detection of language for Traditional Chinese check /// In-game chinese string. private static string ConvertString2BinG7_zh(string inputstr, int lang) { @@ -1084,6 +1082,7 @@ private static byte SetG3Char(ushort chr, bool jp) {"ひ", 0xCB}, {"ふ", 0xCC}, {"へ", 0xCD}, + {"ヘ", 0xCD}, // Katakana ヘ => Hiragana へ {"ほ", 0xCE}, {"ま", 0xCF}, {"み", 0xD0},