make it actually work this time
todo: 'you have a turn' text doesn't move chat
This commit is contained in:
parent
a0f3208686
commit
27a878b619
1 changed files with 3 additions and 2 deletions
|
@ -171,6 +171,7 @@ class CollabVMClient {
|
||||||
buttons.takeTurn.innerText = "Take Turn";
|
buttons.takeTurn.innerText = "Take Turn";
|
||||||
turn = -1;
|
turn = -1;
|
||||||
turnstatus.innerText = "";
|
turnstatus.innerText = "";
|
||||||
|
display.className = "";
|
||||||
// Get the number of users queued for a turn
|
// Get the number of users queued for a turn
|
||||||
var queuedUsers = Number(msgArr[2]);
|
var queuedUsers = Number(msgArr[2]);
|
||||||
if (queuedUsers === 0) return;
|
if (queuedUsers === 0) return;
|
||||||
|
@ -182,7 +183,7 @@ class CollabVMClient {
|
||||||
if (currentTurnUsername === window.username) {
|
if (currentTurnUsername === window.username) {
|
||||||
turn = 0;
|
turn = 0;
|
||||||
turnstatus.innerText = "You have the turn.";
|
turnstatus.innerText = "You have the turn.";
|
||||||
display.class = "focused";
|
display.className = "focused";
|
||||||
}
|
}
|
||||||
// Highlight all waiting users and set their status
|
// Highlight all waiting users and set their status
|
||||||
if (queuedUsers > 1) {
|
if (queuedUsers > 1) {
|
||||||
|
@ -190,7 +191,7 @@ class CollabVMClient {
|
||||||
if (window.username === msgArr[i+3]) {
|
if (window.username === msgArr[i+3]) {
|
||||||
turn = i;
|
turn = i;
|
||||||
turnstatus.innerText = "Waiting for turn";
|
turnstatus.innerText = "Waiting for turn";
|
||||||
display.class="waiting";
|
display.className="waiting";
|
||||||
};
|
};
|
||||||
var user = users.find(u => u.username === msgArr[i+3]);
|
var user = users.find(u => u.username === msgArr[i+3]);
|
||||||
user.turn = i;
|
user.turn = i;
|
||||||
|
|
Loading…
Reference in a new issue