1
0
forked from noxious/client

Replaced some code vars for consistency, added start of teleport logics

This commit is contained in:
2024-08-21 23:10:29 +02:00
parent 4d326f24ac
commit 2211824832
7 changed files with 130 additions and 12 deletions

View File

@ -2,6 +2,12 @@ import { defineStore } from 'pinia'
import { useGameStore } from '@/stores/game'
import type { Zone, Object, Tile, ZoneObject } from '@/types'
type TeleportSettings = {
x: number
y: number
zoneId: number
}
export const useZoneEditorStore = defineStore('zoneEditor', {
state: () => ({
active: false,
@ -20,7 +26,12 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
isObjectListModalShown: false,
isZoneListModalShown: false,
isCreateZoneModalShown: false,
isSettingsModalShown: false
isSettingsModalShown: false,
teleportSettings: {
x: 0,
y: 0,
zoneId: 0
}
}),
actions: {
toggleActive() {
@ -93,6 +104,9 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
toggleCreateZoneModal() {
this.isCreateZoneModalShown = !this.isCreateZoneModalShown
},
setTeleportSettings(teleportSettings: TeleportSettings) {
this.teleportSettings = teleportSettings
},
reset() {
this.zoneList = []
this.tileList = []