npm run format
This commit is contained in:
@ -4,7 +4,7 @@ import config from '@/config'
|
||||
|
||||
export const useAssetStore = defineStore('assets', {
|
||||
state: () => ({
|
||||
assets: [] as Asset[],
|
||||
assets: [] as Asset[]
|
||||
}),
|
||||
actions: {
|
||||
setAssets(assets: Asset[]) {
|
||||
|
@ -12,7 +12,8 @@ export const useGameStore = defineStore('game', {
|
||||
user: null as User | null,
|
||||
character: null as Character | null,
|
||||
isGmPanelOpen: false,
|
||||
isMovingCamera: false
|
||||
isMovingCamera: false,
|
||||
isChatOpen: false
|
||||
}),
|
||||
actions: {
|
||||
setScreen(screen: string) {
|
||||
@ -36,6 +37,9 @@ export const useGameStore = defineStore('game', {
|
||||
setMovingCamera(moving: boolean) {
|
||||
this.isMovingCamera = moving
|
||||
},
|
||||
toggleChat() {
|
||||
this.isChatOpen = !this.isChatOpen
|
||||
},
|
||||
initConnection() {
|
||||
this.connection = io(config.server_endpoint, {
|
||||
secure: !config.development,
|
||||
|
@ -8,7 +8,7 @@ export const useZoneStore = defineStore('zone', {
|
||||
}),
|
||||
getters: {
|
||||
getCharacterById: (state) => {
|
||||
return (id: number) => state.characters.find(char => char.id === id)
|
||||
return (id: number) => state.characters.find((char) => char.id === id)
|
||||
},
|
||||
getCharacterCount: (state) => {
|
||||
return state.characters.length
|
||||
@ -28,17 +28,17 @@ export const useZoneStore = defineStore('zone', {
|
||||
this.characters.push(character)
|
||||
},
|
||||
updateCharacter(updatedCharacter: ExtendedCharacter) {
|
||||
const index = this.characters.findIndex(char => char.id === updatedCharacter.id)
|
||||
const index = this.characters.findIndex((char) => char.id === updatedCharacter.id)
|
||||
if (index !== -1) {
|
||||
this.characters[index] = { ...this.characters[index], ...updatedCharacter }
|
||||
}
|
||||
},
|
||||
removeCharacter(character_id: number) {
|
||||
this.characters = this.characters.filter(char => char.id !== character_id)
|
||||
this.characters = this.characters.filter((char) => char.id !== character_id)
|
||||
},
|
||||
reset() {
|
||||
this.zone = null
|
||||
this.characters = []
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user