From e5fb9d63aae3493d91ce35c5d325d4035cf82406 Mon Sep 17 00:00:00 2001 From: frutescens Date: Wed, 4 Sep 2024 14:02:54 -0700 Subject: [PATCH] Made showText=> summary a promise --- src/phases/learn-move-phase.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index fbfdb2b4bd4..747efe24c29 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -83,17 +83,18 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { */ forgetMoveProcess(move: Move, pokemon: Pokemon) { this.scene.ui.setMode(this.messageMode); - this.scene.ui.showText(i18next.t("battle:learnMoveForgetQuestion"), null, () => { - this.scene.ui.setModeWithoutClear(Mode.SUMMARY, pokemon, SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => { - if (moveIndex === 4) { - this.scene.ui.setMode(this.messageMode).then(() => this.rejectMoveAndEnd(move, pokemon)); - return; - } - const forgetSuccessText = i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() }); - const fullText = [i18next.t("battle:countdownPoof"), forgetSuccessText, i18next.t("battle:learnMoveAnd")].join("$"); - this.scene.ui.setMode(this.messageMode).then(() => this.learnMove(moveIndex, move, pokemon, fullText)); + this.scene.ui.showTextPromise(i18next.t("battle:learnMoveForgetQuestion"), undefined, true) + .then(() => { + this.scene.ui.setModeWithoutClear(Mode.SUMMARY, pokemon, SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => { + if (moveIndex === 4) { + this.scene.ui.setMode(this.messageMode).then(() => this.rejectMoveAndEnd(move, pokemon)); + return; + } + const forgetSuccessText = i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() }); + const fullText = [i18next.t("battle:countdownPoof"), forgetSuccessText, i18next.t("battle:learnMoveAnd")].join("$"); + this.scene.ui.setMode(this.messageMode).then(() => this.learnMove(moveIndex, move, pokemon, fullText)); + }); }); - }, null, true); } /**