1
0
forked from noxious/client

#216: Added tile & object picker in map editor

This commit is contained in:
2024-11-03 01:26:13 +01:00
parent 6f40c774ea
commit adf86d369b
6 changed files with 105 additions and 29 deletions

View File

@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { useGameStore } from '@/stores/gameStore'
import type { Zone, Object, Tile, ZoneEffect } from '@/types'
import type { Zone, Object, Tile, ZoneEffect, ZoneObject } from '@/types'
export type TeleportSettings = {
toZoneId: number
@ -20,9 +20,8 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
zoneList: [] as Zone[],
tileList: [] as Tile[],
objectList: [] as Object[],
selectedTile: null as Tile | null,
selectedTile: '',
selectedObject: null as Object | null,
objectDepth: 0,
isTileListModalShown: false,
isObjectListModalShown: false,
isZoneListModalShown: false,
@ -88,15 +87,12 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
setObjectList(objects: Object[]) {
this.objectList = objects
},
setSelectedTile(tile: Tile) {
setSelectedTile(tile: string) {
this.selectedTile = tile
},
setSelectedObject(object: any) {
setSelectedObject(object: Object) {
this.selectedObject = object
},
setObjectDepth(depth: number) {
this.objectDepth = depth
},
toggleSettingsModal() {
this.isSettingsModalShown = !this.isSettingsModalShown
},
@ -117,9 +113,8 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
this.objectList = []
this.tool = 'move'
this.drawMode = 'tile'
this.selectedTile = null
this.selectedTile = ''
this.selectedObject = null
this.objectDepth = 0
this.isSettingsModalShown = false
this.isZoneListModalShown = false
this.isCreateZoneModalShown = false