summaryrefslogtreecommitdiff
path: root/scripts/gui/lobby.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gui/lobby.js')
-rw-r--r--scripts/gui/lobby.js16
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);
}
}