on block -> marked

This commit is contained in:
nicfreeman1209 2021-05-05 15:20:37 +01:00
parent 8dacfea0cb
commit 205bd0ba79
6 changed files with 27 additions and 27 deletions

View File

@ -330,7 +330,7 @@ export default {
toggleNight() { toggleNight() {
this.$store.commit("toggleNight"); this.$store.commit("toggleNight");
if (this.grimoire.isNight) { if (this.grimoire.isNight) {
this.$store.commit("players/setOnBlock", -1); this.$store.commit("players/setMarked", -1);
} }
}, },
...mapMutations([ ...mapMutations([

View File

@ -101,7 +101,7 @@
<!-- On block icon --> <!-- On block icon -->
<font-awesome-icon <font-awesome-icon
icon="skull" icon="skull"
v-if="player.isOnBlock" v-if="player.isMarked"
class="on-block" class="on-block"
/> />
@ -267,8 +267,8 @@ export default {
if (this.grimoire.isPublic) { if (this.grimoire.isPublic) {
if (!this.player.isDead) { if (!this.player.isDead) {
this.updatePlayer("isDead", true); this.updatePlayer("isDead", true);
if (this.player.isOnBlock) { if (this.player.isMarked) {
this.updatePlayer("isOnBlock", false); this.updatePlayer("isMarked", false);
} }
} else if (this.player.isVoteless) { } else if (this.player.isVoteless) {
this.updatePlayer("isVoteless", false); this.updatePlayer("isVoteless", false);
@ -278,8 +278,8 @@ export default {
} }
} else { } else {
this.updatePlayer("isDead", !this.player.isDead); this.updatePlayer("isDead", !this.player.isDead);
if (this.player.isOnBlock) { if (this.player.isMarked) {
this.updatePlayer("isOnBlock", false); this.updatePlayer("isMarked", false);
} }
if (this.player.isVoteless) { if (this.player.isVoteless) {
this.updatePlayer("isVoteless", false); this.updatePlayer("isVoteless", false);

View File

@ -203,10 +203,10 @@ export default {
this.nominate = -1; this.nominate = -1;
}, },
toggleOnBlock(playerIndex) { toggleOnBlock(playerIndex) {
if (this.players[playerIndex].isOnBlock) { if (this.players[playerIndex].isMarked) {
this.$store.commit("players/setOnBlock", -1); this.$store.commit("players/setMarked", -1);
} else { } else {
this.$store.commit("players/setOnBlock", playerIndex); this.$store.commit("players/setMarked", playerIndex);
} }
} }
} }

View File

@ -67,11 +67,11 @@
class="button-group" class="button-group"
v-if="session.lockedVote && !session.isVoteInProgress" v-if="session.lockedVote && !session.isVoteInProgress"
> >
<div class="button demon" @click="setOnBlock"> <div class="button demon" @click="setMarked">
Put on block Mark nominee
</div> </div>
<div class="button demon" @click="emptyBlock"> <div class="button demon" @click="removeMarked">
Empty block Clear mark
</div> </div>
</div> </div>
</template> </template>
@ -249,12 +249,12 @@ export default {
this.$store.commit("session/setVotingSpeed", speed); this.$store.commit("session/setVotingSpeed", speed);
} }
}, },
setOnBlock() { setMarked() {
this.$store.commit("players/setOnBlock", this.session.nomination[1]); this.$store.commit("players/setMarked", this.session.nomination[1]);
this.finish(); this.finish();
}, },
emptyBlock() { removeMarked() {
this.$store.commit("players/setOnBlock", -1); this.$store.commit("players/setMarked", -1);
this.finish(); this.finish();
} }
} }

View File

@ -5,7 +5,7 @@ const NEWPLAYER = {
reminders: [], reminders: [],
isVoteless: false, isVoteless: false,
isDead: false, isDead: false,
isOnBlock: false, isMarked: false,
pronouns: "" pronouns: ""
}; };
@ -137,12 +137,12 @@ const mutations = {
move(state, [from, to]) { move(state, [from, to]) {
state.players.splice(to, 0, state.players.splice(from, 1)[0]); state.players.splice(to, 0, state.players.splice(from, 1)[0]);
}, },
setOnBlock(state, playerIndex) { setMarked(state, playerIndex) {
state.players.forEach(player => { state.players.forEach(player => {
player.isOnBlock = false; player.isMarked = false;
}); });
if (playerIndex >= 0) { if (playerIndex >= 0) {
state.players[playerIndex].isOnBlock = true; state.players[playerIndex].isMarked = true;
} }
}, },
setBluff(state, { index, role } = {}) { setBluff(state, { index, role } = {}) {

View File

@ -170,7 +170,7 @@ class LiveSession {
break; break;
case "onBlock": case "onBlock":
if (!this._isSpectator) return; if (!this._isSpectator) return;
this._store.commit("players/setOnBlock", params); this._store.commit("players/setMarked", params);
break; break;
case "isNight": case "isNight":
if (!this._isSpectator) return; if (!this._isSpectator) return;
@ -255,7 +255,7 @@ class LiveSession {
id: player.id, id: player.id,
isDead: player.isDead, isDead: player.isDead,
isVoteless: player.isVoteless, isVoteless: player.isVoteless,
isOnBlock: player.isOnBlock, isMarked: player.isMarked,
pronouns: player.pronouns, pronouns: player.pronouns,
...(player.role && player.role.team === "traveler" ...(player.role && player.role.team === "traveler"
? { roleId: player.role.id } ? { roleId: player.role.id }
@ -317,7 +317,7 @@ class LiveSession {
const player = players[x]; const player = players[x];
const { roleId } = state; const { roleId } = state;
// update relevant properties // update relevant properties
["name", "id", "isDead", "isVoteless", "isOnBlock", "pronouns"].forEach( ["name", "id", "isDead", "isVoteless", "isMarked", "pronouns"].forEach(
property => { property => {
const value = state[property]; const value = state[property];
if (player[property] !== value) { if (player[property] !== value) {
@ -708,7 +708,7 @@ class LiveSession {
* Set which player is on the block. ST only * Set which player is on the block. ST only
* @param id, player id or -1 for empty * @param id, player id or -1 for empty
*/ */
setOnBlock(playerIndex) { setMarked(playerIndex) {
if (this._isSpectator) return; if (this._isSpectator) return;
this._send("onBlock", playerIndex); this._send("onBlock", playerIndex);
} }
@ -865,8 +865,8 @@ export default store => {
case "players/setFabled": case "players/setFabled":
session.sendFabled(); session.sendFabled();
break; break;
case "players/setOnBlock": case "players/setMarked":
session.setOnBlock(payload); session.setMarked(payload);
break; break;
case "players/swap": case "players/swap":
session.swapPlayer(payload); session.swapPlayer(payload);