import { ResizableScene } from "./ResizableScene"; import { localUserStore } from "../../Connexion/LocalUserStore"; import type { BodyResourceDescriptionInterface } from "../Entity/PlayerTextures"; import { loadCustomTexture } from "../Entity/PlayerTexturesLoadingManager"; import type { CharacterTexture } from "../../Connexion/LocalUser"; export abstract class AbstractCharacterScene extends ResizableScene { loadCustomSceneSelectCharacters(): Promise { const textures = this.getTextures(); const promises: Promise[] = []; if (textures) { for (const texture of textures) { if (texture.level === -1) { continue; } promises.push(loadCustomTexture(this.load, texture)); } } return Promise.all(promises); } loadSelectSceneCharacters(): Promise { const textures = this.getTextures(); const promises: Promise[] = []; if (textures) { for (const texture of textures) { if (texture.level !== -1) { continue; } promises.push(loadCustomTexture(this.load, texture)); } } return Promise.all(promises); } private getTextures(): CharacterTexture[] | undefined { const localUser = localUserStore.getLocalUser(); return localUser?.textures; } }