From 2730a36d00a0b7dd23d6a704a6c2214d9159e635 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:00:20 +0100 Subject: [PATCH] Hotfix to prevent "Normal" form to showing the text --- src/data/pokemon-species.ts | 31 +++++++++++++++++++++++++++++++ src/ui/pokedex-page-ui-handler.ts | 9 +++++++-- src/ui/pokedex-ui-handler.ts | 9 +++++++-- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 43b719878bb..f8ea8a026f8 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -32,6 +32,37 @@ export enum Region { PALDEA } +// TODO: this is horrible and will need to be removed once a refactor/cleanup of forms is executed. +export const normalForm: Species[] = [ + Species.PIKACHU, + Species.RAICHU, + Species.EEVEE, + Species.JOLTEON, + Species.FLAREON, + Species.VAPOREON, + Species.ESPEON, + Species.UMBREON, + Species.LEAFEON, + Species.GLACEON, + Species.SYLVEON, + Species.PICHU, + Species.ROTOM, + Species.DIALGA, + Species.PALKIA, + Species.KYUREM, + Species.GENESECT, + Species.FROAKIE, + Species.FROGADIER, + Species.GRENINJA, + Species.ROCKRUFF, + Species.NECROZMA, + Species.MAGEARNA, + Species.MARSHADOW, + Species.CRAMORANT, + Species.ZARUDE, + Species.CALYREX +]; + /** * Gets the {@linkcode PokemonSpecies} object associated with the {@linkcode Species} enum given * @param species The species to fetch diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 19507bbee67..53cec86c90b 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -16,7 +16,7 @@ import { pokemonFormChanges } from "#app/data/pokemon-forms"; import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves"; import type PokemonSpecies from "#app/data/pokemon-species"; -import { allSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-species"; +import { allSpecies, getPokemonSpeciesForm, normalForm } from "#app/data/pokemon-species"; import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters"; import { starterPassiveAbilities } from "#app/data/balance/passives"; import { Type } from "#enums/type"; @@ -2279,7 +2279,12 @@ export default class PokedexPageUiHandler extends MessageUiHandler { if (isFormCaught || isFormSeen) { const speciesForm = getPokemonSpeciesForm(species.speciesId, formIndex!); // TODO: is the bang correct? this.setTypeIcons(speciesForm.type1, speciesForm.type2); - this.pokemonFormText.setText(species.getFormNameToDisplay(formIndex)); + // TODO: change this once forms are refactored + if (normalForm.includes(species.speciesId) && !formIndex) { + this.pokemonFormText.setText(""); + } else { + this.pokemonFormText.setText(species.getFormNameToDisplay(formIndex)); + } this.pokemonFormText.setVisible(true); if (!isFormCaught) { this.pokemonFormText.setY(18); diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 662a54c00c0..65fdf48c5aa 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -7,7 +7,7 @@ import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves"; import type { PokemonForm } from "#app/data/pokemon-species"; import type PokemonSpecies from "#app/data/pokemon-species"; -import { allSpecies, getPokemonSpeciesForm, getPokerusStarters } from "#app/data/pokemon-species"; +import { allSpecies, getPokemonSpeciesForm, getPokerusStarters, normalForm } from "#app/data/pokemon-species"; import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters"; import { catchableSpecies } from "#app/data/balance/biomes"; import { Type } from "#enums/type"; @@ -1950,7 +1950,12 @@ export default class PokedexUiHandler extends MessageUiHandler { } if (isFormCaught || isFormSeen || globalScene.dexForDevs) { - this.pokemonFormText.setText(species.getFormNameToDisplay(formIndex, false)); + // TODO: change this once forms are refactored + if (normalForm.includes(species.speciesId) && !formIndex) { + this.pokemonFormText.setText(""); + } else { + this.pokemonFormText.setText(species.getFormNameToDisplay(formIndex, false)); + } } else { this.pokemonFormText.setText(""); }