1
0
forked from noxious/client

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

@ -11,7 +11,8 @@ export const useGameStore = defineStore('game', {
connection: null as Socket | null,
user: null as User | null,
character: null as Character | null,
isGmPanelOpen: false
isGmPanelOpen: false,
isMovingCamera: false
}),
actions: {
setScreen(screen: string) {
@ -29,6 +30,12 @@ export const useGameStore = defineStore('game', {
toggleGmPanel() {
this.isGmPanelOpen = !this.isGmPanelOpen
},
toggleMovingCamera() {
this.isMovingCamera = !this.isMovingCamera
},
setMovingCamera(moving: boolean) {
this.isMovingCamera = moving
},
initConnection() {
this.connection = io(config.server_endpoint, {
secure: !config.development,

View File

@ -1,4 +1,5 @@
import { defineStore } from 'pinia'
import { useGameStore } from '@/stores/game';
import type { Zone, Object, Tile, ZoneObject } from '@/types'
export const useZoneEditorStore = defineStore('zoneEditor', {
@ -62,6 +63,9 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
this.selectedObject = object
},
setSelectedZoneObject(zoneObject: ZoneObject) {
const gameStore = useGameStore(); // Access the gameStore
if (gameStore.isMovingCamera) return; // Step 2: Check isMovingCamera before proceeding
this.selectedZoneObject = zoneObject
},
setObjectDepth(depth: number) {