Bug fix for zoneEditor store, #109 : When zone tiles are updated and you switch back to the game, these aren't instantly visible, npm update
This commit is contained in:
parent
6e6c6f9b9e
commit
4be606778c
6
package-lock.json
generated
6
package-lock.json
generated
@ -1108,9 +1108,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint-community/regexpp": {
|
||||
"version": "4.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz",
|
||||
"integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==",
|
||||
"version": "4.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz",
|
||||
"integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
|
@ -59,6 +59,7 @@ watch(
|
||||
onBeforeMount(() => {})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
zoneStore.reset()
|
||||
gameStore.connection?.off('zone:teleport')
|
||||
gameStore.connection?.off('zone:character:join')
|
||||
gameStore.connection?.off('zone:character:leave')
|
||||
|
@ -8,8 +8,6 @@ type TeleportSettings = {
|
||||
toPositionY: number
|
||||
}
|
||||
|
||||
const gameStore = useGameStore()
|
||||
|
||||
export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
state: () => ({
|
||||
active: false,
|
||||
@ -43,6 +41,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
}),
|
||||
actions: {
|
||||
toggleActive() {
|
||||
const gameStore = useGameStore()
|
||||
if (!this.active) gameStore.connection?.emit('zone:character:leave')
|
||||
if (this.active) this.reset()
|
||||
this.active = !this.active
|
||||
|
Loading…
x
Reference in New Issue
Block a user