diff --git a/src/ui/handlers/command-ui-handler.ts b/src/ui/handlers/command-ui-handler.ts index 5ee385b9b80..dfd1137be36 100644 --- a/src/ui/handlers/command-ui-handler.ts +++ b/src/ui/handlers/command-ui-handler.ts @@ -201,44 +201,46 @@ export class CommandUiHandler extends UiHandler { } break; case Button.CYCLE_ABILITY: - globalScene.ui.setMode(UiMode.MESSAGE) - globalScene.ui.showText(i18next.t("battle:retryBattle"), null, () => { - globalScene.ui.setMode( - UiMode.CONFIRM, - () => { - globalScene.ui.fadeOut(1250).then(() => { - globalScene.reset(); - globalScene.phaseManager.clearPhaseQueue(); - globalScene.gameData.loadSession(globalScene.sessionSlotId).then(() => { - globalScene.phaseManager.pushNew("EncounterPhase", true); - - const availablePartyMembers = globalScene.getPokemonAllowedInBattle().length; - - globalScene.phaseManager.pushNew("SummonPhase", 0); - if (globalScene.currentBattle.double && availablePartyMembers > 1) { - globalScene.phaseManager.pushNew("SummonPhase", 1); - } - if ( - globalScene.currentBattle.waveIndex > 1 && - globalScene.currentBattle.battleType !== BattleType.TRAINER - ) { - globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double); + if (globalScene.enableRetries){ + globalScene.ui.setMode(UiMode.MESSAGE) + globalScene.ui.showText(i18next.t("battle:retryBattle"), null, () => { + globalScene.ui.setMode( + UiMode.CONFIRM, + () => { + globalScene.ui.fadeOut(1250).then(() => { + globalScene.reset(); + globalScene.phaseManager.clearPhaseQueue(); + globalScene.gameData.loadSession(globalScene.sessionSlotId).then(() => { + globalScene.phaseManager.pushNew("EncounterPhase", true); + + const availablePartyMembers = globalScene.getPokemonAllowedInBattle().length; + + globalScene.phaseManager.pushNew("SummonPhase", 0); if (globalScene.currentBattle.double && availablePartyMembers > 1) { - globalScene.phaseManager.pushNew("CheckSwitchPhase", 1, globalScene.currentBattle.double); + globalScene.phaseManager.pushNew("SummonPhase", 1); } - } - globalScene.ui.fadeIn(1250); - globalScene.phaseManager.shiftPhase(); + if ( + globalScene.currentBattle.waveIndex > 1 && + globalScene.currentBattle.battleType !== BattleType.TRAINER + ) { + globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double); + if (globalScene.currentBattle.double && availablePartyMembers > 1) { + globalScene.phaseManager.pushNew("CheckSwitchPhase", 1, globalScene.currentBattle.double); + } + } + globalScene.ui.fadeIn(1250); + globalScene.phaseManager.shiftPhase(); + }); }); - }); - }, - () => { globalScene.ui.setMode(UiMode.COMMAND)}, - false, - 0, - 0, - 1000, - ); - }); + }, + () => { globalScene.ui.setMode(UiMode.COMMAND)}, + false, + 0, + 0, + 1000, + ); + }); + } break; } }