mirror of https://github.com/bra1n/townsquare.git
move block/night logic from socket to menu
This commit is contained in:
parent
946bafec5b
commit
8dacfea0cb
|
@ -116,7 +116,7 @@ export default {
|
||||||
break;
|
break;
|
||||||
case "s":
|
case "s":
|
||||||
if (this.session.isSpectator) return;
|
if (this.session.isSpectator) return;
|
||||||
this.$store.commit("toggleNight");
|
this.$refs.menu.toggleNight();
|
||||||
break;
|
break;
|
||||||
case "escape":
|
case "escape":
|
||||||
this.$store.commit("toggleModal");
|
this.$store.commit("toggleModal");
|
||||||
|
|
|
@ -327,12 +327,17 @@ export default {
|
||||||
this.$store.dispatch("players/clearRoles");
|
this.$store.dispatch("players/clearRoles");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggleNight() {
|
||||||
|
this.$store.commit("toggleNight");
|
||||||
|
if (this.grimoire.isNight) {
|
||||||
|
this.$store.commit("players/setOnBlock", -1);
|
||||||
|
}
|
||||||
|
},
|
||||||
...mapMutations([
|
...mapMutations([
|
||||||
"toggleGrimoire",
|
"toggleGrimoire",
|
||||||
"toggleMenu",
|
"toggleMenu",
|
||||||
"toggleImageOptIn",
|
"toggleImageOptIn",
|
||||||
"toggleMuted",
|
"toggleMuted",
|
||||||
"toggleNight",
|
|
||||||
"toggleNightOrder",
|
"toggleNightOrder",
|
||||||
"setZoom",
|
"setZoom",
|
||||||
"toggleModal"
|
"toggleModal"
|
||||||
|
|
|
@ -691,9 +691,6 @@ class LiveSession {
|
||||||
setIsNight() {
|
setIsNight() {
|
||||||
if (this._isSpectator) return;
|
if (this._isSpectator) return;
|
||||||
this._send("isNight", this._store.state.grimoire.isNight);
|
this._send("isNight", this._store.state.grimoire.isNight);
|
||||||
if (this._store.state.grimoire.isNight) {
|
|
||||||
this._store.commit("players/setOnBlock", -1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue