forked from noxious/client
Renamed class
This commit is contained in:
parent
5fcb336835
commit
8355c83dc8
6
package-lock.json
generated
6
package-lock.json
generated
@ -7975,9 +7975,9 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/yaml": {
|
"node_modules/yaml": {
|
||||||
"version": "2.6.1",
|
"version": "2.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz",
|
||||||
"integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==",
|
"integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -2,7 +2,7 @@ import config from '@/application/config'
|
|||||||
import Dexie from 'dexie'
|
import Dexie from 'dexie'
|
||||||
import type { AssetDataT } from '@/application/types'
|
import type { AssetDataT } from '@/application/types'
|
||||||
|
|
||||||
export class AssetStorage {
|
export class Assets {
|
||||||
private db: Dexie
|
private db: Dexie
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
@ -1,13 +1,13 @@
|
|||||||
import type { AssetDataT, HttpResponse, Sprite, SpriteAction } from '@/application/types'
|
import type { AssetDataT, HttpResponse, Sprite, SpriteAction } from '@/application/types'
|
||||||
import { useGameStore } from '@/stores/gameStore'
|
import { useGameStore } from '@/stores/gameStore'
|
||||||
import { AssetStorage } from '@/application/assetStorage'
|
import { Assets } from '@/application/assets'
|
||||||
import config from '@/application/config'
|
import config from '@/application/config'
|
||||||
|
|
||||||
const textureLoadingPromises = new Map<string, Promise<boolean>>()
|
const textureLoadingPromises = new Map<string, Promise<boolean>>()
|
||||||
|
|
||||||
export async function loadTexture(scene: Phaser.Scene, assetData: AssetDataT): Promise<boolean> {
|
export async function loadTexture(scene: Phaser.Scene, assetData: AssetDataT): Promise<boolean> {
|
||||||
const gameStore = useGameStore()
|
const gameStore = useGameStore()
|
||||||
const assetStorage = new AssetStorage()
|
const assetStorage = new Assets()
|
||||||
|
|
||||||
// Check if the texture is already loaded in Phaser
|
// Check if the texture is already loaded in Phaser
|
||||||
if (gameStore.game.loadedAssets.find((asset) => asset.key === assetData.key)) {
|
if (gameStore.game.loadedAssets.find((asset) => asset.key === assetData.key)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user