fix: reset mode chain in TitlePhase's loadSaveSlot method
This commit is contained in:
parent
638a0a66b5
commit
0574e817d9
|
@ -321,6 +321,7 @@ export class TitlePhase extends Phase {
|
|||
loadSaveSlot(slotId: integer): void {
|
||||
this.scene.sessionSlotId = slotId > -1 || !loggedInUser ? slotId : loggedInUser.lastSessionSlot;
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.ui.resetModeChain();
|
||||
this.scene.gameData.loadSession(this.scene, slotId, slotId === -1 ? this.lastSessionData : undefined).then((success: boolean) => {
|
||||
if (success) {
|
||||
this.loaded = true;
|
||||
|
|
|
@ -97,6 +97,7 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||
|
||||
render() {
|
||||
const ui = this.getUi();
|
||||
console.log(ui.getModeChain());
|
||||
this.excludedMenus = () => [
|
||||
{ condition: ![Mode.COMMAND, Mode.TITLE].includes(ui.getModeChain()[0]), options: [ MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] },
|
||||
{ condition: bypassLogin, options: [ MenuOptions.LOG_OUT ] }
|
||||
|
|
|
@ -497,6 +497,10 @@ export default class UI extends Phaser.GameObjects.Container {
|
|||
return this.setModeInternal(mode, false, false, true, args);
|
||||
}
|
||||
|
||||
resetModeChain(): void {
|
||||
this.modeChain = [];
|
||||
}
|
||||
|
||||
revertMode(): Promise<boolean> {
|
||||
return new Promise<boolean>(resolve => {
|
||||
if (!this?.modeChain?.length) {
|
||||
|
|
Loading…
Reference in New Issue