No error messag when cursor on uncaught species, showing sprite again after toggling stats

This commit is contained in:
Wlowscha 2025-01-04 15:28:47 +01:00
parent fcc9ec57d3
commit b3bda1aaac
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 2 additions and 13 deletions

View File

@ -183,9 +183,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
private infoOverlay : PokedexInfoOverlay; private infoOverlay : PokedexInfoOverlay;
private statsMode: boolean; private statsMode: boolean;
private starterIconsCursorXOffset: number = -3;
private starterIconsCursorYOffset: number = 1;
private starterIconsCursorIndex: number;
private allSpecies: PokemonSpecies[] = []; private allSpecies: PokemonSpecies[] = [];
private lastSpecies: PokemonSpecies; private lastSpecies: PokemonSpecies;
@ -2374,7 +2371,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
} else { } else {
this.statsMode = false; this.statsMode = false;
this.statsContainer.setVisible(false); this.statsContainer.setVisible(false);
this.pokemonSprite.setVisible(!!this.speciesStarterDexEntry?.caughtAttr); this.pokemonSprite.setVisible(true);
//@ts-ignore //@ts-ignore
this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. !?!? this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. !?!?
} }

View File

@ -1776,7 +1776,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
} }
setSpeciesDetails(species: PokemonSpecies, options: SpeciesDetails = {}): void { setSpeciesDetails(species: PokemonSpecies, options: SpeciesDetails = {}): void {
let { shiny, formIndex, female, variant, abilityIndex, natureIndex } = options; let { shiny, formIndex, female, variant } = options;
const forSeen: boolean = options.forSeen ?? false; const forSeen: boolean = options.forSeen ?? false;
this.dexAttrCursor = 0n; this.dexAttrCursor = 0n;
this.abilityCursor = -1; this.abilityCursor = -1;
@ -1811,8 +1811,6 @@ export default class PokedexUiHandler extends MessageUiHandler {
if (!dexEntry.caughtAttr) { if (!dexEntry.caughtAttr) {
const props = this.getSanitizedProps(this.scene.gameData.getSpeciesDexAttrProps(species, this.getCurrentDexProps(species.speciesId))); const props = this.getSanitizedProps(this.scene.gameData.getSpeciesDexAttrProps(species, this.getCurrentDexProps(species.speciesId)));
const defaultAbilityIndex = this.scene.gameData.getStarterSpeciesDefaultAbilityIndex(species);
const defaultNature = this.scene.gameData.getSpeciesDefaultNature(species);
if (shiny === undefined || shiny !== props.shiny) { if (shiny === undefined || shiny !== props.shiny) {
shiny = props.shiny; shiny = props.shiny;
@ -1826,12 +1824,6 @@ export default class PokedexUiHandler extends MessageUiHandler {
if (variant === undefined || variant !== props.variant) { if (variant === undefined || variant !== props.variant) {
variant = props.variant; variant = props.variant;
} }
if (abilityIndex === undefined || abilityIndex !== defaultAbilityIndex) {
abilityIndex = defaultAbilityIndex;
}
if (natureIndex === undefined || natureIndex !== defaultNature) {
natureIndex = defaultNature;
}
} }
if (forSeen ? this.speciesStarterDexEntry?.seenAttr : this.speciesStarterDexEntry?.caughtAttr) { if (forSeen ? this.speciesStarterDexEntry?.seenAttr : this.speciesStarterDexEntry?.caughtAttr) {