summaryrefslogtreecommitdiff
path: root/scripts/client.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-07-28 22:27:39 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-07-28 22:27:39 -0400
commit03b7e2d4cb001cef990efef61d9ce499c8e4f878 (patch)
tree3e3d2d179c2b95703dda940546d00ac914b33bd8 /scripts/client.js
parent81b562233188569b66fc2fb2a7ff952bdae0a4ec (diff)
Fix button input, add rotation and scale to decks
Diffstat (limited to 'scripts/client.js')
-rw-r--r--scripts/client.js17
1 files changed, 17 insertions, 0 deletions
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);