diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9fc86f1..0700c8d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,6 @@
# Release Notes
-### Version 2.13.0
+- added record vote history toggle to session menu, and clear vote history button
- add support for custom Fabled characters
---
diff --git a/src/App.vue b/src/App.vue
index bb5bc65..7f17766 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -110,7 +110,7 @@ export default {
this.$store.commit("toggleModal", "roles");
break;
case "v":
- if (this.session.voteHistory.length) {
+ if (this.session.voteHistory.length || !this.session.isSpectator) {
this.$store.commit("toggleModal", "voteHistory");
}
break;
diff --git a/src/components/Menu.vue b/src/components/Menu.vue
index 40abc72..bf792a1 100644
--- a/src/components/Menu.vue
+++ b/src/components/Menu.vue
@@ -60,13 +60,14 @@
Night order
-
+
+ />
+
Zoom
@@ -131,10 +132,10 @@
- Nomination history[V]
+ Vote history[V]
Leave Session
diff --git a/src/components/modals/Modal.vue b/src/components/modals/Modal.vue
index fe08b13..d1bd5e6 100644
--- a/src/components/modals/Modal.vue
+++ b/src/components/modals/Modal.vue
@@ -115,6 +115,7 @@ export default {
.maximized {
background: rgba(0, 0, 0, 0.95);
padding: 0;
+ border-radius: 0;
height: 100%;
width: 100%;
max-width: 100%;
diff --git a/src/components/modals/VoteHistoryModal.vue b/src/components/modals/VoteHistoryModal.vue
index 95eeaa8..882da50 100644
--- a/src/components/modals/VoteHistoryModal.vue
+++ b/src/components/modals/VoteHistoryModal.vue
@@ -1,17 +1,36 @@
- Nomination history
+ Vote history
+
+
+
+
+
+ Accessible to players
+
+
+
+ Clear for everyone
+
+
+
@@ -79,8 +98,16 @@ export default {
...mapState(["session", "modals"])
},
methods: {
- ...mapMutations(["toggleModal"]),
- ...mapMutations("session", ["clearVoteHistory"])
+ clearVoteHistory() {
+ this.$store.commit("session/clearVoteHistory");
+ },
+ setRecordVoteHistory() {
+ this.$store.commit(
+ "session/setVoteHistoryAllowed",
+ !this.session.isVoteHistoryAllowed
+ );
+ },
+ ...mapMutations(["toggleModal"])
}
};
@@ -98,6 +125,24 @@ export default {
}
}
+.options {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ justify-content: center;
+ align-content: center;
+}
+
+.option {
+ color: white;
+ text-decoration: none;
+ margin: 0 15px;
+ &:hover {
+ color: red;
+ cursor: pointer;
+ }
+}
+
h3 {
margin: 0 40px 0 10px;
svg {
diff --git a/src/store/modules/session.js b/src/store/modules/session.js
index 80d4aaf..ad27959 100644
--- a/src/store/modules/session.js
+++ b/src/store/modules/session.js
@@ -25,6 +25,7 @@ const state = () => ({
votingSpeed: 3000,
isVoteInProgress: false,
voteHistory: [],
+ isVoteHistoryAllowed: true,
isRolesDistributed: false
});
@@ -45,6 +46,7 @@ const mutations = {
setPing: set("ping"),
setVotingSpeed: set("votingSpeed"),
setVoteInProgress: set("isVoteInProgress"),
+ setVoteHistoryAllowed: set("isVoteHistoryAllowed"),
claimSeat: set("claimedSeat"),
distributeRoles: set("isRolesDistributed"),
setSessionId(state, sessionId) {
@@ -70,6 +72,7 @@ const mutations = {
* @param players
*/
addHistory(state, players) {
+ if (!state.isVoteHistoryAllowed && state.isSpectator) return;
if (!state.nomination || state.lockedVote <= players.length) return;
const isBanishment = players[state.nomination[1]].role.team === "traveler";
state.voteHistory.push({
diff --git a/src/store/socket.js b/src/store/socket.js
index 1537fcc..86cd610 100644
--- a/src/store/socket.js
+++ b/src/store/socket.js
@@ -172,6 +172,11 @@ class LiveSession {
if (!this._isSpectator) return;
this._store.commit("toggleNight", params);
break;
+ case "isVoteHistoryAllowed":
+ if (!this._isSpectator) return;
+ this._store.commit("session/setVoteHistoryAllowed", params);
+ this._store.commit("session/clearVoteHistory");
+ break;
case "votingSpeed":
if (!this._isSpectator) return;
this._store.commit("session/setVotingSpeed", params);
@@ -268,6 +273,7 @@ class LiveSession {
this._sendDirect(playerId, "gs", {
gamestate: this._gamestate,
isNight: grimoire.isNight,
+ isVoteHistoryAllowed: session.isVoteHistoryAllowed,
nomination: session.nomination,
votingSpeed: session.votingSpeed,
lockedVote: session.lockedVote,
@@ -289,6 +295,7 @@ class LiveSession {
gamestate,
isLightweight,
isNight,
+ isVoteHistoryAllowed,
nomination,
votingSpeed,
votes,
@@ -340,6 +347,7 @@ class LiveSession {
});
if (!isLightweight) {
this._store.commit("toggleNight", !!isNight);
+ this._store.commit("session/setVoteHistoryAllowed", isVoteHistoryAllowed);
this._store.commit("session/nomination", {
nomination,
votes,
@@ -686,6 +694,17 @@ class LiveSession {
this._send("isNight", this._store.state.grimoire.isNight);
}
+ /**
+ * Send the isVoteHistoryAllowed state. ST only
+ */
+ setVoteHistoryAllowed() {
+ if (this._isSpectator) return;
+ this._send(
+ "isVoteHistoryAllowed",
+ this._store.state.session.isVoteHistoryAllowed
+ );
+ }
+
/**
* Send the voting speed. ST only
* @param votingSpeed voting speed in seconds, minimum 1
@@ -840,6 +859,9 @@ export default store => {
case "session/clearVoteHistory":
session.clearVoteHistory();
break;
+ case "session/setVoteHistoryAllowed":
+ session.setVoteHistoryAllowed();
+ break;
case "toggleNight":
session.setIsNight();
break;