forked from noxious/client
npm update & npm run format
This commit is contained in:
@ -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 }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user