mirror of https://github.com/bra1n/townsquare.git
getting player pronouns to be synced over sockets layer
This commit is contained in:
parent
03731bc887
commit
48eab1fa8c
|
@ -245,6 +245,7 @@ export default {
|
||||||
prompt("Player preffered pronouns", this.player.pronoun) ||
|
prompt("Player preffered pronouns", this.player.pronoun) ||
|
||||||
this.player.pronoun;
|
this.player.pronoun;
|
||||||
this.updatePlayer("pronoun", pronoun, true);
|
this.updatePlayer("pronoun", pronoun, true);
|
||||||
|
this.$emit("trigger", ["updatePlayer", this.player, "pronoun", pronoun]);
|
||||||
},
|
},
|
||||||
toggleStatus() {
|
toggleStatus() {
|
||||||
if (this.grimoire.isPublic) {
|
if (this.grimoire.isPublic) {
|
||||||
|
|
|
@ -222,6 +222,7 @@ class LiveSession {
|
||||||
id: player.id,
|
id: player.id,
|
||||||
isDead: player.isDead,
|
isDead: player.isDead,
|
||||||
isVoteless: player.isVoteless,
|
isVoteless: player.isVoteless,
|
||||||
|
pronoun: player.pronoun,
|
||||||
...(player.role && player.role.team === "traveler"
|
...(player.role && player.role.team === "traveler"
|
||||||
? { roleId: player.role.id }
|
? { roleId: player.role.id }
|
||||||
: {})
|
: {})
|
||||||
|
@ -279,7 +280,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"].forEach(property => {
|
["name", "id", "isDead", "isVoteless", "pronoun"].forEach(property => {
|
||||||
const value = state[property];
|
const value = state[property];
|
||||||
if (player[property] !== value) {
|
if (player[property] !== value) {
|
||||||
this._store.commit("players/update", { player, property, value });
|
this._store.commit("players/update", { player, property, value });
|
||||||
|
|
Loading…
Reference in New Issue