mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-19 18:57:37 +00:00
chore: fix menu-ui-handlers.ts
This commit is contained in:
parent
93d805e0a4
commit
1ef836e66e
@ -555,52 +555,52 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||||||
buttonActions: [], fadeOut: () =>
|
buttonActions: [], fadeOut: () =>
|
||||||
this.scene.gameData.saveAll(this.scene, true, true, true, true).then(() => {
|
this.scene.gameData.saveAll(this.scene, true, true, true, true).then(() => {
|
||||||
|
|
||||||
this.scene.reset(true);
|
this.scene.reset(true);
|
||||||
})
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
if (this.scene.currentBattle.turn > 1) {
|
||||||
|
ui.showText(i18next.t("menuUiHandler:losingProgressionWarning"), null, () => {
|
||||||
|
if (!this.active) {
|
||||||
|
this.showText("", 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ui.setOverlayMode(Mode.CONFIRM, doSaveQuit, () => {
|
||||||
|
ui.revertMode();
|
||||||
|
this.showText("", 0);
|
||||||
|
}, false, -98);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
doSaveQuit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MenuOptions.LOG_OUT:
|
||||||
|
success = true;
|
||||||
|
const doLogout = () => {
|
||||||
|
ui.setMode(Mode.LOADING, {
|
||||||
|
buttonActions: [], fadeOut: () => pokerogueApi.account.logout().then(() => {
|
||||||
|
updateUserInfo().then(() => this.scene.reset(true, true));
|
||||||
|
})
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
if (this.scene.currentBattle.turn > 1) {
|
if (this.scene.currentBattle) {
|
||||||
ui.showText(i18next.t("menuUiHandler:losingProgressionWarning"), null, () => {
|
ui.showText(i18next.t("menuUiHandler:losingProgressionWarning"), null, () => {
|
||||||
if (!this.active) {
|
if (!this.active) {
|
||||||
this.showText("", 0);
|
this.showText("", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ui.setOverlayMode(Mode.CONFIRM, doSaveQuit, () => {
|
ui.setOverlayMode(Mode.CONFIRM, doLogout, () => {
|
||||||
ui.revertMode();
|
ui.revertMode();
|
||||||
this.showText("", 0);
|
this.showText("", 0);
|
||||||
}, false, -98);
|
}, false, -98);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
doSaveQuit();
|
doLogout();
|
||||||
}
|
}
|
||||||
} else {
|
break;
|
||||||
error = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MenuOptions.LOG_OUT:
|
|
||||||
success = true;
|
|
||||||
const doLogout = () => {
|
|
||||||
ui.setMode(Mode.LOADING, {
|
|
||||||
buttonActions: [], fadeOut: () => pokerogueApi.account.logout().then(() => {
|
|
||||||
updateUserInfo().then(() => this.scene.reset(true, true));
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
if (this.scene.currentBattle) {
|
|
||||||
ui.showText(i18next.t("menuUiHandler:losingProgressionWarning"), null, () => {
|
|
||||||
if (!this.active) {
|
|
||||||
this.showText("", 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ui.setOverlayMode(Mode.CONFIRM, doLogout, () => {
|
|
||||||
ui.revertMode();
|
|
||||||
this.showText("", 0);
|
|
||||||
}, false, -98);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
doLogout();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else if (button === Button.CANCEL) {
|
} else if (button === Button.CANCEL) {
|
||||||
success = true;
|
success = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user