Skip to content

Commit

Permalink
Hotfix to prevent "Normal" form to showing the text
Browse files Browse the repository at this point in the history
  • Loading branch information
Wlowscha committed Feb 12, 2025
1 parent 568212a commit 2730a36
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
31 changes: 31 additions & 0 deletions src/data/pokemon-species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions src/ui/pokedex-page-ui-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 7 additions & 2 deletions src/ui/pokedex-ui-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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("");
}
Expand Down

0 comments on commit 2730a36

Please sign in to comment.