Fix pokedex entry after catching

This commit is contained in:
Wlowscha 2025-03-29 00:16:59 +01:00
parent eb12b8c692
commit 08006138e3
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 19 additions and 10 deletions

View File

@ -332,8 +332,8 @@ export class AttemptCapturePhase extends PokemonPhase {
globalScene.ui.setOverlayMode( globalScene.ui.setOverlayMode(
Mode.POKEDEX_PAGE, Mode.POKEDEX_PAGE,
pokemon.species, pokemon.species,
pokemon.formIndex,
attributes, attributes,
[pokemon.species.speciesId],
null, null,
() => { () => {
globalScene.ui.setMode(Mode.MESSAGE).then(() => { globalScene.ui.setMode(Mode.MESSAGE).then(() => {

View File

@ -1111,15 +1111,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
}); });
this.blockInput = false; this.blockInput = false;
} else { } else {
ui.revertMode() ui.revertMode().then(() => {
.then(() => { console.log("exitCallback", this.exitCallback);
console.log("exitCallback", this.exitCallback); if (this.exitCallback instanceof Function) {
if (this.exitCallback instanceof Function) { const exitCallback = this.exitCallback;
const exitCallback = this.exitCallback; this.exitCallback = null;
this.exitCallback = null; exitCallback();
exitCallback(); }
} });
});
success = true; success = true;
} }
} else { } else {
@ -1988,6 +1987,11 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
} }
break; break;
case Button.LEFT: case Button.LEFT:
if (this.filteredIndices && this.filteredIndices.length <= 1) {
ui.playError();
this.blockInput = false;
return true;
}
this.blockInput = true; this.blockInput = true;
ui.setModeWithoutClear(Mode.OPTION_SELECT).then(() => { ui.setModeWithoutClear(Mode.OPTION_SELECT).then(() => {
// Always go back to first selection after scrolling around // Always go back to first selection after scrolling around
@ -2023,6 +2027,11 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
this.blockInput = false; this.blockInput = false;
break; break;
case Button.RIGHT: case Button.RIGHT:
if (this.filteredIndices && this.filteredIndices.length <= 1) {
ui.playError();
this.blockInput = false;
return true;
}
ui.setModeWithoutClear(Mode.OPTION_SELECT).then(() => { ui.setModeWithoutClear(Mode.OPTION_SELECT).then(() => {
// Always go back to first selection after scrolling around // Always go back to first selection after scrolling around
if (this.previousSpecies.length === 0) { if (this.previousSpecies.length === 0) {