Remove formKey parameter

This commit is contained in:
AJ Fontaine 2025-02-10 16:03:05 -05:00
parent 471886954e
commit 764ca95f3f
2 changed files with 6 additions and 6 deletions

View File

@ -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}`;

View File

@ -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;
}