mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-20 16:42:45 +02:00
[UI/UX] Option to see Pokedex entry after catching wild Pokémon (#5538)
* pokedex option after catching * Also changing catching for mystery encounters
This commit is contained in:
parent
f78015d757
commit
bba7c1610d
@ -741,6 +741,26 @@ export async function catchPokemon(
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
() => {
|
||||||
|
const attributes = {
|
||||||
|
shiny: pokemon.shiny,
|
||||||
|
variant: pokemon.variant,
|
||||||
|
form: pokemon.formIndex,
|
||||||
|
female: pokemon.gender === Gender.FEMALE,
|
||||||
|
};
|
||||||
|
globalScene.ui.setOverlayMode(
|
||||||
|
Mode.POKEDEX_PAGE,
|
||||||
|
pokemon.species,
|
||||||
|
pokemon.formIndex,
|
||||||
|
attributes,
|
||||||
|
null,
|
||||||
|
() => {
|
||||||
|
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||||
|
promptRelease();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.PARTY,
|
Mode.PARTY,
|
||||||
|
@ -24,6 +24,7 @@ import type { PokeballType } from "#enums/pokeball";
|
|||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
import { Gender } from "#app/data/gender";
|
||||||
|
|
||||||
export class AttemptCapturePhase extends PokemonPhase {
|
export class AttemptCapturePhase extends PokemonPhase {
|
||||||
private pokeballType: PokeballType;
|
private pokeballType: PokeballType;
|
||||||
@ -321,6 +322,26 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
() => {
|
||||||
|
const attributes = {
|
||||||
|
shiny: pokemon.shiny,
|
||||||
|
variant: pokemon.variant,
|
||||||
|
form: pokemon.formIndex,
|
||||||
|
female: pokemon.gender === Gender.FEMALE,
|
||||||
|
};
|
||||||
|
globalScene.ui.setOverlayMode(
|
||||||
|
Mode.POKEDEX_PAGE,
|
||||||
|
pokemon.species,
|
||||||
|
pokemon.formIndex,
|
||||||
|
attributes,
|
||||||
|
null,
|
||||||
|
() => {
|
||||||
|
globalScene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||||
|
promptRelease();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
() => {
|
() => {
|
||||||
globalScene.ui.setMode(
|
globalScene.ui.setMode(
|
||||||
Mode.PARTY,
|
Mode.PARTY,
|
||||||
|
@ -21,11 +21,12 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
|
|||||||
|
|
||||||
show(args: any[]): boolean {
|
show(args: any[]): boolean {
|
||||||
if (
|
if (
|
||||||
args.length === 4 &&
|
args.length === 5 &&
|
||||||
args[0] instanceof Function &&
|
args[0] instanceof Function &&
|
||||||
args[1] instanceof Function &&
|
args[1] instanceof Function &&
|
||||||
args[2] instanceof Function &&
|
args[2] instanceof Function &&
|
||||||
args[3] === "fullParty"
|
args[3] instanceof Function &&
|
||||||
|
args[4] === "fullParty"
|
||||||
) {
|
) {
|
||||||
const config: OptionSelectConfig = {
|
const config: OptionSelectConfig = {
|
||||||
options: [
|
options: [
|
||||||
@ -37,29 +38,36 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18next.t("menu:yes"),
|
label: i18next.t("partyUiHandler:POKEDEX"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
args[1]();
|
args[1]();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18next.t("menu:no"),
|
label: i18next.t("menu:yes"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
args[2]();
|
args[2]();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: i18next.t("menu:no"),
|
||||||
|
handler: () => {
|
||||||
|
args[3]();
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
delay: args.length >= 8 && args[7] !== null ? (args[7] as number) : 0,
|
delay: args.length >= 9 && args[8] !== null ? (args[8] as number) : 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
super.show([config]);
|
super.show([config]);
|
||||||
|
|
||||||
this.switchCheck = args.length >= 5 && args[4] !== null && (args[4] as boolean);
|
this.switchCheck = args.length >= 6 && args[5] !== null && (args[5] as boolean);
|
||||||
|
|
||||||
const xOffset = args.length >= 6 && args[5] !== null ? (args[5] as number) : 0;
|
const xOffset = args.length >= 7 && args[6] !== null ? (args[6] as number) : 0;
|
||||||
const yOffset = args.length >= 7 && args[6] !== null ? (args[6] as number) : 0;
|
const yOffset = args.length >= 8 && args[7] !== null ? (args[7] as number) : 0;
|
||||||
|
|
||||||
this.optionSelectContainer.setPosition(globalScene.game.canvas.width / 6 - 1 + xOffset, -48 + yOffset);
|
this.optionSelectContainer.setPosition(globalScene.game.canvas.width / 6 - 1 + xOffset, -48 + yOffset);
|
||||||
|
|
||||||
|
@ -261,6 +261,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
private unlockedVariants: boolean[];
|
private unlockedVariants: boolean[];
|
||||||
|
|
||||||
private canUseCandies: boolean;
|
private canUseCandies: boolean;
|
||||||
|
private exitCallback;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(Mode.POKEDEX_PAGE);
|
super(Mode.POKEDEX_PAGE);
|
||||||
@ -681,6 +682,10 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
this.filteredIndices = args[2] ?? null;
|
this.filteredIndices = args[2] ?? null;
|
||||||
this.starterSetup();
|
this.starterSetup();
|
||||||
|
|
||||||
|
if (args[4] instanceof Function) {
|
||||||
|
this.exitCallback = args[4];
|
||||||
|
}
|
||||||
|
|
||||||
this.moveInfoOverlay.clear(); // clear this when removing a menu; the cancel button doesn't seem to trigger this automatically on controllers
|
this.moveInfoOverlay.clear(); // clear this when removing a menu; the cancel button doesn't seem to trigger this automatically on controllers
|
||||||
this.infoOverlay.clear();
|
this.infoOverlay.clear();
|
||||||
|
|
||||||
@ -1106,7 +1111,15 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
});
|
});
|
||||||
this.blockInput = false;
|
this.blockInput = false;
|
||||||
} else {
|
} else {
|
||||||
ui.revertMode();
|
ui.revertMode()
|
||||||
|
.then(() => {
|
||||||
|
console.log("exitCallback", this.exitCallback);
|
||||||
|
if (this.exitCallback instanceof Function) {
|
||||||
|
const exitCallback = this.exitCallback;
|
||||||
|
this.exitCallback = null;
|
||||||
|
exitCallback();
|
||||||
|
}
|
||||||
|
});
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -458,7 +458,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
makeRoomForConfirmUi(speedMultiplier = 1, fromCatch = false): Promise<void> {
|
makeRoomForConfirmUi(speedMultiplier = 1, fromCatch = false): Promise<void> {
|
||||||
const xPosition = fromCatch
|
const xPosition = fromCatch
|
||||||
? this.initialX - this.infoWindowWidth - 65
|
? this.initialX - this.infoWindowWidth - 67
|
||||||
: this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth;
|
: this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth;
|
||||||
return new Promise<void>(resolve => {
|
return new Promise<void>(resolve => {
|
||||||
globalScene.tweens.add({
|
globalScene.tweens.add({
|
||||||
|
Loading…
Reference in New Issue
Block a user