#137 : Added logic to set effects per zone in zone editor

This commit is contained in:
2024-10-18 22:23:56 +02:00
parent 3c9b92ccbd
commit 5d288772b5
4 changed files with 47 additions and 13 deletions

View File

@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { useGameStore } from '@/stores/gameStore'
import type { Zone, Object, Tile, ZoneObject, ZoneEffects } from '@/types'
import type { Zone, Object, Tile, ZoneEffect } from '@/types'
export type TeleportSettings = {
toZoneId: number
@ -33,7 +33,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
width: 0,
height: 0,
pvp: false,
effects: [] as ZoneEffects[]
zoneEffects: [] as ZoneEffect[]
},
teleportSettings: {
toZoneId: 0,
@ -66,9 +66,9 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
if (!this.zone) return
this.zone.pvp = pvp
},
setZoneEffects(zoneEffects: ZoneEffects) {
setZoneEffects(zoneEffects: ZoneEffect[]) {
if (!this.zone) return
this.zone.zoneEffects = zoneEffects
this.zoneSettings.zoneEffects = zoneEffects
},
setTool(tool: string) {
this.tool = tool