Merge remote-tracking branch 'upstream/main' into main

This commit is contained in:
Jul Gvoz 2021-01-09 16:01:54 +02:00
commit 80cbe7af18
11 changed files with 755 additions and 868 deletions

View File

@ -18,6 +18,9 @@ on:
push:
branches-ignore:
- 'gh-pages'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
###############
# Set the Job #

View File

@ -1,10 +1,31 @@
# Release Notes
## Version 2.3.0
- added spoiler role (Lycanthrope!)
- fixed copy to clipboard in Firefox
- fixed non-countdown votes still playing countdown sound for a split second
---
## Version 2.2.1
- clearing players / roles now also clears Fabled (closes #85)
- fix list of locked votes showing unlocked votes sometimes
---
## Version 2.2.0
- added [V] hotkey to open nomination history (thanks @lilserf)
- updated roles according to official Wiki changes
- adjusted roles night order
---
## Version 2.1.1
- show vote results at the end of a vote
- fixed global reminders not showing up anymore when the associated role is assigned to a player
- adjusted backend metrics
---
## Version 2.1.0

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "townsquare",
"version": "2.1.1",
"version": "2.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "townsquare",
"version": "2.1.1",
"version": "2.3.0",
"description": "Blood on the Clocktower Town Square",
"author": "Steffen Baumgart",
"scripts": {

View File

@ -102,6 +102,11 @@ export default {
if (this.session.isSpectator) return;
this.$store.commit("toggleModal", "roles");
break;
case "v":
if (this.session.voteHistory.length) {
this.$store.commit("toggleModal", "voteHistory");
}
break;
case "escape":
this.$store.commit("toggleModal");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -114,8 +114,7 @@
v-if="session.voteHistory.length"
@click="toggleModal('voteHistory')"
>
Nomination history
<em><font-awesome-icon icon="hand-paper"/></em>
Nomination history<em>[V]</em>
</li>
<li @click="leaveSession" v-if="session.sessionId">
Leave Session
@ -239,16 +238,9 @@ export default {
}
},
copySessionUrl() {
// check for clipboard permissions
navigator.permissions
.query({ name: "clipboard-write" })
.then(({ state }) => {
if (state === "granted" || state === "prompt") {
const url = window.location.href.split("#")[0];
const link = url + "#" + this.session.sessionId;
navigator.clipboard.writeText(link);
}
});
const url = window.location.href.split("#")[0];
const link = url + "#" + this.session.sessionId;
navigator.clipboard.writeText(link);
},
distributeRoles() {
if (this.session.isSpectator) return;

View File

@ -161,11 +161,13 @@ export default {
},
voters: function() {
const nomination = this.session.nomination[1];
const voters = this.session.votes.map((vote, index) =>
vote ? this.players[index].name : ""
);
const voters = Array(this.players.length)
.fill("")
.map((x, index) =>
this.session.votes[index] ? this.players[index].name : ""
);
const reorder = [
...voters.slice(nomination + 1, this.players.length),
...voters.slice(nomination + 1),
...voters.slice(0, nomination + 1)
];
return reorder.slice(0, this.session.lockedVote - 1).filter(n => !!n);
@ -178,15 +180,15 @@ export default {
},
methods: {
countdown() {
this.$store.commit("session/setVoteInProgress", true);
this.$store.commit("session/lockVote", 0);
this.$store.commit("session/setVoteInProgress", true);
this.voteTimer = setInterval(() => {
this.start();
}, 4000);
},
start() {
this.$store.commit("session/setVoteInProgress", true);
this.$store.commit("session/lockVote", 1);
this.$store.commit("session/setVoteInProgress", true);
clearInterval(this.voteTimer);
this.voteTimer = setInterval(() => {
this.$store.commit("session/lockVote");

View File

@ -54,14 +54,7 @@ export default {
},
methods: {
copy: function() {
// check for clipboard permissions
navigator.permissions
.query({ name: "clipboard-write" })
.then(({ state }) => {
if (state === "granted" || state === "prompt") {
navigator.clipboard.writeText(this.input || this.gamestate);
}
});
navigator.clipboard.writeText(this.input || this.gamestate);
},
load: function() {
if (this.session.isSpectator) return;

File diff suppressed because it is too large Load Diff

View File

@ -84,6 +84,7 @@ const actions = {
name,
id
}));
commit("setFabled", { fabled: [] });
}
commit("set", players);
commit("setBluff");
@ -94,6 +95,7 @@ const mutations = {
clear(state) {
state.players = [];
state.bluffs = [];
state.fabled = [];
},
set(state, players = []) {
state.players = players;