diff --git a/src/locales/de/starter-select-ui-handler.ts b/src/locales/de/starter-select-ui-handler.ts index caade5c524d..e8ae4ed201e 100644 --- a/src/locales/de/starter-select-ui-handler.ts +++ b/src/locales/de/starter-select-ui-handler.ts @@ -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", diff --git a/src/locales/en/starter-select-ui-handler.ts b/src/locales/en/starter-select-ui-handler.ts index 6d7b7f7cfb2..deb4236c8ba 100644 --- a/src/locales/en/starter-select-ui-handler.ts +++ b/src/locales/en/starter-select-ui-handler.ts @@ -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", diff --git a/src/locales/es/starter-select-ui-handler.ts b/src/locales/es/starter-select-ui-handler.ts index 583e302bfeb..d7c203f49c4 100644 --- a/src/locales/es/starter-select-ui-handler.ts +++ b/src/locales/es/starter-select-ui-handler.ts @@ -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", diff --git a/src/locales/fr/starter-select-ui-handler.ts b/src/locales/fr/starter-select-ui-handler.ts index ce5959062ac..ef685598158 100644 --- a/src/locales/fr/starter-select-ui-handler.ts +++ b/src/locales/fr/starter-select-ui-handler.ts @@ -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", diff --git a/src/locales/it/starter-select-ui-handler.ts b/src/locales/it/starter-select-ui-handler.ts index 9b0197e48ab..6f43b9415e0 100644 --- a/src/locales/it/starter-select-ui-handler.ts +++ b/src/locales/it/starter-select-ui-handler.ts @@ -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ª", diff --git a/src/locales/ko/starter-select-ui-handler.ts b/src/locales/ko/starter-select-ui-handler.ts index 8fe66e0d58a..c57a37788fa 100644 --- a/src/locales/ko/starter-select-ui-handler.ts +++ b/src/locales/ko/starter-select-ui-handler.ts @@ -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세대", diff --git a/src/locales/pt_BR/starter-select-ui-handler.ts b/src/locales/pt_BR/starter-select-ui-handler.ts index d1038630c8c..a6407b5368d 100644 --- a/src/locales/pt_BR/starter-select-ui-handler.ts +++ b/src/locales/pt_BR/starter-select-ui-handler.ts @@ -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", diff --git a/src/locales/zh_CN/starter-select-ui-handler.ts b/src/locales/zh_CN/starter-select-ui-handler.ts index 45327bab55b..b8c491288e1 100644 --- a/src/locales/zh_CN/starter-select-ui-handler.ts +++ b/src/locales/zh_CN/starter-select-ui-handler.ts @@ -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", diff --git a/src/locales/zh_TW/starter-select-ui-handler.ts b/src/locales/zh_TW/starter-select-ui-handler.ts index 0ea1e2d0415..1202bf45f0e 100644 --- a/src/locales/zh_TW/starter-select-ui-handler.ts +++ b/src/locales/zh_TW/starter-select-ui-handler.ts @@ -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", diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 2f5197a2d2c..ff7b7c19e47 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -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;