Turned buzzer sounds off for players by default

This commit is contained in:
Samuel Kent
2023-10-05 19:04:59 +11:00
parent 3824c3181c
commit 56f0a2b948
5 changed files with 21 additions and 14 deletions
+8 -4
View File
@@ -27,14 +27,16 @@ function clearBuzzers() {
$("#userListPanel").find("var").html("");
}
function buzzInfoToClient(buzzInfo) {
function buzzInfoToClient(buzzInfo, soundOn) {
//play sound for first buzz in
if ($("#firstBuzz").html() == "") {
$("#firstBuzz").html(buzzInfo[0].userName);
const userId = buzzInfo[0].userName.replaceAll(" ","_");
let buzzerId = $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId");
let buzzerSound = new Audio(buzzerId+".wav");
buzzerSound.play();
if (soundOn == true) {
buzzerSound.play();
}
}
for (let i=0; i < buzzInfo.length; i++) {
@@ -51,9 +53,11 @@ function idkListToClient(idkList) {
});
}
function passToClient(teamName) {
function passToClient(teamName, soundOn) {
let passSound = new Audio("PikminDeath.wav");
passSound.play();
if (soundOn == true) {
passSound.play();
}
$("#firstBuzz").html(teamName+" have Passed!");
}