Add modeChain to gameInfo for debug purposes
This commit is contained in:
parent
2d0cf54a7f
commit
0df40893b2
|
@ -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;
|
||||
}
|
||||
|
|
11
src/ui/ui.ts
11
src/ui/ui.ts
|
@ -1,4 +1,4 @@
|
|||
import {default as BattleScene} from "../battle-scene";
|
||||
import { default as BattleScene } from "../battle-scene";
|
||||
import UiHandler from "./ui-handler";
|
||||
import BattleMessageUiHandler from "./battle-message-ui-handler";
|
||||
import CommandUiHandler from "./command-ui-handler";
|
||||
|
@ -24,7 +24,7 @@ import EggHatchSceneHandler from "./egg-hatch-scene-handler";
|
|||
import EggListUiHandler from "./egg-list-ui-handler";
|
||||
import EggGachaUiHandler from "./egg-gacha-ui-handler";
|
||||
import VouchersUiHandler from "./vouchers-ui-handler";
|
||||
import {addWindow} from "./ui-theme";
|
||||
import { addWindow } from "./ui-theme";
|
||||
import LoginFormUiHandler from "./login-form-ui-handler";
|
||||
import RegistrationFormUiHandler from "./registration-form-ui-handler";
|
||||
import LoadingModalUiHandler from "./loading-modal-ui-handler";
|
||||
|
@ -37,8 +37,8 @@ import SavingIconHandler from "./saving-icon-handler";
|
|||
import UnavailableModalUiHandler from "./unavailable-modal-ui-handler";
|
||||
import OutdatedModalUiHandler from "./outdated-modal-ui-handler";
|
||||
import SessionReloadModalUiHandler from "./session-reload-modal-ui-handler";
|
||||
import {Button} from "#enums/buttons";
|
||||
import i18next, {ParseKeys} from "i18next";
|
||||
import { Button } from "#enums/buttons";
|
||||
import i18next, { ParseKeys } from "i18next";
|
||||
import GamepadBindingUiHandler from "./settings/gamepad-binding-ui-handler";
|
||||
import SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler";
|
||||
import KeyboardBindingUiHandler from "#app/ui/settings/keyboard-binding-ui-handler";
|
||||
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue