Add modeChain to gameInfo for debug purposes

This commit is contained in:
Frederico Santos 2024-08-24 17:59:41 +01:00
parent 2d0cf54a7f
commit 0df40893b2
2 changed files with 8 additions and 4 deletions

View File

@ -2653,6 +2653,7 @@ export default class BattleScene extends SceneBase {
party: this.party ? this.party.map(p => {
return { name: p.name, level: p.level };
}) : [],
modeChain: this.ui?.getModeChain() ?? [],
};
(window as any).gameInfo = gameInfo;
}

View File

@ -453,6 +453,7 @@ export default class UI extends Phaser.GameObjects.Container {
}
if (chainMode && this.mode && !clear) {
this.modeChain.push(this.mode);
(this.scene as BattleScene).updateGameInfo();
}
this.mode = mode;
const touchControls = document?.getElementById("touchControls");
@ -500,6 +501,7 @@ export default class UI extends Phaser.GameObjects.Container {
resetModeChain(): void {
this.modeChain = [];
(this.scene as BattleScene).updateGameInfo();
}
revertMode(): Promise<boolean> {
@ -513,6 +515,7 @@ export default class UI extends Phaser.GameObjects.Container {
const doRevertMode = () => {
this.getHandler().clear();
this.mode = this.modeChain.pop()!; // TODO: is this bang correct?
(this.scene as BattleScene).updateGameInfo();
const touchControls = document.getElementById("touchControls");
if (touchControls) {
touchControls.dataset.uiMode = Mode[this.mode];