Merge pull request #4 from bra1n/main

merge upstream
This commit is contained in:
Dave 2021-01-27 22:14:41 +00:00 committed by GitHub
commit 7c3908f1fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 50 deletions

View File

@ -1,5 +1,11 @@
# Release Notes # Release Notes
## Version 2.6.0
- night mode can be toggeled with [S] now (thanks @davotronic5000)
- night order shows which players are dead
---
## Version 2.5.0 ## Version 2.5.0
- all travelers from the base editions are now optionally available (thanks @davotronic5000) - all travelers from the base editions are now optionally available (thanks @davotronic5000)
- night order shows player names near roles now - night order shows player names near roles now

2
package-lock.json generated
View File

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

View File

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

View File

@ -107,6 +107,10 @@ export default {
this.$store.commit("toggleModal", "voteHistory"); this.$store.commit("toggleModal", "voteHistory");
} }
break; break;
case "s":
if (this.session.isSpectator) return;
this.$store.commit("toggleNight");
break;
case "escape": case "escape":
this.$store.commit("toggleModal"); this.$store.commit("toggleModal");
} }

View File

@ -43,10 +43,7 @@
<li @click="toggleNight" v-if="!session.isSpectator"> <li @click="toggleNight" v-if="!session.isSpectator">
<template v-if="!grimoire.isNight">Switch to Night</template> <template v-if="!grimoire.isNight">Switch to Night</template>
<template v-if="grimoire.isNight">Switch to Day</template> <template v-if="grimoire.isNight">Switch to Day</template>
<em <em>[S]</em>
><font-awesome-icon
:icon="['fas', grimoire.isNight ? 'sun' : 'cloud-moon']"
/></em>
</li> </li>
<li @click="toggleNightOrder" v-if="players.length"> <li @click="toggleNightOrder" v-if="players.length">
Night order Night order

View File

@ -24,13 +24,18 @@
:class="[role.team]" :class="[role.team]"
> >
<span class="name"> <span class="name">
{{ role.name }}<br /> {{ role.name }}
<small>{{ <template v-if="role.players.length">
players <br />
.filter(p => p.role.id === role.id) <small
.map(p => p.name) v-for="(player, index) in role.players"
.join(", ") :class="{ dead: player.isDead }"
}}</small> :key="index"
>{{
player.name + (role.players.length > index + 1 ? "," : "")
}}</small
>
</template>
</span> </span>
<span <span
class="icon" class="icon"
@ -58,13 +63,18 @@
}" }"
></span> ></span>
<span class="name"> <span class="name">
{{ role.name }}<br /> {{ role.name }}
<small>{{ <template v-if="role.players.length">
players <br />
.filter(p => p.role.id === role.id) <small
.map(p => p.name) v-for="(player, index) in role.players"
.join(", ") :class="{ dead: player.isDead }"
}}</small> :key="index"
>{{
player.name + (role.players.length > index + 1 ? "," : "")
}}</small
>
</template>
</span> </span>
</li> </li>
</ul> </ul>
@ -80,11 +90,6 @@ export default {
components: { components: {
Modal Modal
}, },
data: function() {
return {
roleSelection: {}
};
},
computed: { computed: {
rolesFirstNight: function() { rolesFirstNight: function() {
const rolesFirstNight = []; const rolesFirstNight = [];
@ -95,23 +100,22 @@ export default {
id: "evil", id: "evil",
name: "Minion info", name: "Minion info",
firstNight: 2, firstNight: 2,
team: "minion" team: "minion",
players: this.players.filter(p => p.role.team === "minion")
}, },
{ {
id: "evil", id: "evil",
name: "Demon info & bluffs", name: "Demon info & bluffs",
firstNight: 4, firstNight: 4,
team: "demon" team: "demon",
players: this.players.filter(p => p.role.team === "demon")
} }
); );
} }
this.roles.forEach(role => { this.roles.forEach(role => {
if ( const players = this.players.filter(p => p.role.id === role.id);
role.firstNight && if (role.firstNight && (role.team !== "traveler" || players.length)) {
(role.team !== "traveler" || rolesFirstNight.push(Object.assign({ players }, role));
this.players.some(p => p.role.id === role.id))
) {
rolesFirstNight.push(role);
} }
}); });
this.fabled this.fabled
@ -125,12 +129,9 @@ export default {
rolesOtherNight: function() { rolesOtherNight: function() {
const rolesOtherNight = []; const rolesOtherNight = [];
this.roles.forEach(role => { this.roles.forEach(role => {
if ( const players = this.players.filter(p => p.role.id === role.id);
role.otherNight && if (role.otherNight && (role.team !== "traveler" || players.length)) {
(role.team !== "traveler" || rolesOtherNight.push(Object.assign({ players }, role));
this.players.some(p => p.role.id === role.id))
) {
rolesOtherNight.push(role);
} }
}); });
this.fabled this.fabled
@ -260,6 +261,10 @@ ul {
border-right: 1px solid rgba(255, 255, 255, 0.4); border-right: 1px solid rgba(255, 255, 255, 0.4);
small { small {
color: #888; color: #888;
margin-right: 5px;
&.dead {
text-decoration: line-through;
}
} }
} }
} }

View File

@ -56,11 +56,6 @@ export default {
components: { components: {
Modal Modal
}, },
data: function() {
return {
roleSelection: {}
};
},
computed: { computed: {
rolesGrouped: function() { rolesGrouped: function() {
const rolesGrouped = {}; const rolesGrouped = {};
@ -136,7 +131,6 @@ h4 {
.townsfolk { .townsfolk {
.name, .name,
.player,
h4 { h4 {
color: $townsfolk; color: $townsfolk;
&:before, &:before,
@ -147,7 +141,6 @@ h4 {
} }
.outsider { .outsider {
.name, .name,
.player,
h4 { h4 {
color: $outsider; color: $outsider;
&:before, &:before,
@ -158,7 +151,6 @@ h4 {
} }
.minion { .minion {
.name, .name,
.player,
h4 { h4 {
color: $minion; color: $minion;
&:before, &:before,
@ -169,7 +161,6 @@ h4 {
} }
.demon { .demon {
.name, .name,
.player,
h4 { h4 {
color: $demon; color: $demon;
&:before, &:before,
@ -208,7 +199,6 @@ ul {
width: 15%; width: 15%;
font-weight: bold; font-weight: bold;
text-align: right; text-align: right;
font-family: "Papyrus", sans-serif;
font-size: 110%; font-size: 110%;
} }
.player { .player {
@ -216,6 +206,8 @@ ul {
flex-shrink: 1; flex-shrink: 1;
text-align: right; text-align: right;
margin: 0 10px; margin: 0 10px;
color: #888;
font-size: smaller;
} }
.ability { .ability {
flex-grow: 1; flex-grow: 1;
@ -230,6 +222,7 @@ ul {
height: auto; height: auto;
font-family: inherit; font-family: inherit;
font-size: inherit; font-size: inherit;
color: #fff;
} }
.icon:after { .icon:after {
padding-top: 0; padding-top: 0;

View File

@ -34,7 +34,6 @@ const faIcons = [
"SearchMinus", "SearchMinus",
"SearchPlus", "SearchPlus",
"Square", "Square",
"Sun",
"TheaterMasks", "TheaterMasks",
"Times", "Times",
"TimesCircle", "TimesCircle",