mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2026-02-14 12:22:42 +00:00
Menu modal WIP, new settigns
This commit is contained in:
@@ -1,25 +1,31 @@
|
||||
import { _decorator, Component, Node, Button } from "cc";
|
||||
import { type } from "os";
|
||||
import { _decorator, Component } from "cc";
|
||||
import { ModalWindowManager } from "../Services/ModalWindowSystem/ModalWindowManager";
|
||||
import { UIButton } from "../Services/UI/Button/UIButton";
|
||||
|
||||
import { GameRunner } from "./GameRunner";
|
||||
import { MenuModalLauncher } from "./ModalWindows/MenuModalLauncher";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("Menu")
|
||||
export class Menu extends Component {
|
||||
@property(UIButton) private playBtn: UIButton;
|
||||
@property(UIButton) private upgradeBtn: UIButton;
|
||||
@property(ModalWindowManager) private modalWindowManager: ModalWindowManager;
|
||||
|
||||
private menuModalLauncher: MenuModalLauncher;
|
||||
|
||||
public async start(): Promise<void> {
|
||||
this.playBtn.InteractedEvent.on(this.startGame, this);
|
||||
this.upgradeBtn.InteractedEvent.on(this.openUpgradesWindow, this);
|
||||
|
||||
this.menuModalLauncher = new MenuModalLauncher(this.modalWindowManager);
|
||||
}
|
||||
|
||||
private startGame(): void {
|
||||
GameRunner.Instance.playGame();
|
||||
}
|
||||
|
||||
private openUpgradesWindow(): void {}
|
||||
private openUpgradesWindow(): void {
|
||||
this.menuModalLauncher.openUpgradesWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user