1
0
forked from noxious/client

Added quick editor logics for zoneObjects

This commit is contained in:
2024-07-16 01:19:27 +02:00
parent 5784b0fa9c
commit 77cbbea967
4 changed files with 91 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import type { Zone, Object, Tile } from '@/types'
import type { Zone, Object, Tile, ZoneObject } from '@/types'
export const useZoneEditorStore = defineStore('zoneEditor', {
state: () => ({
@ -12,6 +12,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
objectList: [] as Object[],
selectedTile: null as Tile | null,
selectedObject: null as Object | null,
selectedZoneObject: null as ZoneObject | null,
objectDepth: 0,
isZoneListModalShown: false,
isCreateZoneModalShown: false,
@ -60,6 +61,9 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
setSelectedObject(object: any) {
this.selectedObject = object
},
setSelectedZoneObject(zoneObject: ZoneObject) {
this.selectedZoneObject = zoneObject
},
setObjectDepth(depth: number) {
this.objectDepth = depth
},
@ -81,6 +85,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
this.drawMode = 'tile'
this.selectedTile = null
this.selectedObject = null
this.selectedZoneObject = null
this.objectDepth = 0
this.isSettingsModalShown = false
this.isZoneListModalShown = false