refactor: Update excludedMenus condition to look for currentPhase instead

This commit is contained in:
Frederico Santos 2024-08-31 05:14:25 +01:00
parent f9de149f55
commit 3a50925de0
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import { Button } from "#enums/buttons";
import { GameDataType } from "#enums/game-data-type";
import BgmBar from "#app/ui/bgm-bar";
import AwaitableUiHandler from "./awaitable-ui-handler";
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
enum MenuOptions {
GAME_SETTINGS,
@ -106,7 +107,7 @@ export default class MenuUiHandler extends MessageUiHandler {
render() {
const ui = this.getUi();
this.excludedMenus = () => [
{ condition: ![Mode.COMMAND, Mode.TITLE].includes(ui.getModeChain().at(-1)!), options: [MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] },
{ condition: this.scene.getCurrentPhase() instanceof SelectModifierPhase, options: [MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] },
{ condition: bypassLogin, options: [MenuOptions.LOG_OUT] }
];