From 56008230167a0e3dfb4694d73e6b0159b6440484 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 11 Feb 2021 13:56:41 -0500 Subject: Fix mobile settings --- scripts/client.js | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'scripts/client.js') diff --git a/scripts/client.js b/scripts/client.js index 0212efc..904e299 100644 --- a/scripts/client.js +++ b/scripts/client.js @@ -1,6 +1,29 @@ 'use strict'; const VERSION = "1.0.0"; +const DefaultSettings = { + a: { + type: "color", + title: "Player Color", + args: ["#ff0000"] + }, + b: { + type: "text", + title: "Player Name", + args: ["User " + Math.floor(Math.random() * 10000), ""] + }, + d: { + type: "checkbox", + title: "Order Check (D)", + args: [] + }, + c: { + type: "checkbox", + title: "Order Check (C)", + args: [] + } +} + // Client acts as the message hub for the whole game. // WebSocket messages come into Client and Client redirects them to the lobby or table based on the state of the game. // Client also performs the handshake for first starting the connection and messages everyone if the connection errors or closes. @@ -25,6 +48,9 @@ class Client{ this.chat.addChannel("global"); this.chat.switchChannel("global"); + this.settings = new Settings(DefaultSettings); + this.settings.putSettings(this.lobby.e.settings); + this.game = game; } @@ -62,8 +88,7 @@ class Client{ return; case "ready": - if(this.settings !== undefined) - this.settings.cleanup(); + this.settings.cleanup(); this.settings = new Settings(m.data); -- cgit v1.2.3