diff --git a/PKHeX.Core/Editing/ShowdownSet.cs b/PKHeX.Core/Editing/ShowdownSet.cs index ce2cef85e..ec214ee9d 100644 --- a/PKHeX.Core/Editing/ShowdownSet.cs +++ b/PKHeX.Core/Editing/ShowdownSet.cs @@ -19,9 +19,7 @@ public sealed class ShowdownSet : IGigantamax private static readonly char[] ParenJunk = { '[', ']', '(', ')' }; private static readonly ushort[] DashedSpecies = {782, 783, 784, 250, 032, 029}; // Kommo-o, Ho-Oh, Nidoran-M, Nidoran-F private const int MAX_SPECIES = (int)Core.Species.MAX_COUNT - 1; - private const string Language = GameLanguage.DefaultLanguage; - private const int DefaultLanguageID = (int)Core.LanguageID.English; - private static readonly GameStrings DefaultStrings = GameInfo.GetStrings(Language); + private static readonly GameStrings DefaultStrings = GameInfo.GetStrings(GameLanguage.DefaultLanguage); /// /// of the Set entity. @@ -114,7 +112,6 @@ public sealed class ShowdownSet : IGigantamax public readonly List InvalidLines = new List(); private GameStrings Strings { get; set; } = DefaultStrings; - private int LanguageID { get; set; } = DefaultLanguageID; private int[] IVsSpeedFirst => new[] {IVs[0], IVs[1], IVs[2], IVs[5], IVs[3], IVs[4]}; private int[] IVsSpeedLast => new[] {IVs[0], IVs[1], IVs[2], IVs[4], IVs[5], IVs[3]}; @@ -266,8 +263,6 @@ private bool ParseEntry(string identifier, string value) private string LocalizedText(int lang) { var strings = GameInfo.GetStrings(lang); - lang += lang >= 5 ? 2 : 1; // shift from array index to LanguageID - LanguageID = lang; return GetText(strings); } @@ -365,14 +360,10 @@ private IEnumerable GetStringMoves() { foreach (int move in Moves.Where(move => move != 0 && move < Strings.Move.Count)) { - var str = $"- {Strings.Move[move]}"; if (move == 237) // Hidden Power - { - var hpVal = HiddenPower.GetType(IVs, Format); - str += $" [{Strings.Types[1+ hpVal]}]"; - HiddenPowerType = hpVal; - } - yield return str; + yield return $"- {Strings.Move[move]} [{Strings.Types[1 + HiddenPowerType]}]"; + + yield return $"- {Strings.Move[move]}"; } } @@ -416,6 +407,16 @@ public ShowdownSet(PKM pkm) if (pkm is IGigantamax g) CanGigantamax = g.CanGigantamax; + HiddenPowerType = HiddenPower.GetType(IVs, Format); + if (pkm is IHyperTrain h) + { + for (int i = 0; i < 6; i++) + { + if (h.GetHT(i)) + IVs[i] = pkm.MaxIV; + } + } + SetFormString(pkm.AltForm); }