mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 16:56:11 +00:00
[Enhancement] Add confirm exit popup in starter select UI (#3316)
* add confirmExit popup * add translation entries for `confirmExit` * Update src/ui/starter-select-ui-handler.ts Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> --------- Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
This commit is contained in:
parent
800abc4767
commit
d20b7553ef
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "Mit diesen Pokémon losziehen?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "Das ist kein gültiges Team!",
|
||||
"gen1": "I",
|
||||
"gen2": "II",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "Begin with these Pokémon?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "This is not a valid starting party!",
|
||||
"gen1": "I",
|
||||
"gen2": "II",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "¿Comenzar con estos Pokémon?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "¡Este equipo no es válido!",
|
||||
"gen1": "I",
|
||||
"gen2": "II",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "Commencer avec ces Pokémon ?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "Cette équipe de départ est invalide !",
|
||||
"gen1": "1G",
|
||||
"gen2": "2G",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "Vuoi iniziare con questi Pokémon?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "Questo squadra iniziale non è valida!",
|
||||
"gen1": "1ª",
|
||||
"gen2": "2ª",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "이 포켓몬들로 시작하시겠습니까?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "스타팅 포켓몬 파티에 적합하지 않습니다!",
|
||||
"gen1": "1세대",
|
||||
"gen2": "2세대",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "Começar com esses Pokémon?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "Essa equipe de iniciais não é válida!",
|
||||
"gen1": "G1",
|
||||
"gen2": "G2",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "使用这些宝可梦开始游戏吗?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "初始队伍不可用!",
|
||||
"gen1": "I",
|
||||
"gen2": "II",
|
||||
|
@ -7,6 +7,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales";
|
||||
*/
|
||||
export const starterSelectUiHandler: SimpleTranslationEntries = {
|
||||
"confirmStartTeam": "使用這些寶可夢開始嗎?",
|
||||
"confirmExit": "Do you want to exit?",
|
||||
"invalidParty": "此為無效隊伍!",
|
||||
"gen1": "I",
|
||||
"gen2": "II",
|
||||
|
@ -1063,14 +1063,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
success = true;
|
||||
this.updateInstructions();
|
||||
} else {
|
||||
this.blockInput = true;
|
||||
this.scene.clearPhaseQueue();
|
||||
if (this.scene.gameMode.isChallenge) {
|
||||
this.scene.pushPhase(new SelectChallengePhase(this.scene));
|
||||
} else {
|
||||
this.scene.pushPhase(new TitlePhase(this.scene));
|
||||
}
|
||||
this.scene.getCurrentPhase().end();
|
||||
this.tryExit();
|
||||
success = true;
|
||||
}
|
||||
} else if (this.startCursorObj.visible) { // this checks to see if the start button is selected
|
||||
@ -2880,6 +2873,32 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
tryExit(): boolean {
|
||||
this.blockInput = true;
|
||||
const ui = this.getUi();
|
||||
|
||||
const cancel = () => {
|
||||
ui.setMode(Mode.STARTER_SELECT);
|
||||
this.clearText();
|
||||
this.blockInput = false;
|
||||
};
|
||||
ui.showText(i18next.t("starterSelectUiHandler:confirmExit"), null, () => {
|
||||
ui.setModeWithoutClear(Mode.CONFIRM, () => {
|
||||
ui.setMode(Mode.STARTER_SELECT);
|
||||
this.scene.clearPhaseQueue();
|
||||
if (this.scene.gameMode.isChallenge) {
|
||||
this.scene.pushPhase(new SelectChallengePhase(this.scene));
|
||||
} else {
|
||||
this.scene.pushPhase(new TitlePhase(this.scene));
|
||||
}
|
||||
this.clearText();
|
||||
this.scene.getCurrentPhase().end();
|
||||
}, cancel, null, null, 19);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
tryStart(manualTrigger: boolean = false): boolean {
|
||||
if (!this.starterSpecies.length) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user