mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 06:42:20 +02:00
Add gender splash message code
This makes the specific April Fools splash message functional. Also fixed a linter issue with the randomPokemon code.
This commit is contained in:
parent
9ea469b3a6
commit
19af635b6e
@ -10,6 +10,7 @@ import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { Species } from "#enums/species";
|
import type { Species } from "#enums/species";
|
||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
|
import { PlayerGender } from "#enums/player-gender";
|
||||||
|
|
||||||
export default class TitleUiHandler extends OptionSelectUiHandler {
|
export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||||
/** If the stats can not be retrieved, use this fallback value */
|
/** If the stats can not be retrieved, use this fallback value */
|
||||||
@ -104,11 +105,25 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
randomPokemon(): void {
|
randomPokemon(): void {
|
||||||
const rand = Utils.randInt(1025, 1);
|
const rand = Utils.randInt(1025, 1);
|
||||||
const pokemon = getPokemonSpecies(rand as Species);
|
const pokemon = getPokemonSpecies(rand as Species);
|
||||||
if (this.splashMessage === "splashMessages:underratedPokemon" || "splashMessages:dontTalkAboutThePokemonIncident" || "splashMessages:aWildPokemonAppeared" || "splashMessages:aprilFools.removedPokemon") {
|
if (
|
||||||
|
this.splashMessage === "splashMessages:underratedPokemon" ||
|
||||||
|
this.splashMessage === "splashMessages:dontTalkAboutThePokemonIncident" ||
|
||||||
|
this.splashMessage === "splashMessages:aWildPokemonAppeared" ||
|
||||||
|
this.splashMessage === "splashMessages:aprilFools.removedPokemon"
|
||||||
|
) {
|
||||||
this.splashMessageText.setText(i18next.t(this.splashMessage, { pokemonName: pokemon.name }));
|
this.splashMessageText.setText(i18next.t(this.splashMessage, { pokemonName: pokemon.name }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Used for a specific April Fools splash message. */
|
||||||
|
genderSplash(): void {
|
||||||
|
if (this.splashMessage === "splashMessages:aprilFools.helloKyleAmber") {
|
||||||
|
globalScene.gameData.gender === PlayerGender.MALE
|
||||||
|
? this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:player_m") }))
|
||||||
|
: this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:player_f") }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
show(args: any[]): boolean {
|
show(args: any[]): boolean {
|
||||||
const ret = super.show(args);
|
const ret = super.show(args);
|
||||||
|
|
||||||
@ -133,6 +148,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.randomPokemon();
|
this.randomPokemon();
|
||||||
|
this.genderSplash();
|
||||||
|
|
||||||
this.updateTitleStats();
|
this.updateTitleStats();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user