Small styling adjustment on buttons. Some zone editor stuff.

This commit is contained in:
2024-07-07 04:32:16 +02:00
parent 317906eab5
commit 89a781470b
7 changed files with 46 additions and 38 deletions

View File

@ -4,32 +4,26 @@ import type { Object, ZoneObject } from '@/types'
export const useZoneEditorStore = defineStore('zoneEditor', {
state: () => ({
active: true,
isZoneListModalShown: false,
isCreateZoneModalShown: false,
name: '',
width: 10,
height: 10,
tool: 'move',
drawMode: 'tile',
tileList: [] as string[],
tiles: [] as string[][],
objectList: [] as Object[],
objects: [] as ZoneObject[],
tool: 'move',
drawMode: 'tile',
selectedTile: '',
selectedObject: null as Object | null,
isZoneListModalShown: false,
isCreateZoneModalShown: false,
isSettingsModalShown: false
}),
actions: {
toggleActive() {
this.active = !this.active
},
toggleZoneListModal() {
this.isZoneListModalShown = !this.isZoneListModalShown
this.isCreateZoneModalShown = false
},
toggleCreateZoneModal() {
this.isCreateZoneModalShown = !this.isCreateZoneModalShown
},
setName(name: string) {
this.name = name
},
@ -39,6 +33,12 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
setHeight(height: number) {
this.height = height
},
setTool(tool: string) {
this.tool = tool
},
setDrawMode(mode: string) {
this.drawMode = mode
},
setTileList(tiles: string[]) {
this.tileList = tiles
},
@ -57,12 +57,6 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
updateObject(index: number, object: ZoneObject) {
this.objects[index] = object
},
setTool(tool: string) {
this.tool = tool
},
setDrawMode(mode: string) {
this.drawMode = mode
},
setSelectedTile(tile: string) {
this.selectedTile = tile
},
@ -72,6 +66,13 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
toggleSettingsModal() {
this.isSettingsModalShown = !this.isSettingsModalShown
},
toggleZoneListModal() {
this.isZoneListModalShown = !this.isZoneListModalShown
this.isCreateZoneModalShown = false
},
toggleCreateZoneModal() {
this.isCreateZoneModalShown = !this.isCreateZoneModalShown
},
reset() {
this.name = ''
this.width = 10
@ -85,6 +86,8 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
this.selectedTile = ''
this.selectedObject = null
this.isSettingsModalShown = false
this.isZoneListModalShown = false
this.isCreateZoneModalShown = false
}
}
})