Adding wokalist type checking on front

Additionally, we are making superLoad.json accept a new "immediateCallback" parameter that resolves during the event handler (and not after)
This commit is contained in:
David Négrier
2022-03-21 10:33:25 +01:00
parent 2d3e2805a1
commit 705c75e3c7
18 changed files with 114 additions and 132 deletions
@@ -15,39 +15,4 @@ export abstract class AbstractCharacterScene extends ResizableScene {
this.playerTextures = new PlayerTextures();
this.superLoad = new SuperLoaderPlugin(this);
}
loadCustomSceneSelectCharacters(): Promise<BodyResourceDescriptionInterface[]> {
const textures = this.playerTextures.getTexturesResources(PlayerTexturesKey.Woka);
const promises: CancelablePromise<Texture>[] = [];
const bodyResourceDescriptions: BodyResourceDescriptionInterface[] = [];
if (textures) {
for (const texture of Object.values(textures)) {
if (texture.level === -1) {
continue;
}
promises.push(loadWokaTexture(this.superLoad, texture));
bodyResourceDescriptions.push(texture);
}
}
return Promise.all(promises).then(() => {
return bodyResourceDescriptions;
});
}
loadSelectSceneCharacters(): Promise<BodyResourceDescriptionInterface[]> {
const promises: CancelablePromise<Texture>[] = [];
const bodyResourceDescriptions: BodyResourceDescriptionInterface[] = [];
for (const textures of this.playerTextures.getLayers()) {
for (const texture of Object.values(textures)) {
if (texture.level !== -1) {
continue;
}
promises.push(loadWokaTexture(this.superLoad, texture));
bodyResourceDescriptions.push(texture);
}
}
return Promise.all(promises).then(() => {
return bodyResourceDescriptions;
});
}
}