userlist now provides buzzer info
This commit is contained in:
+17
-13
@@ -5,26 +5,30 @@ function setupBuzzerOptions() {
|
||||
});
|
||||
return buzzerOptions;
|
||||
}
|
||||
function userListsToClient(playerList, chaserList) {
|
||||
$("#playerList").html("");
|
||||
$("#chaserList").html("");
|
||||
playerList.forEach((playerName) => {
|
||||
$("#playerList").append("<li>"+playerName+"</li>");
|
||||
});
|
||||
chaserList.forEach((chaserName) => {
|
||||
$("#chaserList").append("<li>"+chaserName+"</li>");
|
||||
});
|
||||
|
||||
function userInfoToClient(userInfo) {
|
||||
$("#PlayersList").html("");
|
||||
$("#ChasersList").html("");
|
||||
for (const user in userInfo) {
|
||||
$("#"+userInfo[user].teamName+"List").append("<li id="+user+">"+user+"<var></var></li>");
|
||||
}
|
||||
}
|
||||
|
||||
function gameStateToClient(currentTeam, currentScore) {
|
||||
$("#currentTeam").html(currentTeam);
|
||||
$("#currentTeam").html(currentTeam+" turn");
|
||||
$("#currentScore").html(currentScore);
|
||||
}
|
||||
|
||||
function buzzListToClient(buzzList, buzzerSound) {
|
||||
function buzzInfoToClient(buzzInfo, buzzerSound) {
|
||||
//play sound for first buzz in
|
||||
if ($("#buzzList").html() == "") {
|
||||
if (buzzInfo.length == 1) {
|
||||
buzzerSound.play();
|
||||
$("#firstBuzz").html(buzzInfo[0].userName);
|
||||
$("#userListPanel").find("#"+buzzInfo[0].userName).css("font-weight", 900);
|
||||
$("#userListPanel").find("#"+buzzInfo[0].userName).find("var").html(" (BUZZ)")
|
||||
}
|
||||
$("#buzzList").html(buzzList.join());
|
||||
|
||||
for (let i=1; i < buzzInfo.length; i++) {
|
||||
$("#userListPanel").find("#"+buzzInfo[i].userName).find("var").html(" ("+buzzInfo[i].lateTime/1000+")");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user