Zone editor UX improvements, possibly fixed login issue after registration

This commit is contained in:
2024-07-21 22:48:16 +02:00
parent 12cd7b667a
commit 338d4d312b
5 changed files with 21 additions and 14 deletions

View File

@ -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)
})
}