Stash WIP zone effect
This commit is contained in:
@ -2,13 +2,18 @@ import { defineStore } from 'pinia'
|
||||
import { useGameStore } from '@/stores/gameStore'
|
||||
import type { Zone, Object, Tile, ZoneObject } from '@/types'
|
||||
|
||||
type TeleportSettings = {
|
||||
export type TeleportSettings = {
|
||||
toZoneId: number
|
||||
toPositionX: number
|
||||
toPositionY: number
|
||||
toRotation: number
|
||||
}
|
||||
|
||||
export type ZoneEffects = {
|
||||
zoneEffect: string
|
||||
zoneEffectPercentage: number
|
||||
}
|
||||
|
||||
export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
state: () => {
|
||||
return {
|
||||
@ -33,14 +38,18 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
name: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
pvp: false
|
||||
pvp: false,
|
||||
zoneEffects: {
|
||||
zoneEffect: '',
|
||||
zoneEffectPercentage: 0
|
||||
} as ZoneEffects
|
||||
},
|
||||
teleportSettings: {
|
||||
toZoneId: 0,
|
||||
toPositionX: 0,
|
||||
toPositionY: 0,
|
||||
toRotation: 0
|
||||
}
|
||||
} as TeleportSettings
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@ -66,6 +75,10 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
if (!this.zone) return
|
||||
this.zone.pvp = pvp
|
||||
},
|
||||
setZoneEffects(zoneEffects: ZoneEffects) {
|
||||
if (!this.zone) return
|
||||
this.zone.zoneEffects = zoneEffects
|
||||
},
|
||||
setTool(tool: string) {
|
||||
this.tool = tool
|
||||
},
|
||||
|
Reference in New Issue
Block a user