Zone editor UX improvements, possibly fixed login issue after registration
This commit is contained in:
@ -9,6 +9,7 @@ import { storeToRefs } from 'pinia'
|
||||
import config from '@/config'
|
||||
import { getTile, tileToWorldXY } from '@/services/zone'
|
||||
import { useZoneEditorStore } from '@/stores/zoneEditor'
|
||||
import { useGameStore } from '@/stores/game'
|
||||
|
||||
const props = defineProps<{
|
||||
layer: Phaser.Tilemaps.TilemapLayer
|
||||
@ -16,6 +17,7 @@ const props = defineProps<{
|
||||
|
||||
const scene = useScene()
|
||||
const zoneEditorStore = useZoneEditorStore()
|
||||
const gameStore = useGameStore()
|
||||
const { tool } = storeToRefs(zoneEditorStore)
|
||||
|
||||
const waypoint = ref({
|
||||
@ -63,11 +65,13 @@ function setupEventListeners() {
|
||||
|
||||
scene.input.on(Phaser.Input.Events.POINTER_DOWN, (pointer: Phaser.Input.Pointer) => {
|
||||
if (pointer.event.altKey || tool.value === 'move') {
|
||||
gameStore.setMovingCamera(true)
|
||||
scene.input.on(Phaser.Input.Events.POINTER_MOVE, dragZone)
|
||||
}
|
||||
})
|
||||
|
||||
scene.input.on(Phaser.Input.Events.POINTER_UP, () => {
|
||||
gameStore.setMovingCamera(false)
|
||||
scene.input.off(Phaser.Input.Events.POINTER_MOVE, dragZone)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user