MultiplayerMinesweeper/client/scripts/interface/scene.js

34 lines
793 B
JavaScript
Raw Normal View History

2022-07-20 03:50:48 +00:00
import {ID} from "../util.js"
import * as createMenu from "./mainmenu/create.js"
import * as joinMenu from "./mainmenu/join.js"
const menu = ID('menu')
const game = ID('game')
const joinType = ID("joinType")
const joinGameMenu = ID("joinGame")
const createGameMenu = ID("createGame")
export function changeScene(scene) {
2022-07-20 03:50:48 +00:00
console.log(`Changing scene to ${scene}`)
switch (scene) {
case "game":
menu.style = "display: none;"
game.style = ""
break;
case "mainmenu":
menu.style = ""
game.style = "display: none;"
break;
case "newgame":
joinType.style.display = "none";
createGameMenu.style.display = "";
createMenu.init();
break;
case "joingame":
joinType.style.display = "none";
joinGameMenu.style.display = "";
joinMenu.init();
break;
}
};