1
0
forked from noxious/client

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:
Dennis Postma 2024-09-15 02:36:24 +02:00
parent 6e6c6f9b9e
commit 4be606778c
3 changed files with 5 additions and 5 deletions

6
package-lock.json generated
View File

@ -1108,9 +1108,9 @@
} }
}, },
"node_modules/@eslint-community/regexpp": { "node_modules/@eslint-community/regexpp": {
"version": "4.11.0", "version": "4.11.1",
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz",
"integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {

View File

@ -59,6 +59,7 @@ watch(
onBeforeMount(() => {}) onBeforeMount(() => {})
onBeforeUnmount(() => { onBeforeUnmount(() => {
zoneStore.reset()
gameStore.connection?.off('zone:teleport') gameStore.connection?.off('zone:teleport')
gameStore.connection?.off('zone:character:join') gameStore.connection?.off('zone:character:join')
gameStore.connection?.off('zone:character:leave') gameStore.connection?.off('zone:character:leave')

View File

@ -8,8 +8,6 @@ type TeleportSettings = {
toPositionY: number toPositionY: number
} }
const gameStore = useGameStore()
export const useZoneEditorStore = defineStore('zoneEditor', { export const useZoneEditorStore = defineStore('zoneEditor', {
state: () => ({ state: () => ({
active: false, active: false,
@ -43,6 +41,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
}), }),
actions: { actions: {
toggleActive() { toggleActive() {
const gameStore = useGameStore()
if (!this.active) gameStore.connection?.emit('zone:character:leave') if (!this.active) gameStore.connection?.emit('zone:character:leave')
if (this.active) this.reset() if (this.active) this.reset()
this.active = !this.active this.active = !this.active