From fa2d9b6f912b48f4968f012bce5f14d225395a77 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 17 Jun 2023 01:34:20 -0400 Subject: layout changed --- client/src/editor.ts | 3 +-- client/src/main.ts | 7 ++++++- client/src/net/multiplayer.ts | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'client/src') diff --git a/client/src/editor.ts b/client/src/editor.ts index 687f076..77088ce 100644 --- a/client/src/editor.ts +++ b/client/src/editor.ts @@ -1,10 +1,9 @@ import { genMap } from "./map.js" import { startGraphicsUpdater } from "./renderer.js" -import { GameState, Vec2, ATLAS_TILE_WIDTH, Tile } from "./types.js" +import { GameState, Vec2, Tile } from "./types.js" const mapgen = document.getElementById("mapgen") const sidebar = document.getElementById("sidebar") -sidebar.style.display = "none" mapgen.onsubmit = async function(event) { event.preventDefault() diff --git a/client/src/main.ts b/client/src/main.ts index c8a1758..7ac13a3 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -5,7 +5,7 @@ import { GameKeyMap, Frame, Key } from "./types.js"; const join = document.getElementById("join") const lobby = document.getElementById("lobby") -lobby.style.display = "none" +const mapeditor = document.getElementById("mapeditor") join.onsubmit = async function(event) { event.preventDefault() @@ -24,10 +24,15 @@ join.onsubmit = async function(event) { } join.style.display = "none" + mapeditor.style.display = "none" startGame(room_code, player_name) } +mapeditor.onclick = function() { + window.location.href = 'mapeditor.html' +} + const updateGraphics = startGraphicsUpdater() const onLoad = (startData: Frame) => { diff --git a/client/src/net/multiplayer.ts b/client/src/net/multiplayer.ts index 5dcf86d..12d1773 100644 --- a/client/src/net/multiplayer.ts +++ b/client/src/net/multiplayer.ts @@ -179,8 +179,7 @@ export function multiplayer( } if (!flushCachedInputs(delta / 2)) { socket.close() - document.getElementById("lobby").style.display = "none" - document.getElementById("join").style.display = "" + window.location.reload() return } } -- cgit v1.2.3-freya