From 03b7e2d4cb001cef990efef61d9ce499c8e4f878 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 28 Jul 2022 22:27:39 -0400 Subject: Fix button input, add rotation and scale to decks --- scripts/client.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts/client.js') diff --git a/scripts/client.js b/scripts/client.js index e158cef..bceb7a4 100644 --- a/scripts/client.js +++ b/scripts/client.js @@ -105,6 +105,14 @@ class Client{ console.error(m.data); return; + case "err": + this.socket.close(); + + alert(`Error connecting to server: ${m.data}`); + + console.error(`Error connecting to server: ${m.data}`); + + return; case "ready": console.log(`Handshake with server OK. Running client version ${VERSION}`); @@ -117,7 +125,16 @@ class Client{ this.settings = new Settings(m.data.user); this.settings.addEventListener("change", (() => {this.socket.send("options", this.settings.getSettings())}).bind(this)); + m.data.game.new = { + type: "button", + title: "", + args: ["Create and Join"] + } this.gameOptions = new Settings(m.data.game); + this.gameOptions.addEventListener("click", ((e) => { + if(e.detail == "new") + this.socket.send("create", this.gameOptions.getSettings()); + }).bind(this)); this.gameOptions.putSettings(this.lobby.top.newGame); -- cgit v1.2.3