mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-24 07:23:24 +02:00
Apply slight de-nesting to command-ui-handler.ts
This commit is contained in:
parent
1ed1708386
commit
bac561a8bf
@ -256,48 +256,49 @@ export class CommandUiHandler extends UiHandler {
|
||||
break;
|
||||
}
|
||||
case Button.CYCLE_ABILITY: // Used to restart the battle
|
||||
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("SummonPhase", 1);
|
||||
}
|
||||
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,
|
||||
);
|
||||
});
|
||||
if (!globalScene.enableRetries) {
|
||||
break;
|
||||
}
|
||||
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.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,
|
||||
);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user