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

View file

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