From 764ca95f3fcafc1bbfae394a88345a72b62c8e96 Mon Sep 17 00:00:00 2001 From: AJ Fontaine Date: Mon, 10 Feb 2025 16:03:05 -0500 Subject: [PATCH] Remove formKey parameter --- src/data/pokemon-species.ts | 6 +++--- src/ui/pokedex-page-ui-handler.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 77acff3cc15..395aef39a42 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -715,8 +715,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali * @param species the species to check * @returns the pokemon-form locale key for the single form name ("Alolan Form", "Eternal Flower" etc) */ - getFormNameToDisplay(formIndex: number = 0, key?: string, append: boolean = false): string { - const formKey = key ?? (this.forms?.[formIndex!]?.formKey); + getFormNameToDisplay(formIndex: number = 0, append: boolean = false): string { + const formKey = this.forms?.[formIndex!]?.formKey; const formText = Utils.capitalizeString(formKey, "-", false, false) || ""; const speciesName = Utils.capitalizeString(Species[this.speciesId], "_", true, false); let ret: string = ""; @@ -724,7 +724,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali const region = this.getRegion(); if (this.speciesId === Species.ARCEUS) { ret = i18next.t(`pokemonInfo:Type.${formText?.toUpperCase()}`); - } else if ([ SpeciesFormKey.MEGA_X, SpeciesFormKey.MEGA_Y, SpeciesFormKey.GIGANTAMAX_RAPID, SpeciesFormKey.GIGANTAMAX_SINGLE ].includes(formKey)) { + } else if ([ SpeciesFormKey.MEGA_X, SpeciesFormKey.MEGA_Y, SpeciesFormKey.GIGANTAMAX_RAPID, SpeciesFormKey.GIGANTAMAX_SINGLE ].includes(formKey as SpeciesFormKey)) { return i18next.t(`battlePokemonForm:${formKey}`, { pokemonName: "" }); } else if (region === Region.NORMAL || (this.speciesId === Species.GALAR_DARMANITAN && formIndex > 0) || this.speciesId === Species.PALDEA_TAUROS) { const i18key = `pokemonForm:${speciesName}${formText}`; diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 8d6fab534af..be7d19aff27 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -1334,7 +1334,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { options.push({ label: pre.preFormKey ? - (preSpecies ?? this.species).getFormNameToDisplay(preFormIndex, pre.preFormKey, true) : + (preSpecies ?? this.species).getFormNameToDisplay(preFormIndex, true) : (preSpecies ?? this.species).getExpandedSpeciesName(), handler: () => { const newSpecies = allSpecies.find(species => species.speciesId === pokemonPrevolutions[pre.speciesId]); @@ -1375,7 +1375,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { options.push({ label: evo.evoFormKey ? - (evoSpecies ?? this.species).getFormNameToDisplay(newFormIndex, evo.evoFormKey, true) : + (evoSpecies ?? this.species).getFormNameToDisplay(newFormIndex, true) : (evoSpecies ?? this.species).getExpandedSpeciesName(), style: isCaughtEvo && isFormCaughtEvo ? TextStyle.WINDOW : TextStyle.SHADOW_TEXT, handler: () => { @@ -1408,7 +1408,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } else { conditionText = ""; } - let label: string = this.species.getFormNameToDisplay(newFormIndex, bf.formKey); + let label: string = this.species.getFormNameToDisplay(newFormIndex); if (label === "") { label = this.species.name; }