forked from noxious/client
Removed gmPanel store and moved its logics to gameStore
This commit is contained in:
@ -10,12 +10,25 @@ export const useGameStore = defineStore('game', {
|
||||
token: '' as string | null,
|
||||
connection: null as Socket | null,
|
||||
user: null as User | null,
|
||||
character: null as Character | null
|
||||
character: null as Character | null,
|
||||
isGmPanelOpen: false
|
||||
}),
|
||||
actions: {
|
||||
setScreen(screen: string) {
|
||||
this.screen = screen
|
||||
},
|
||||
setToken(token: string) {
|
||||
this.token = token
|
||||
},
|
||||
setUser(user: User | null) {
|
||||
this.user = user
|
||||
},
|
||||
setCharacter(character: Character | null) {
|
||||
this.character = character
|
||||
},
|
||||
toggleGmPanel() {
|
||||
this.isGmPanelOpen = !this.isGmPanelOpen
|
||||
},
|
||||
initConnection() {
|
||||
this.connection = io(config.server_endpoint, {
|
||||
secure: !config.development,
|
||||
@ -49,14 +62,5 @@ export const useGameStore = defineStore('game', {
|
||||
|
||||
useCookies().remove('token')
|
||||
},
|
||||
setToken(token: string) {
|
||||
this.token = token
|
||||
},
|
||||
setUser(user: User | null) {
|
||||
this.user = user
|
||||
},
|
||||
setCharacter(character: Character | null) {
|
||||
this.character = character
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1,20 +0,0 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import type { Character } from '@/types'
|
||||
import config from '@/config'
|
||||
|
||||
export const useGmPanelStore = defineStore('gmPanel', {
|
||||
state: () => ({
|
||||
isOpen: false
|
||||
}),
|
||||
actions: {
|
||||
toggle() {
|
||||
this.isOpen = !this.isOpen
|
||||
},
|
||||
open() {
|
||||
this.isOpen = true
|
||||
},
|
||||
close() {
|
||||
this.isOpen = false
|
||||
}
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user