Zone editor GUI (WIP), added a few helper functions

This commit is contained in:
2024-06-10 17:46:25 +02:00
parent 8227dfe4b3
commit 58bff2010f
12 changed files with 190 additions and 47 deletions

View File

@ -5,12 +5,14 @@ export const useZoneStore = defineStore('zone', {
state: () => ({
loaded: false,
tiles: undefined,
characters: [] as Character[]
characters: [] as Character[],
editorIsOpen: true
}),
getters: {
isLoaded: (state) => state.loaded,
getTiles: (state) => state.tiles,
getCharacters: (state) => state.characters
getCharacters: (state) => state.characters,
getEditorIsOpen: (state) => state.editorIsOpen
},
actions: {
loadTiles(tiles: any) {
@ -33,6 +35,9 @@ export const useZoneStore = defineStore('zone', {
} else {
console.error(`Character with id ${character.id} not found`)
}
},
setEditorIsOpen(isOpen: boolean) {
this.editorIsOpen = isOpen
}
}
})