mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-11 01:49:29 +02:00
Fixed syntax errors + updated signature
This commit is contained in:
parent
de8cfeff3e
commit
f9dc9d2c1d
@ -669,7 +669,7 @@ export class BattleScene extends SceneBase {
|
|||||||
).then(() => loadMoveAnimAssets(defaultMoves, true)),
|
).then(() => loadMoveAnimAssets(defaultMoves, true)),
|
||||||
this.initStarterColors(),
|
this.initStarterColors(),
|
||||||
]).then(() => {
|
]).then(() => {
|
||||||
this.phaseManager.toTitleScreen("addLogin");
|
this.phaseManager.toTitleScreen(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,18 +257,15 @@ export class PhaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new {@linkcode TitlePhase}.
|
* Clear all previously set phases, then add a new {@linkcode TitlePhase} to transition to the title screen.
|
||||||
* @param clearPhaseQueue - Whether to clear the phase queue before adding a new {@linkcode TitlePhase}.
|
* @param addLogin - Whether to add a new {@linkcode LoginPhase} before the {@linkcode TitlePhase}
|
||||||
* If set to `addLogin`, will add a new {@linkcode LoginPhase} before the {@linkcode TitlePhase}
|
|
||||||
* (but reset everything else).
|
* (but reset everything else).
|
||||||
* Default `false`
|
* Default `false`
|
||||||
*/
|
*/
|
||||||
public toTitleScreen(clearPhaseQueue: boolean | "addLogin" = false): void {
|
public toTitleScreen(addLogin = false): void {
|
||||||
if (clearPhaseQueue) {
|
this.clearAllPhases();
|
||||||
this.clearAllPhases();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clearPhaseQueue === "addLogin") {
|
if (addLogin) {
|
||||||
this.unshiftNew("LoginPhase");
|
this.unshiftNew("LoginPhase");
|
||||||
}
|
}
|
||||||
this.unshiftNew("TitlePhase");
|
this.unshiftNew("TitlePhase");
|
||||||
|
@ -26,7 +26,7 @@ export class SelectStarterPhase extends Phase {
|
|||||||
globalScene.ui.setMode(UiMode.SAVE_SLOT, SaveSlotUiMode.SAVE, (slotId: number) => {
|
globalScene.ui.setMode(UiMode.SAVE_SLOT, SaveSlotUiMode.SAVE, (slotId: number) => {
|
||||||
// If clicking cancel, back out to title screen
|
// If clicking cancel, back out to title screen
|
||||||
if (slotId === -1) {
|
if (slotId === -1) {
|
||||||
globalScene.phaseManager.toTitleScreen(true);
|
globalScene.phaseManager.toTitleScreen();
|
||||||
this.end();
|
this.end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ export class TitlePhase extends Phase {
|
|||||||
options.push({
|
options.push({
|
||||||
label: i18next.t("menu:cancel"),
|
label: i18next.t("menu:cancel"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
globalScene.phaseManager.toTitleScreen(true);
|
globalScene.phaseManager.toTitleScreen();
|
||||||
super.end();
|
super.end();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -192,7 +192,7 @@ export class TitlePhase extends Phase {
|
|||||||
globalScene.ui.clearText();
|
globalScene.ui.clearText();
|
||||||
globalScene.ui.setMode(UiMode.SAVE_SLOT, SaveSlotUiMode.SAVE, (slotId: number) => {
|
globalScene.ui.setMode(UiMode.SAVE_SLOT, SaveSlotUiMode.SAVE, (slotId: number) => {
|
||||||
if (slotId === -1) {
|
if (slotId === -1) {
|
||||||
globalScene.phaseManager.toTitleScreen(true);
|
globalScene.phaseManager.toTitleScreen();
|
||||||
super.end();
|
super.end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ export class GameChallengesUiHandler extends UiHandler {
|
|||||||
this.cursorObj?.setVisible(true);
|
this.cursorObj?.setVisible(true);
|
||||||
this.updateChallengeArrows(this.startCursor.visible);
|
this.updateChallengeArrows(this.startCursor.visible);
|
||||||
} else {
|
} else {
|
||||||
globalScene.phaseManager.toTitleScreen(true);
|
globalScene.phaseManager.toTitleScreen();
|
||||||
globalScene.phaseManager.getCurrentPhase()?.end();
|
globalScene.phaseManager.getCurrentPhase()?.end();
|
||||||
}
|
}
|
||||||
success = true;
|
success = true;
|
||||||
|
@ -4321,7 +4321,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
ui.setMode(UiMode.STARTER_SELECT);
|
ui.setMode(UiMode.STARTER_SELECT);
|
||||||
// Non-challenge modes go directly back to title, while challenge modes go to the selection screen.
|
// Non-challenge modes go directly back to title, while challenge modes go to the selection screen.
|
||||||
if (!globalScene.gameMode.isChallenge) {
|
if (!globalScene.gameMode.isChallenge) {
|
||||||
globalScene.phaseManager.toTitleScreen(true);
|
globalScene.phaseManager.toTitleScreen();
|
||||||
} else {
|
} else {
|
||||||
globalScene.phaseManager.clearPhaseQueue();
|
globalScene.phaseManager.clearPhaseQueue();
|
||||||
globalScene.phaseManager.pushNew("SelectChallengePhase");
|
globalScene.phaseManager.pushNew("SelectChallengePhase");
|
||||||
|
@ -105,7 +105,7 @@ export class GameManager {
|
|||||||
(this.scene.ui.handlers[UiMode.STARTER_SELECT] as StarterSelectUiHandler).clearStarterPreferences();
|
(this.scene.ui.handlers[UiMode.STARTER_SELECT] as StarterSelectUiHandler).clearStarterPreferences();
|
||||||
|
|
||||||
// Must be run after phase interceptor has been initialized.
|
// Must be run after phase interceptor has been initialized.
|
||||||
this.scene.phaseManager.toTitlePhase("addLogin");
|
this.scene.phaseManager.toTitleScreen(true);
|
||||||
this.scene.phaseManager.shiftPhase();
|
this.scene.phaseManager.shiftPhase();
|
||||||
|
|
||||||
this.gameWrapper.scene = this.scene;
|
this.gameWrapper.scene = this.scene;
|
||||||
|
Loading…
Reference in New Issue
Block a user