mirror of https://github.com/bra1n/townsquare.git
add recordVoteHistory & clearVoteHistory to session menu
This commit is contained in:
parent
3c849942fe
commit
a2fb33eafe
|
@ -60,13 +60,14 @@
|
||||||
</li>
|
</li>
|
||||||
<li @click="toggleNightOrder" v-if="players.length">
|
<li @click="toggleNightOrder" v-if="players.length">
|
||||||
Night order
|
Night order
|
||||||
<em
|
<em>
|
||||||
><font-awesome-icon
|
<font-awesome-icon
|
||||||
:icon="[
|
:icon="[
|
||||||
'fas',
|
'fas',
|
||||||
grimoire.isNightOrder ? 'check-square' : 'square'
|
grimoire.isNightOrder ? 'check-square' : 'square'
|
||||||
]"
|
]"
|
||||||
/></em>
|
/>
|
||||||
|
</em>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="players.length">
|
<li v-if="players.length">
|
||||||
Zoom
|
Zoom
|
||||||
|
@ -134,7 +135,22 @@
|
||||||
v-if="session.voteHistory.length"
|
v-if="session.voteHistory.length"
|
||||||
@click="toggleModal('voteHistory')"
|
@click="toggleModal('voteHistory')"
|
||||||
>
|
>
|
||||||
Nomination history<em>[V]</em>
|
Vote history<em>[V]</em>
|
||||||
|
</li>
|
||||||
|
<li @click="toggleRecordVoteHistory" v-if="!session.isSpectator">
|
||||||
|
Record vote history
|
||||||
|
<em>
|
||||||
|
<font-awesome-icon
|
||||||
|
:icon="[
|
||||||
|
'fas',
|
||||||
|
session.recordVoteHistory ? 'check-square' : 'square'
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</em>
|
||||||
|
</li>
|
||||||
|
<li @click="clearVoteHistory" v-if="!session.isSpectator">
|
||||||
|
Clear vote history
|
||||||
|
<em><font-awesome-icon icon="trash-alt"/></em>
|
||||||
</li>
|
</li>
|
||||||
<li @click="leaveSession">
|
<li @click="leaveSession">
|
||||||
Leave Session
|
Leave Session
|
||||||
|
@ -327,6 +343,12 @@ export default {
|
||||||
this.$store.dispatch("players/clearRoles");
|
this.$store.dispatch("players/clearRoles");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggleRecordVoteHistory() {
|
||||||
|
this.$store.commit("session/toggleRecordVoteHistory");
|
||||||
|
},
|
||||||
|
clearVoteHistory() {
|
||||||
|
this.$store.commit("session/clearVoteHistory");
|
||||||
|
},
|
||||||
...mapMutations([
|
...mapMutations([
|
||||||
"toggleGrimoire",
|
"toggleGrimoire",
|
||||||
"toggleMenu",
|
"toggleMenu",
|
||||||
|
|
|
@ -220,7 +220,9 @@ export default {
|
||||||
},
|
},
|
||||||
finish() {
|
finish() {
|
||||||
clearInterval(this.voteTimer);
|
clearInterval(this.voteTimer);
|
||||||
|
if (this.session.recordVoteHistory) {
|
||||||
this.$store.commit("session/addHistory", this.players);
|
this.$store.commit("session/addHistory", this.players);
|
||||||
|
}
|
||||||
this.$store.commit("session/nomination");
|
this.$store.commit("session/nomination");
|
||||||
},
|
},
|
||||||
vote(vote) {
|
vote(vote) {
|
||||||
|
|
|
@ -22,9 +22,10 @@ const state = () => ({
|
||||||
nomination: false,
|
nomination: false,
|
||||||
votes: [],
|
votes: [],
|
||||||
lockedVote: 0,
|
lockedVote: 0,
|
||||||
votingSpeed: 3000,
|
votingSpeed: 1000,
|
||||||
isVoteInProgress: false,
|
isVoteInProgress: false,
|
||||||
voteHistory: [],
|
voteHistory: [],
|
||||||
|
recordVoteHistory: true,
|
||||||
isRolesDistributed: false
|
isRolesDistributed: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -88,6 +89,9 @@ const mutations = {
|
||||||
clearVoteHistory(state) {
|
clearVoteHistory(state) {
|
||||||
state.voteHistory = [];
|
state.voteHistory = [];
|
||||||
},
|
},
|
||||||
|
toggleRecordVoteHistory(state) {
|
||||||
|
state.recordVoteHistory = !state.recordVoteHistory;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Store a vote with and without syncing it to the live session.
|
* Store a vote with and without syncing it to the live session.
|
||||||
* This is necessary in order to prevent infinite voting loops.
|
* This is necessary in order to prevent infinite voting loops.
|
||||||
|
|
Loading…
Reference in New Issue