mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-27 12:02:47 +02:00
[Bug] Fix pokedex option after catching (#5574)
* Fix pokedex entry after catching * Allow turning pages * Using isSeen in more places * Evolutions show up as seen after catching * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Showing battle forms correctly for seen mons --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
b33d95d27d
commit
05691970e2
@ -329,18 +329,11 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
form: pokemon.formIndex,
|
form: pokemon.formIndex,
|
||||||
female: pokemon.gender === Gender.FEMALE,
|
female: pokemon.gender === Gender.FEMALE,
|
||||||
};
|
};
|
||||||
globalScene.ui.setOverlayMode(
|
globalScene.ui.setOverlayMode(Mode.POKEDEX_PAGE, pokemon.species, attributes, null, null, () => {
|
||||||
Mode.POKEDEX_PAGE,
|
|
||||||
pokemon.species,
|
|
||||||
pokemon.formIndex,
|
|
||||||
attributes,
|
|
||||||
null,
|
|
||||||
() => {
|
|
||||||
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||||
promptRelease();
|
promptRelease();
|
||||||
});
|
});
|
||||||
},
|
});
|
||||||
);
|
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
|
@ -978,7 +978,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
const caughtAttr = this.isCaught();
|
const caughtAttr = this.isCaught();
|
||||||
|
|
||||||
// no preferences or Pokemon wasn't caught, return empty attribute
|
// no preferences or Pokemon wasn't caught, return empty attribute
|
||||||
if (!starterAttributes || !caughtAttr) {
|
if (!starterAttributes || !this.isSeen()) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2026,6 +2026,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
|
||||||
@ -2061,6 +2066,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) {
|
||||||
@ -2220,9 +2230,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
|
|
||||||
const isFormCaught = this.isFormCaught();
|
if ((this.isCaught() && this.isFormCaught()) || this.isSeen()) {
|
||||||
|
|
||||||
if ((this.isCaught() && isFormCaught) || (this.speciesStarterDexEntry?.seenAttr && cursor === 5)) {
|
|
||||||
ui.showText(this.menuDescriptions[cursor]);
|
ui.showText(this.menuDescriptions[cursor]);
|
||||||
} else {
|
} else {
|
||||||
ui.showText("");
|
ui.showText("");
|
||||||
@ -2301,7 +2309,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (species && (this.speciesStarterDexEntry?.seenAttr || this.isCaught())) {
|
if (species && (this.isSeen() || this.isCaught())) {
|
||||||
this.pokemonNumberText.setText(padInt(species.speciesId, 4));
|
this.pokemonNumberText.setText(padInt(species.speciesId, 4));
|
||||||
|
|
||||||
if (this.isCaught()) {
|
if (this.isCaught()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user