mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-03-21 17:48:28 -05:00
Fix non-English set imports of remapped forms
No need to do the English-specific remapping if the language isn't English Closes #4613
This commit is contained in:
parent
98255526d6
commit
5bdfd4597c
|
|
@ -78,6 +78,8 @@ public static string GetStringFromForm(byte form, GameStrings strings, ushort sp
|
|||
var result = form >= forms.Length ? string.Empty : forms[form];
|
||||
|
||||
// Showdown uses a non-standard representation for some forms, and uses interstitial dashes instead of spaces.
|
||||
if (strings.Language != LanguageID.English)
|
||||
return result;
|
||||
return GetShowdownFormName(species, result);
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +318,7 @@ public static string GetShowdownText(PKM pk, in BattleTemplateExportSettings set
|
|||
{
|
||||
if (pk.Species == 0)
|
||||
return string.Empty;
|
||||
var set = new ShowdownSet(pk);
|
||||
var set = new ShowdownSet(pk, settings.Localization);
|
||||
set.InterpretAsPreview(pk);
|
||||
return set.GetText(settings);
|
||||
}
|
||||
|
|
@ -371,7 +373,7 @@ public static IEnumerable<ShowdownSet> GetShowdownSets(IEnumerable<PKM> data)
|
|||
/// <returns>Multi-line string</returns>
|
||||
public static string GetLocalizedPreviewText(PKM pk, in BattleTemplateExportSettings settings)
|
||||
{
|
||||
var set = new ShowdownSet(pk);
|
||||
var set = new ShowdownSet(pk, settings.Localization);
|
||||
set.InterpretAsPreview(pk);
|
||||
return set.GetText(settings);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ private void LoadLines(IEnumerable<string> lines, BattleTemplateLocalization loc
|
|||
private void SanitizeResult(BattleTemplateLocalization localization)
|
||||
{
|
||||
ReviseContextIfPastGenForm(localization.Strings);
|
||||
FormName = ShowdownParsing.GetFormNameFromShowdownFormName(Species, FormName, Ability);
|
||||
if (localization.Strings.Language == LanguageID.English)
|
||||
FormName = ShowdownParsing.GetFormNameFromShowdownFormName(Species, FormName, Ability);
|
||||
Form = ShowdownParsing.GetFormFromString(FormName, localization.Strings, Species, Context);
|
||||
|
||||
// Handle edge case with fixed-gender forms.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user