add "Ring bell" for Strory teller

This commit is contained in:
pingumask 2022-10-27 21:41:57 +02:00 committed by Pingumask
parent fdb208c03a
commit 738d2c42ff
8 changed files with 51 additions and 2 deletions

View file

@ -121,6 +121,10 @@ export default {
if (this.session.isSpectator) return; if (this.session.isSpectator) return;
this.$refs.menu.toggleNight(); this.$refs.menu.toggleNight();
break; break;
case "b":
if (this.session.isSpectator) return;
this.$refs.menu.toggleRinging();
break;
case "escape": case "escape":
this.$store.commit("toggleModal"); this.$store.commit("toggleModal");
} }

View file

@ -58,6 +58,10 @@
<template v-if="grimoire.isNight">{{ locale.menu.grimoire.daySwitch }}</template> <template v-if="grimoire.isNight">{{ locale.menu.grimoire.daySwitch }}</template>
<em>[S]</em> <em>[S]</em>
</li> </li>
<li @click="toggleRinging" v-if="!session.isSpectator">
<template>{{ locale.menu.grimoire.ringBell }}</template>
<em>[B]</em>
</li>
<li @click="toggleNightOrder" v-if="players.length"> <li @click="toggleNightOrder" v-if="players.length">
{{ locale.menu.grimoire.order }} {{ locale.menu.grimoire.order }}
<em> <em>
@ -344,6 +348,10 @@ export default {
this.$store.commit("session/setMarkedPlayer", -1); this.$store.commit("session/setMarkedPlayer", -1);
} }
}, },
toggleRinging() {
this.$store.commit("toggleRinging", true);
setTimeout(this.$store.commit, 4000, "toggleRinging", false);
},
...mapMutations([ ...mapMutations([
"toggleGrimoire", "toggleGrimoire",
"toggleMenu", "toggleMenu",

View file

@ -67,6 +67,16 @@
Night phase Night phase
<font-awesome-icon :icon="['fas', 'cloud-moon']" /> <font-awesome-icon :icon="['fas', 'cloud-moon']" />
</span> </span>
<span v-if="grimoire.isRinging">
<audio
:autoplay="!grimoire.isMuted"
src="../assets/sounds/countdown.mp3"
:muted="grimoire.isMuted"
></audio>
<font-awesome-icon :icon="['fas', 'music']" />
<font-awesome-icon :icon="['fas', 'bell']" />
<font-awesome-icon :icon="['fas', 'music']" />
</span>
</li> </li>
</ul> </ul>
</template> </template>

View file

@ -8,6 +8,7 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
const faIcons = [ const faIcons = [
"AddressCard", "AddressCard",
"Bell",
"BookOpen", "BookOpen",
"BookDead", "BookDead",
"BroadcastTower", "BroadcastTower",
@ -29,6 +30,7 @@ const faIcons = [
"Image", "Image",
"Link", "Link",
"MinusCircle", "MinusCircle",
"Music",
"PeopleArrows", "PeopleArrows",
"PlusCircle", "PlusCircle",
"Question", "Question",

View file

@ -104,6 +104,7 @@ export default new Vuex.Store({
grimoire: { grimoire: {
isNight: false, isNight: false,
isNightOrder: true, isNightOrder: true,
isRinging: false,
isPublic: true, isPublic: true,
isMenuOpen: false, isMenuOpen: false,
isStatic: false, isStatic: false,
@ -175,6 +176,7 @@ export default new Vuex.Store({
toggleNightOrder: toggle("isNightOrder"), toggleNightOrder: toggle("isNightOrder"),
toggleStatic: toggle("isStatic"), toggleStatic: toggle("isStatic"),
toggleNight: toggle("isNight"), toggleNight: toggle("isNight"),
toggleRinging: toggle("isRinging"),
toggleGrimoire: toggle("isPublic"), toggleGrimoire: toggle("isPublic"),
toggleImageOptIn: toggle("isImageOptIn"), toggleImageOptIn: toggle("isImageOptIn"),
toggleModal({ modals }, name) { toggleModal({ modals }, name) {

View file

@ -11,7 +11,8 @@
"background": "Background image", "background": "Background image",
"customImages": "Show Custom Images", "customImages": "Show Custom Images",
"animations": "Disable Animations", "animations": "Disable Animations",
"mute": "Mute Sounds" "mute": "Mute Sounds",
"ringBell": "Ring Bell"
}, },
"session":{ "session":{
"title":{ "title":{

View file

@ -11,7 +11,8 @@
"background": "Image de fond", "background": "Image de fond",
"customImages": "Images Importées", "customImages": "Images Importées",
"animations": "Effets réduits", "animations": "Effets réduits",
"mute": "Silencieux" "mute": "Silencieux",
"ringBell": "Sonner Clocher"
}, },
"session":{ "session":{
"title":{ "title":{

View file

@ -176,6 +176,13 @@ class LiveSession {
if (!this._isSpectator) return; if (!this._isSpectator) return;
this._store.commit("toggleNight", params); this._store.commit("toggleNight", params);
break; break;
case "isRinging":
if (!this._isSpectator) return;
this._store.commit("toggleRinging", params);
// if (params){
// setTimeout(this._store.commit, 4000, "toggleRinging", false);
// }
break;
case "isVoteHistoryAllowed": case "isVoteHistoryAllowed":
if (!this._isSpectator) return; if (!this._isSpectator) return;
this._store.commit("session/setVoteHistoryAllowed", params); this._store.commit("session/setVoteHistoryAllowed", params);
@ -277,6 +284,7 @@ class LiveSession {
this._sendDirect(playerId, "gs", { this._sendDirect(playerId, "gs", {
gamestate: this._gamestate, gamestate: this._gamestate,
isNight: grimoire.isNight, isNight: grimoire.isNight,
isRinging: grimoire.isRinging,
isVoteHistoryAllowed: session.isVoteHistoryAllowed, isVoteHistoryAllowed: session.isVoteHistoryAllowed,
nomination: session.nomination, nomination: session.nomination,
votingSpeed: session.votingSpeed, votingSpeed: session.votingSpeed,
@ -301,6 +309,7 @@ class LiveSession {
isLightweight, isLightweight,
isNight, isNight,
isVoteHistoryAllowed, isVoteHistoryAllowed,
isRinging,
nomination, nomination,
votingSpeed, votingSpeed,
votes, votes,
@ -352,6 +361,7 @@ class LiveSession {
} }
}); });
if (!isLightweight) { if (!isLightweight) {
this._store.commit("toggleRinging", !!isRinging);
this._store.commit("toggleNight", !!isNight); this._store.commit("toggleNight", !!isNight);
this._store.commit("session/setVoteHistoryAllowed", isVoteHistoryAllowed); this._store.commit("session/setVoteHistoryAllowed", isVoteHistoryAllowed);
this._store.commit("session/nomination", { this._store.commit("session/nomination", {
@ -703,6 +713,14 @@ class LiveSession {
this._send("isNight", this._store.state.grimoire.isNight); this._send("isNight", this._store.state.grimoire.isNight);
} }
/**
* Send the isRinging status. ST only
*/
setIsRinging() {
if (this._isSpectator) return;
this._send("isRinging", this._store.state.grimoire.isRinging);
}
/** /**
* Send the isVoteHistoryAllowed state. ST only * Send the isVoteHistoryAllowed state. ST only
*/ */
@ -884,6 +902,9 @@ export default store => {
case "toggleNight": case "toggleNight":
session.setIsNight(); session.setIsNight();
break; break;
case "toggleRinging":
session.setIsRinging();
break;
case "setEdition": case "setEdition":
session.sendEdition(); session.sendEdition();
break; break;