1
0
forked from noxious/client

npm update & npm run format

This commit is contained in:
2024-09-10 12:58:30 +02:00
parent c03c71a1b5
commit 5edf197533
17 changed files with 329 additions and 337 deletions

View File

@ -11,7 +11,7 @@ export function usePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilemaps.T
const gameHandlers = useGamePointerHandlers(scene, layer, waypoint, camera, isDragging)
const zoneEditorHandlers = useZoneEditorPointerHandlers(scene, layer, waypoint, camera, isDragging)
let currentHandlers = computed(() => zoneEditorStore.active ? zoneEditorHandlers : gameHandlers)
let currentHandlers = computed(() => (zoneEditorStore.active ? zoneEditorHandlers : gameHandlers))
const setupPointerHandlers = () => {
currentHandlers.value.setupPointerHandlers()
@ -21,12 +21,15 @@ export function usePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilemaps.T
currentHandlers.value.cleanupPointerHandlers()
}
watch(() => zoneEditorStore.active, (newValue, oldValue) => {
if (newValue !== oldValue) {
cleanupPointerHandlers()
setupPointerHandlers()
watch(
() => zoneEditorStore.active,
(newValue, oldValue) => {
if (newValue !== oldValue) {
cleanupPointerHandlers()
setupPointerHandlers()
}
}
})
)
return { setupPointerHandlers, cleanupPointerHandlers }
}
}