Quick mute all sounds checkbox

vue-cli
Noah 2023-09-01 17:11:17 -07:00
parent 3404373a4b
commit f65f653430
2 changed files with 19 additions and 1 deletions

View File

@ -133,6 +133,7 @@ const app = Vue.createApp({
exitMessages: false, // hide exit messages by default in public channels
watchNotif: true, // notify in chat about cameras being watched
closeDMs: false, // ignore unsolicited DMs
muteSounds: false, // mute all sound effects
},
// My video feed.
@ -396,6 +397,9 @@ const app = Vue.createApp({
"prefs.watchNotif": function() {
localStorage.watchNotif = this.prefs.watchNotif;
},
"prefs.muteSounds": function() {
localStorage.muteSounds = this.prefs.muteSounds;
},
"prefs.closeDMs": function() {
localStorage.closeDMs = this.prefs.closeDMs;
@ -603,6 +607,9 @@ const app = Vue.createApp({
if (localStorage.watchNotif != undefined) {
this.prefs.watchNotif = localStorage.watchNotif === "true";
}
if (localStorage.muteSounds != undefined) {
this.prefs.muteSounds = localStorage.muteSounds === "true";
}
if (localStorage.closeDMs != undefined) {
this.prefs.closeDMs = localStorage.closeDMs === "true";
}
@ -1281,7 +1288,7 @@ const app = Vue.createApp({
description: JSON.stringify(pc.localDescription),
}));
}).catch(e => {
this.ChatClient(`Error sending WebRTC negotiation message (SDP): ${e}`);
console.error(`Error sending WebRTC negotiation message (SDP): ${e}`);
});
};
},
@ -2450,6 +2457,8 @@ const app = Vue.createApp({
},
playSound(event) {
// Muting all SFX?
if (this.prefs.muteSounds) return;
let filename = this.config.sounds.settings[event];
// Do we have an audio track?
if (this.config.sounds.audioTracks[filename] != undefined) {

View File

@ -184,6 +184,15 @@
<!-- Sound settings -->
<div v-else-if="settingsModal.tab==='sounds'">
<div class="mb-4">
<label class="checkbox">
<input type="checkbox"
v-model="prefs.muteSounds"
:value="true">
Mute all sound effects
</label>
</div>
<div class="columns is-mobile">
<div class="column is-2 pr-1">
<label class="label is-size-7">DM chat</label>