Skip to content

Commit

Permalink
fixed mute button
Browse files Browse the repository at this point in the history
  • Loading branch information
iantelli committed May 27, 2022
1 parent 462f902 commit 9ce9bd1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions public/js/lobby.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,15 @@
if (event.target.innerHTML === "ON") {
event.target.innerHTML = "OFF";
fxState = false;
sfx.mute(true);
for (const sound in sfx) {
sfx[sound].mute(true);
}
} else {
event.target.innerHTML = "ON";
fxState = true;
sfx.mute(false);
for (const sound in sfx) {
sfx[sound].mute(false);
}
}
})

Expand All @@ -506,7 +510,9 @@
onOffToggleButtonText.innerText = "OFF";
if (onOffToggleButton.parentElement.className == "soundSettingsRow") {
fxState = false;
sfx.mute(true);
for (const sound in sfx) {
sfx[sound].mute(true);
}
} else {
musicState = false;
music.battleMusic.mute(true);
Expand All @@ -516,7 +522,9 @@
onOffToggleButtonText.innerText = "ON";
if (onOffToggleButton.parentElement.className == "soundSettingsRow") {
fxState = true;
sfx.mute(false);
for (const sound in sfx) {
sfx[sound].mute(false);
}
} else {
musicState = true;
music.battleMusic.mute(false);
Expand Down

0 comments on commit 9ce9bd1

Please # to comment.