Renamed hair > characterHair, split character logic (chat bubble, healthbar etc) into separate components for better DX

This commit is contained in:
2024-11-24 15:13:11 +01:00
parent 89d83efca4
commit f7b8c235d8
10 changed files with 153 additions and 75 deletions

View File

@ -38,7 +38,10 @@ export const useGameStore = defineStore('game', {
return state.game.loadedAssets
},
getLoadedAsset: (state) => {
return (key: string) => state.game.loadedAssets.find((asset) => asset.key === key)
return (key: string | undefined) => {
if (!key) return null
return state.game.loadedAssets.find((asset) => asset.key === key)
}
},
getLoadedAssetsByGroup: (state) => {
return (group: string) => state.game.loadedAssets.filter((asset) => asset.group === group)