diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2021-10-19 00:18:37 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2021-10-19 00:18:37 -0400 |
commit | 811571e23b68f4318794de3d34aa15cb91ec3d2d (patch) | |
tree | 56c1a5648a06aac8c59125d0af7669c0a9688547 /scripts/gui/lobby.js | |
parent | fb231e3c6f3afbd40de5a94187221b788656cb5c (diff) |
[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.
Diffstat (limited to 'scripts/gui/lobby.js')
-rw-r--r-- | scripts/gui/lobby.js | 16 |
1 files changed, 15 insertions, 1 deletions
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); } } |