Minor improvement
This commit is contained in:
parent
df3b9db45d
commit
1f46b94441
@ -5,23 +5,25 @@ import config from '@/config'
|
||||
import { useCookies } from '@vueuse/integrations/useCookies'
|
||||
|
||||
export const useGameStore = defineStore('game', {
|
||||
state: () => ({
|
||||
notifications: [] as Notification[],
|
||||
assets: [] as Asset[],
|
||||
token: '' as string | null,
|
||||
connection: null as Socket | null,
|
||||
user: null as User | null,
|
||||
character: null as Character | null,
|
||||
isPlayerDraggingCamera: false,
|
||||
gameSettings: {
|
||||
isCameraFollowingCharacter: false
|
||||
},
|
||||
uiSettings: {
|
||||
isChatOpen: false,
|
||||
isUserPanelOpen: false,
|
||||
isGmPanelOpen: false
|
||||
state: () => {
|
||||
return {
|
||||
notifications: [] as Notification[],
|
||||
assets: [] as Asset[],
|
||||
token: '' as string | null,
|
||||
connection: null as Socket | null,
|
||||
user: null as User | null,
|
||||
character: null as Character | null,
|
||||
isPlayerDraggingCamera: false,
|
||||
gameSettings: {
|
||||
isCameraFollowingCharacter: false
|
||||
},
|
||||
uiSettings: {
|
||||
isChatOpen: false,
|
||||
isUserPanelOpen: false,
|
||||
isGmPanelOpen: false
|
||||
}
|
||||
}
|
||||
}),
|
||||
},
|
||||
getters: {
|
||||
getNotifications: (state: any) => state.notifications,
|
||||
getAssetByKey: (state) => {
|
||||
|
@ -10,37 +10,39 @@ type TeleportSettings = {
|
||||
}
|
||||
|
||||
export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
state: () => ({
|
||||
active: false,
|
||||
zone: null as Zone | null,
|
||||
tool: 'move',
|
||||
drawMode: 'tile',
|
||||
eraserMode: 'tile',
|
||||
zoneList: [] as Zone[],
|
||||
tileList: [] as Tile[],
|
||||
objectList: [] as Object[],
|
||||
selectedTile: null as Tile | null,
|
||||
selectedObject: null as Object | null,
|
||||
selectedZoneObject: null as ZoneObject | null,
|
||||
objectDepth: 0,
|
||||
isTileListModalShown: false,
|
||||
isObjectListModalShown: false,
|
||||
isZoneListModalShown: false,
|
||||
isCreateZoneModalShown: false,
|
||||
isSettingsModalShown: false,
|
||||
zoneSettings: {
|
||||
name: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
pvp: false
|
||||
},
|
||||
teleportSettings: {
|
||||
toZoneId: 0,
|
||||
toPositionX: 0,
|
||||
toPositionY: 0,
|
||||
toRotation: 0
|
||||
state: () => {
|
||||
return {
|
||||
active: false,
|
||||
zone: null as Zone | null,
|
||||
tool: 'move',
|
||||
drawMode: 'tile',
|
||||
eraserMode: 'tile',
|
||||
zoneList: [] as Zone[],
|
||||
tileList: [] as Tile[],
|
||||
objectList: [] as Object[],
|
||||
selectedTile: null as Tile | null,
|
||||
selectedObject: null as Object | null,
|
||||
selectedZoneObject: null as ZoneObject | null,
|
||||
objectDepth: 0,
|
||||
isTileListModalShown: false,
|
||||
isObjectListModalShown: false,
|
||||
isZoneListModalShown: false,
|
||||
isCreateZoneModalShown: false,
|
||||
isSettingsModalShown: false,
|
||||
zoneSettings: {
|
||||
name: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
pvp: false
|
||||
},
|
||||
teleportSettings: {
|
||||
toZoneId: 0,
|
||||
toPositionX: 0,
|
||||
toPositionY: 0,
|
||||
toRotation: 0
|
||||
}
|
||||
}
|
||||
}),
|
||||
},
|
||||
actions: {
|
||||
toggleActive() {
|
||||
const gameStore = useGameStore()
|
||||
|
@ -2,11 +2,13 @@ import { defineStore } from 'pinia'
|
||||
import type { ExtendedCharacter, Zone } from '@/types'
|
||||
|
||||
export const useZoneStore = defineStore('zone', {
|
||||
state: () => ({
|
||||
zone: null as Zone | null,
|
||||
characters: [] as ExtendedCharacter[],
|
||||
characterLoaded: false
|
||||
}),
|
||||
state: () => {
|
||||
return {
|
||||
zone: null as Zone | null,
|
||||
characters: [] as ExtendedCharacter[],
|
||||
characterLoaded: false
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getCharacterById: (state) => {
|
||||
return (id: number) => state.characters.find((char) => char.id === id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user