tile editor wip
This commit is contained in:
@ -1,23 +1,32 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import config from '@/config'
|
||||
import {type Zone} from '@/types'
|
||||
|
||||
export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
state: () => ({
|
||||
active: false,
|
||||
name: '',
|
||||
width: 10,
|
||||
height: 10,
|
||||
tiles: [] as number[][],
|
||||
tool: 'move',
|
||||
drawMode: 'tile',
|
||||
selectedTile: null,
|
||||
selectedWall: null,
|
||||
selectedDecoration: null,
|
||||
zoneSettings: null as Zone | null,
|
||||
zoneSettingsOpen: false
|
||||
isSettingsModalShown: false
|
||||
}),
|
||||
actions: {
|
||||
toggleActive() {
|
||||
this.active = !this.active
|
||||
},
|
||||
setName(name: string) {
|
||||
this.name = name
|
||||
},
|
||||
setWidth(width: number) {
|
||||
this.width = width
|
||||
},
|
||||
setHeight(height: number) {
|
||||
this.height = height
|
||||
},
|
||||
setTiles(tiles: number[][]) {
|
||||
this.tiles = tiles
|
||||
},
|
||||
@ -36,21 +45,20 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
setSelectedDecoration(decoration: any) {
|
||||
this.selectedDecoration = decoration
|
||||
},
|
||||
setZoneSettings(zone: Zone) {
|
||||
this.zoneSettings = zone
|
||||
},
|
||||
toggleZoneSettings() {
|
||||
this.zoneSettingsOpen = !this.zoneSettingsOpen
|
||||
toggleSettingsModal() {
|
||||
this.isSettingsModalShown = !this.isSettingsModalShown
|
||||
},
|
||||
reset() {
|
||||
this.name = ''
|
||||
this.width = 10
|
||||
this.height = 10
|
||||
this.tiles = []
|
||||
this.tool = 'move'
|
||||
this.drawMode = 'tile'
|
||||
this.selectedTile = null
|
||||
this.selectedWall = null
|
||||
this.selectedDecoration = null
|
||||
this.zoneSettings = null
|
||||
this.zoneSettingsOpen = false
|
||||
this.isSettingsModalShown = false
|
||||
}
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user