From 738d2c42fffcebdab2526e1f02a0ea252ce456a4 Mon Sep 17 00:00:00 2001 From: pingumask Date: Thu, 27 Oct 2022 21:41:57 +0200 Subject: [PATCH] add "Ring bell" for Strory teller --- src/App.vue | 4 ++++ src/components/Menu.vue | 8 ++++++++ src/components/TownInfo.vue | 10 ++++++++++ src/main.js | 2 ++ src/store/index.js | 2 ++ src/store/locale/en/ui.json | 3 ++- src/store/locale/fr/ui.json | 3 ++- src/store/socket.js | 21 +++++++++++++++++++++ 8 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 866d599..7eb2419 100644 --- a/src/App.vue +++ b/src/App.vue @@ -121,6 +121,10 @@ export default { if (this.session.isSpectator) return; this.$refs.menu.toggleNight(); break; + case "b": + if (this.session.isSpectator) return; + this.$refs.menu.toggleRinging(); + break; case "escape": this.$store.commit("toggleModal"); } diff --git a/src/components/Menu.vue b/src/components/Menu.vue index ab7785b..2b16b97 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -58,6 +58,10 @@ [S] +
  • + + [B] +
  • {{ locale.menu.grimoire.order }} @@ -344,6 +348,10 @@ export default { this.$store.commit("session/setMarkedPlayer", -1); } }, + toggleRinging() { + this.$store.commit("toggleRinging", true); + setTimeout(this.$store.commit, 4000, "toggleRinging", false); + }, ...mapMutations([ "toggleGrimoire", "toggleMenu", diff --git a/src/components/TownInfo.vue b/src/components/TownInfo.vue index a9cd6f5..c99a2a3 100644 --- a/src/components/TownInfo.vue +++ b/src/components/TownInfo.vue @@ -67,6 +67,16 @@ Night phase + + + + + +
  • diff --git a/src/main.js b/src/main.js index 039a5cb..5357881 100644 --- a/src/main.js +++ b/src/main.js @@ -8,6 +8,7 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; const faIcons = [ "AddressCard", + "Bell", "BookOpen", "BookDead", "BroadcastTower", @@ -29,6 +30,7 @@ const faIcons = [ "Image", "Link", "MinusCircle", + "Music", "PeopleArrows", "PlusCircle", "Question", diff --git a/src/store/index.js b/src/store/index.js index ad0b610..5694658 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -104,6 +104,7 @@ export default new Vuex.Store({ grimoire: { isNight: false, isNightOrder: true, + isRinging: false, isPublic: true, isMenuOpen: false, isStatic: false, @@ -175,6 +176,7 @@ export default new Vuex.Store({ toggleNightOrder: toggle("isNightOrder"), toggleStatic: toggle("isStatic"), toggleNight: toggle("isNight"), + toggleRinging: toggle("isRinging"), toggleGrimoire: toggle("isPublic"), toggleImageOptIn: toggle("isImageOptIn"), toggleModal({ modals }, name) { diff --git a/src/store/locale/en/ui.json b/src/store/locale/en/ui.json index 9e6ea8b..d8b3fc1 100644 --- a/src/store/locale/en/ui.json +++ b/src/store/locale/en/ui.json @@ -11,7 +11,8 @@ "background": "Background image", "customImages": "Show Custom Images", "animations": "Disable Animations", - "mute": "Mute Sounds" + "mute": "Mute Sounds", + "ringBell": "Ring Bell" }, "session":{ "title":{ diff --git a/src/store/locale/fr/ui.json b/src/store/locale/fr/ui.json index c3830e6..cbab18a 100644 --- a/src/store/locale/fr/ui.json +++ b/src/store/locale/fr/ui.json @@ -11,7 +11,8 @@ "background": "Image de fond", "customImages": "Images Importées", "animations": "Effets réduits", - "mute": "Silencieux" + "mute": "Silencieux", + "ringBell": "Sonner Clocher" }, "session":{ "title":{ diff --git a/src/store/socket.js b/src/store/socket.js index dd6fd5b..5da2c65 100644 --- a/src/store/socket.js +++ b/src/store/socket.js @@ -176,6 +176,13 @@ class LiveSession { if (!this._isSpectator) return; this._store.commit("toggleNight", params); break; + case "isRinging": + if (!this._isSpectator) return; + this._store.commit("toggleRinging", params); + // if (params){ + // setTimeout(this._store.commit, 4000, "toggleRinging", false); + // } + break; case "isVoteHistoryAllowed": if (!this._isSpectator) return; this._store.commit("session/setVoteHistoryAllowed", params); @@ -277,6 +284,7 @@ class LiveSession { this._sendDirect(playerId, "gs", { gamestate: this._gamestate, isNight: grimoire.isNight, + isRinging: grimoire.isRinging, isVoteHistoryAllowed: session.isVoteHistoryAllowed, nomination: session.nomination, votingSpeed: session.votingSpeed, @@ -301,6 +309,7 @@ class LiveSession { isLightweight, isNight, isVoteHistoryAllowed, + isRinging, nomination, votingSpeed, votes, @@ -352,6 +361,7 @@ class LiveSession { } }); if (!isLightweight) { + this._store.commit("toggleRinging", !!isRinging); this._store.commit("toggleNight", !!isNight); this._store.commit("session/setVoteHistoryAllowed", isVoteHistoryAllowed); this._store.commit("session/nomination", { @@ -703,6 +713,14 @@ class LiveSession { 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 */ @@ -884,6 +902,9 @@ export default store => { case "toggleNight": session.setIsNight(); break; + case "toggleRinging": + session.setIsRinging(); + break; case "setEdition": session.sendEdition(); break;