From 811571e23b68f4318794de3d34aa15cb91ec3d2d Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 19 Oct 2021 00:18:37 -0400 Subject: [Refactor] Lots of little patches + Make chatbox code a little cleaner + Add a bit of documentation + Begin prep for passwords + Function to easily grab decks from cards ~ I am going to have to completely re-do cards and decks probably. --- scripts/gui/lobby.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scripts/gui/lobby.js') diff --git a/scripts/gui/lobby.js b/scripts/gui/lobby.js index 8242843..4907f41 100644 --- a/scripts/gui/lobby.js +++ b/scripts/gui/lobby.js @@ -51,7 +51,7 @@ class TopBar{ // Game represents a single game in the lobby view. It has methods for setting up the elements and such. class Game { - constructor(options = {id: 0, name: ""}, el) + constructor(options = {id: 0, name: "", password: false}, el) { this.getID = function () { return options.id; @@ -74,6 +74,20 @@ class Game { join.addEventListener("click", game.joinGame.bind(game, options.id)); e.appendChild(join); + this.hasPassword = function () { + return options.password; + } + + if(usePass) { + let pass = MakeInput.textInput("", "Game password"); + pass.classList.add("pass"); + e.appendChild(pass); + + this.getUserPass = function () { + return pass.value; + } + } + el.appendChild(e); } } -- cgit v1.2.3