1
0
forked from noxious/client

Renamed class

This commit is contained in:
Dennis Postma 2024-12-31 16:15:28 +01:00
parent 5fcb336835
commit 8355c83dc8
3 changed files with 6 additions and 6 deletions

6
package-lock.json generated
View File

@ -7975,9 +7975,9 @@
"license": "ISC"
},
"node_modules/yaml": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
"integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==",
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz",
"integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==",
"dev": true,
"license": "ISC",
"bin": {

View File

@ -2,7 +2,7 @@ import config from '@/application/config'
import Dexie from 'dexie'
import type { AssetDataT } from '@/application/types'
export class AssetStorage {
export class Assets {
private db: Dexie
constructor() {

View File

@ -1,13 +1,13 @@
import type { AssetDataT, HttpResponse, Sprite, SpriteAction } from '@/application/types'
import { useGameStore } from '@/stores/gameStore'
import { AssetStorage } from '@/application/assetStorage'
import { Assets } from '@/application/assets'
import config from '@/application/config'
const textureLoadingPromises = new Map<string, Promise<boolean>>()
export async function loadTexture(scene: Phaser.Scene, assetData: AssetDataT): Promise<boolean> {
const gameStore = useGameStore()
const assetStorage = new AssetStorage()
const assetStorage = new Assets()
// Check if the texture is already loaded in Phaser
if (gameStore.game.loadedAssets.find((asset) => asset.key === assetData.key)) {