mirror of
				https://github.com/bra1n/townsquare.git
				synced 2025-10-21 16:55:12 +00:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/main' into main
This commit is contained in:
		
						commit
						80cbe7af18
					
				
					 11 changed files with 755 additions and 868 deletions
				
			
		
							
								
								
									
										3
									
								
								.github/workflows/linter.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/linter.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -18,6 +18,9 @@ on:
 | 
				
			||||||
  push:
 | 
					  push:
 | 
				
			||||||
    branches-ignore:
 | 
					    branches-ignore:
 | 
				
			||||||
      - 'gh-pages'
 | 
					      - 'gh-pages'
 | 
				
			||||||
 | 
					  pull_request:
 | 
				
			||||||
 | 
					    # The branches below must be a subset of the branches above
 | 
				
			||||||
 | 
					    branches: [ main ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
###############
 | 
					###############
 | 
				
			||||||
# Set the Job #
 | 
					# Set the Job #
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										21
									
								
								CHANGELOG.md
									
										
									
									
									
								
							
							
						
						
									
										21
									
								
								CHANGELOG.md
									
										
									
									
									
								
							| 
						 | 
					@ -1,10 +1,31 @@
 | 
				
			||||||
# Release Notes
 | 
					# 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
 | 
					## Version 2.1.1
 | 
				
			||||||
- show vote results at the end of a vote
 | 
					- 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
 | 
					- fixed global reminders not showing up anymore when the associated role is assigned to a player
 | 
				
			||||||
- adjusted backend metrics
 | 
					- adjusted backend metrics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Version 2.1.0
 | 
					## Version 2.1.0
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "name": "townsquare",
 | 
					  "name": "townsquare",
 | 
				
			||||||
  "version": "2.1.1",
 | 
					  "version": "2.3.0",
 | 
				
			||||||
  "lockfileVersion": 1,
 | 
					  "lockfileVersion": 1,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "name": "townsquare",
 | 
					  "name": "townsquare",
 | 
				
			||||||
  "version": "2.1.1",
 | 
					  "version": "2.3.0",
 | 
				
			||||||
  "description": "Blood on the Clocktower Town Square",
 | 
					  "description": "Blood on the Clocktower Town Square",
 | 
				
			||||||
  "author": "Steffen Baumgart",
 | 
					  "author": "Steffen Baumgart",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,6 +102,11 @@ export default {
 | 
				
			||||||
          if (this.session.isSpectator) return;
 | 
					          if (this.session.isSpectator) return;
 | 
				
			||||||
          this.$store.commit("toggleModal", "roles");
 | 
					          this.$store.commit("toggleModal", "roles");
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
 | 
					        case "v":
 | 
				
			||||||
 | 
					          if (this.session.voteHistory.length) {
 | 
				
			||||||
 | 
					            this.$store.commit("toggleModal", "voteHistory");
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
        case "escape":
 | 
					        case "escape":
 | 
				
			||||||
          this.$store.commit("toggleModal");
 | 
					          this.$store.commit("toggleModal");
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								src/assets/icons/lycanthrope.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/assets/icons/lycanthrope.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 33 KiB  | 
| 
						 | 
					@ -114,8 +114,7 @@
 | 
				
			||||||
            v-if="session.voteHistory.length"
 | 
					            v-if="session.voteHistory.length"
 | 
				
			||||||
            @click="toggleModal('voteHistory')"
 | 
					            @click="toggleModal('voteHistory')"
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
            Nomination history
 | 
					            Nomination history<em>[V]</em>
 | 
				
			||||||
            <em><font-awesome-icon icon="hand-paper"/></em>
 | 
					 | 
				
			||||||
          </li>
 | 
					          </li>
 | 
				
			||||||
          <li @click="leaveSession" v-if="session.sessionId">
 | 
					          <li @click="leaveSession" v-if="session.sessionId">
 | 
				
			||||||
            Leave Session
 | 
					            Leave Session
 | 
				
			||||||
| 
						 | 
					@ -239,16 +238,9 @@ export default {
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    copySessionUrl() {
 | 
					    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 url = window.location.href.split("#")[0];
 | 
				
			||||||
      const link = url + "#" + this.session.sessionId;
 | 
					      const link = url + "#" + this.session.sessionId;
 | 
				
			||||||
      navigator.clipboard.writeText(link);
 | 
					      navigator.clipboard.writeText(link);
 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    distributeRoles() {
 | 
					    distributeRoles() {
 | 
				
			||||||
      if (this.session.isSpectator) return;
 | 
					      if (this.session.isSpectator) return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -161,11 +161,13 @@ export default {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    voters: function() {
 | 
					    voters: function() {
 | 
				
			||||||
      const nomination = this.session.nomination[1];
 | 
					      const nomination = this.session.nomination[1];
 | 
				
			||||||
      const voters = this.session.votes.map((vote, index) =>
 | 
					      const voters = Array(this.players.length)
 | 
				
			||||||
        vote ? this.players[index].name : ""
 | 
					        .fill("")
 | 
				
			||||||
 | 
					        .map((x, index) =>
 | 
				
			||||||
 | 
					          this.session.votes[index] ? this.players[index].name : ""
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
      const reorder = [
 | 
					      const reorder = [
 | 
				
			||||||
        ...voters.slice(nomination + 1, this.players.length),
 | 
					        ...voters.slice(nomination + 1),
 | 
				
			||||||
        ...voters.slice(0, nomination + 1)
 | 
					        ...voters.slice(0, nomination + 1)
 | 
				
			||||||
      ];
 | 
					      ];
 | 
				
			||||||
      return reorder.slice(0, this.session.lockedVote - 1).filter(n => !!n);
 | 
					      return reorder.slice(0, this.session.lockedVote - 1).filter(n => !!n);
 | 
				
			||||||
| 
						 | 
					@ -178,15 +180,15 @@ export default {
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    countdown() {
 | 
					    countdown() {
 | 
				
			||||||
      this.$store.commit("session/setVoteInProgress", true);
 | 
					 | 
				
			||||||
      this.$store.commit("session/lockVote", 0);
 | 
					      this.$store.commit("session/lockVote", 0);
 | 
				
			||||||
 | 
					      this.$store.commit("session/setVoteInProgress", true);
 | 
				
			||||||
      this.voteTimer = setInterval(() => {
 | 
					      this.voteTimer = setInterval(() => {
 | 
				
			||||||
        this.start();
 | 
					        this.start();
 | 
				
			||||||
      }, 4000);
 | 
					      }, 4000);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    start() {
 | 
					    start() {
 | 
				
			||||||
      this.$store.commit("session/setVoteInProgress", true);
 | 
					 | 
				
			||||||
      this.$store.commit("session/lockVote", 1);
 | 
					      this.$store.commit("session/lockVote", 1);
 | 
				
			||||||
 | 
					      this.$store.commit("session/setVoteInProgress", true);
 | 
				
			||||||
      clearInterval(this.voteTimer);
 | 
					      clearInterval(this.voteTimer);
 | 
				
			||||||
      this.voteTimer = setInterval(() => {
 | 
					      this.voteTimer = setInterval(() => {
 | 
				
			||||||
        this.$store.commit("session/lockVote");
 | 
					        this.$store.commit("session/lockVote");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,14 +54,7 @@ export default {
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    copy: function() {
 | 
					    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() {
 | 
					    load: function() {
 | 
				
			||||||
      if (this.session.isSpectator) return;
 | 
					      if (this.session.isSpectator) return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1549
									
								
								src/roles.json
									
										
									
									
									
								
							
							
						
						
									
										1549
									
								
								src/roles.json
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
					@ -84,6 +84,7 @@ const actions = {
 | 
				
			||||||
        name,
 | 
					        name,
 | 
				
			||||||
        id
 | 
					        id
 | 
				
			||||||
      }));
 | 
					      }));
 | 
				
			||||||
 | 
					      commit("setFabled", { fabled: [] });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    commit("set", players);
 | 
					    commit("set", players);
 | 
				
			||||||
    commit("setBluff");
 | 
					    commit("setBluff");
 | 
				
			||||||
| 
						 | 
					@ -94,6 +95,7 @@ const mutations = {
 | 
				
			||||||
  clear(state) {
 | 
					  clear(state) {
 | 
				
			||||||
    state.players = [];
 | 
					    state.players = [];
 | 
				
			||||||
    state.bluffs = [];
 | 
					    state.bluffs = [];
 | 
				
			||||||
 | 
					    state.fabled = [];
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  set(state, players = []) {
 | 
					  set(state, players = []) {
 | 
				
			||||||
    state.players = players;
 | 
					    state.players = players;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue