summaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-06-17 01:34:20 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-06-17 01:34:20 -0400
commitfa2d9b6f912b48f4968f012bce5f14d225395a77 (patch)
tree4f5e5935dcbcb3a6179f38d4c2e2592d28939cf0 /client/src
parentdelete compiled js (diff)
downloadtuxman-fa2d9b6f912b48f4968f012bce5f14d225395a77.tar.gz
tuxman-fa2d9b6f912b48f4968f012bce5f14d225395a77.tar.bz2
tuxman-fa2d9b6f912b48f4968f012bce5f14d225395a77.zip
layout changed
Diffstat (limited to '')
-rw-r--r--client/src/editor.ts3
-rw-r--r--client/src/main.ts7
-rw-r--r--client/src/net/multiplayer.ts3
3 files changed, 8 insertions, 5 deletions
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
}
}