diff options
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/webAO/client.js b/webAO/client.js index d00be46..038301a 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -949,30 +949,35 @@ class Client extends EventEmitter { document.getElementById("client_musiclist").options.add(newentry); this.musics.push(trackname); } else { - const thisarea = { - name: trackname, - players: 0, - status: "IDLE", - cm: "", - locked: "FREE" - }; + this.createArea(trackindex,trackname); + } + } - this.areas.push(thisarea); - - // Create area button - let newarea = document.createElement("SPAN"); - newarea.classList = "area-button area-default"; - newarea.id = "area" + trackindex; - newarea.innerText = thisarea.name; - newarea.title = "Players: <br>" + - "Status: <br>" + - "CM: "; - newarea.onclick = function () { - area_click(this); - }; + createArea(id,name) { + const thisarea = { + name: name, + players: 0, + status: "IDLE", + cm: "", + locked: "FREE" + }; - document.getElementById("areas").appendChild(newarea); - } + this.areas.push(thisarea); + + // Create area button + let newarea = document.createElement("SPAN"); + newarea.classList = "area-button area-default"; + newarea.id = "area" + id; + newarea.innerText = thisarea.name; + newarea.title = `Players: ${thisarea.players}\n` + + `Status: ${thisarea.status}\n` + + `CM: ${thisarea.cm}\n` + + `Area lock: ${thisarea.locked}`; + newarea.onclick = function () { + area_click(this); + }; + + document.getElementById("areas").appendChild(newarea); } /** @@ -1234,7 +1239,7 @@ class Client extends EventEmitter { } thisarea.classList = "area-button area-" + this.areas[i].status.toLowerCase(); - + thisarea.innerText = `${this.areas[i].name} (${this.areas[i].players}) [${this.areas[i].status}]`; thisarea.title = `Players: ${this.areas[i].players}\n` + |
