Modal windows

This commit is contained in:
Martin
2022-12-21 14:08:49 +01:00
parent b4abb4df21
commit f3eb520300
25 changed files with 5287 additions and 263 deletions

View File

@@ -1,5 +1,8 @@
import { MenuModalWindowTypes } from "../../Menu/ModalWindows/MenuModalWindowTypes";
import { Empty } from "../../Menu/ModalWindows/Upgrades/UpgradesModalWindow";
import { ModalWindowManager } from "../../Services/ModalWindowSystem/ModalWindowManager";
import { TranslationData } from "../Data/TranslationData";
import { Game } from "../Game";
import { Pauser } from "../Pauser";
import { LevelUpModalWindowParams } from "../UI/LevelUpWindow/LevelUpModalWindow";
import { Player } from "../Unit/Player/Player";
@@ -27,4 +30,15 @@ export class GameModalLauncher {
this.gamePauser.resume();
this.upgrader.upgradeSkill(skillToUpgrade);
}
public async showPauseModal(): Promise<void> {
this.gamePauser.pause();
const shouldExit = await this.modalWindowManager.showModal<ModalWindowManager, boolean>(GameModalWindowTypes.Pause, this.modalWindowManager);
if (shouldExit) {
Game.Instance.exitGame();
} else {
this.gamePauser.resume();
}
}
}