add dismiss button

This commit is contained in:
nicfreeman1209 2021-05-11 17:58:41 +01:00
parent ef8aef2d2a
commit 4cc4f908d8
2 changed files with 38 additions and 31 deletions

View file

@ -23,9 +23,12 @@
></Player> ></Player>
</ul> </ul>
<div class="st-reveal" v-if="session.revealedGrimoire !== null"> <div class="button-group st-reveal" v-if="session.revealedGrimoire !== null">
<div class="button" v-if="players.length" @click="applyRevealedGrimoire"> <div class="button" @click="applyRevealedGrimoire">
Reveal storyteller grimoire? Reveal grimoire
</div>
<div class="button" @click="dismissRevealedGrimoire">
Dismiss
</div> </div>
</div> </div>
<div <div
@ -259,6 +262,9 @@ export default {
}, },
applyRevealedGrimoire() { applyRevealedGrimoire() {
this.$store.commit("updateGameState", this.session.revealedGrimoire); this.$store.commit("updateGameState", this.session.revealedGrimoire);
},
dismissRevealedGrimoire() {
this.$store.commit("session/setRevealedGrimoire", null);
} }
} }
}; };
@ -652,7 +658,8 @@ export default {
.st-reveal { .st-reveal {
position: absolute; position: absolute;
margin: 0 auto; margin: 0 auto;
bottom: 30%; bottom: 35%;
z-index: 10;
} }
#townsquare:not(.spectator) .fabled ul li:hover .token:before { #townsquare:not(.spectator) .fabled ul li:hover .token:before {

View file

@ -306,35 +306,35 @@ export default new Vuex.Store({
}); });
} }
}); });
if (!isLightweight) { if (isLightweight) return;
this.commit("toggleNight", !!isNight); // townsquare
this.commit("session/setVoteHistoryAllowed", isVoteHistoryAllowed); this.commit("toggleNight", !!isNight);
if (nomination !== -1) { this.commit("session/setVoteHistoryAllowed", isVoteHistoryAllowed);
this.commit("session/nomination", { if (nomination !== -1) {
nomination, this.commit("session/nomination", {
votes, nomination,
votingSpeed, votes,
lockedVote, votingSpeed,
isVoteInProgress lockedVote,
}); isVoteInProgress
}
this.commit("session/setMarkedPlayer", markedPlayer);
this.commit("players/setFabled", {
fabled: fabled.map(f => state.fabled.get(f.id) || f)
}); });
// bluffs }
if (bluffs !== -1) { this.commit("session/setMarkedPlayer", markedPlayer);
bluffs.forEach((bluff, i) => { this.commit("players/setFabled", {
const role = fabled: fabled.map(f => state.fabled.get(f.id) || f)
this.state.roles.get(bluff.roleId) || });
this.getters.rolesJSONbyId.get(bluff.roleId) || // bluffs
{}; if (bluffs !== -1) {
this.commit("players/setBluff", { bluffs.forEach((bluff, i) => {
index: i, const role =
role this.state.roles.get(bluff.roleId) ||
}); this.getters.rolesJSONbyId.get(bluff.roleId) ||
{};
this.commit("players/setBluff", {
index: i,
role
}); });
} });
} }
if (isRevealedGrimoire) { if (isRevealedGrimoire) {
this.commit("session/setRevealedGrimoire", null); this.commit("session/setRevealedGrimoire", null);