1
0
forked from noxious/client
This commit is contained in:
2025-01-07 22:20:46 +01:00
parent c2db9b5469
commit 574777da80
19 changed files with 385 additions and 416 deletions

View File

@ -22,7 +22,7 @@ export const useGameStore = defineStore('game', {
game: {
isLoading: false,
isLoaded: false, // isLoaded is currently being used to determine if the player has interacted with the game
loadedAssets: [] as TextureData[],
loadedAssets: [] as string[],
isPlayerDraggingCamera: false,
isCameraFollowingCharacter: false
},
@ -37,15 +37,9 @@ export const useGameStore = defineStore('game', {
getLoadedAssets: (state) => {
return state.game.loadedAssets
},
getLoadedAsset: (state) => {
return (key: string | undefined) => {
if (!key) return null
return state.game.loadedAssets.find((asset) => asset.key === key)
}
isAssetLoaded: (state) => {
return (key: string) => { return state.game.loadedAssets.includes(key)}
},
getLoadedAssetsByGroup: (state) => {
return (group: string) => state.game.loadedAssets.filter((asset) => asset.group === group)
}
},
actions: {
addNotification(notification: Notification) {