mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-26 02:02:20 +02:00
Remove formKey parameter
This commit is contained in:
parent
471886954e
commit
764ca95f3f
@ -715,8 +715,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
|
|||||||
* @param species the species to check
|
* @param species the species to check
|
||||||
* @returns the pokemon-form locale key for the single form name ("Alolan Form", "Eternal Flower" etc)
|
* @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 {
|
getFormNameToDisplay(formIndex: number = 0, append: boolean = false): string {
|
||||||
const formKey = key ?? (this.forms?.[formIndex!]?.formKey);
|
const formKey = this.forms?.[formIndex!]?.formKey;
|
||||||
const formText = Utils.capitalizeString(formKey, "-", false, false) || "";
|
const formText = Utils.capitalizeString(formKey, "-", false, false) || "";
|
||||||
const speciesName = Utils.capitalizeString(Species[this.speciesId], "_", true, false);
|
const speciesName = Utils.capitalizeString(Species[this.speciesId], "_", true, false);
|
||||||
let ret: string = "";
|
let ret: string = "";
|
||||||
@ -724,7 +724,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
|
|||||||
const region = this.getRegion();
|
const region = this.getRegion();
|
||||||
if (this.speciesId === Species.ARCEUS) {
|
if (this.speciesId === Species.ARCEUS) {
|
||||||
ret = i18next.t(`pokemonInfo:Type.${formText?.toUpperCase()}`);
|
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: "" });
|
return i18next.t(`battlePokemonForm:${formKey}`, { pokemonName: "" });
|
||||||
} else if (region === Region.NORMAL || (this.speciesId === Species.GALAR_DARMANITAN && formIndex > 0) || this.speciesId === Species.PALDEA_TAUROS) {
|
} else if (region === Region.NORMAL || (this.speciesId === Species.GALAR_DARMANITAN && formIndex > 0) || this.speciesId === Species.PALDEA_TAUROS) {
|
||||||
const i18key = `pokemonForm:${speciesName}${formText}`;
|
const i18key = `pokemonForm:${speciesName}${formText}`;
|
||||||
|
@ -1334,7 +1334,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
options.push({
|
options.push({
|
||||||
label: pre.preFormKey ?
|
label: pre.preFormKey ?
|
||||||
(preSpecies ?? this.species).getFormNameToDisplay(preFormIndex, pre.preFormKey, true) :
|
(preSpecies ?? this.species).getFormNameToDisplay(preFormIndex, true) :
|
||||||
(preSpecies ?? this.species).getExpandedSpeciesName(),
|
(preSpecies ?? this.species).getExpandedSpeciesName(),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
const newSpecies = allSpecies.find(species => species.speciesId === pokemonPrevolutions[pre.speciesId]);
|
const newSpecies = allSpecies.find(species => species.speciesId === pokemonPrevolutions[pre.speciesId]);
|
||||||
@ -1375,7 +1375,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
options.push({
|
options.push({
|
||||||
label: evo.evoFormKey ?
|
label: evo.evoFormKey ?
|
||||||
(evoSpecies ?? this.species).getFormNameToDisplay(newFormIndex, evo.evoFormKey, true) :
|
(evoSpecies ?? this.species).getFormNameToDisplay(newFormIndex, true) :
|
||||||
(evoSpecies ?? this.species).getExpandedSpeciesName(),
|
(evoSpecies ?? this.species).getExpandedSpeciesName(),
|
||||||
style: isCaughtEvo && isFormCaughtEvo ? TextStyle.WINDOW : TextStyle.SHADOW_TEXT,
|
style: isCaughtEvo && isFormCaughtEvo ? TextStyle.WINDOW : TextStyle.SHADOW_TEXT,
|
||||||
handler: () => {
|
handler: () => {
|
||||||
@ -1408,7 +1408,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
} else {
|
} else {
|
||||||
conditionText = "";
|
conditionText = "";
|
||||||
}
|
}
|
||||||
let label: string = this.species.getFormNameToDisplay(newFormIndex, bf.formKey);
|
let label: string = this.species.getFormNameToDisplay(newFormIndex);
|
||||||
if (label === "") {
|
if (label === "") {
|
||||||
label = this.species.name;
|
label = this.species.name;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user