1
0
forked from noxious/client

#236: Fixed clear button in map editor

This commit is contained in:
2024-11-04 23:44:34 +01:00
parent a653b61b51
commit bdc566e30f
3 changed files with 25 additions and 2 deletions

View File

@ -12,7 +12,7 @@ export type TeleportSettings = {
export const useZoneEditorStore = defineStore('zoneEditor', {
state: () => {
return {
active: false,
active: true,
zone: null as Zone | null,
tool: 'move',
drawMode: 'tile',
@ -27,6 +27,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
isZoneListModalShown: false,
isCreateZoneModalShown: false,
isSettingsModalShown: false,
shouldClearTiles: false,
zoneSettings: {
name: '',
width: 0,
@ -106,6 +107,13 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
setTeleportSettings(teleportSettings: TeleportSettings) {
this.teleportSettings = teleportSettings
},
triggerClearTiles() {
this.shouldClearTiles = true
},
resetClearTilesFlag() {
this.shouldClearTiles = false
},
reset(resetZone = false) {
if (resetZone) this.zone = null
this.zoneList = []
@ -118,6 +126,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
this.isSettingsModalShown = false
this.isZoneListModalShown = false
this.isCreateZoneModalShown = false
this.shouldClearTiles = false
}
}
})