Revert logo loading and fix it

This commit is contained in:
Gregoire Parant 2021-05-04 15:47:45 +02:00
parent c8692a08ce
commit 83159a121f
5 changed files with 9 additions and 8 deletions

View File

@ -206,7 +206,6 @@ export class GameScene extends ResizableScene implements CenterListener {
//hook preload scene
preload(): void {
addLoader(this);
const localUser = localUserStore.getLocalUser();
const textures = localUser?.textures;
if (textures) {
@ -266,6 +265,9 @@ export class GameScene extends ResizableScene implements CenterListener {
this.load.spritesheet('layout_modes', 'resources/objects/layout_modes.png', {frameWidth: 32, frameHeight: 32});
this.load.bitmapFont('main_font', 'resources/fonts/arcade.png', 'resources/fonts/arcade.xml');
//this function must stay at the end of preload function
addLoader(this);
}
// FIXME: we need to put a "unknown" instead of a "any" and validate the structure of the JSON we are receiving.

View File

@ -35,8 +35,6 @@ export class CustomizeScene extends AbstractCharacterScene {
}
preload() {
addLoader(this);
this.load.html(customizeSceneKey, 'resources/html/CustomCharacterScene.html');
this.layers = loadAllLayers(this.load);
@ -48,6 +46,9 @@ export class CustomizeScene extends AbstractCharacterScene {
this.layers[bodyResourceDescription.level].unshift(bodyResourceDescription);
});
});
//this function must stay at the end of preload function
addLoader(this);
}
create() {

View File

@ -6,7 +6,6 @@ import {EnableCameraSceneName} from "./EnableCameraScene";
import {CustomizeSceneName} from "./CustomizeScene";
import {localUserStore} from "../../Connexion/LocalUserStore";
import {loadAllDefaultModels} from "../Entity/PlayerTexturesLoadingManager";
import {addLoader} from "../Components/Loader";
import {BodyResourceDescriptionInterface} from "../Entity/PlayerTextures";
import {AbstractCharacterScene} from "./AbstractCharacterScene";
import {areCharacterLayersValid} from "../../Connexion/LocalUser";

View File

@ -37,8 +37,6 @@ export class SelectCharacterScene extends AbstractCharacterScene {
}
preload() {
addLoader(this);
this.load.html(selectCharacterKey, 'resources/html/selectCharacterScene.html');
this.loadSelectSceneCharacters().then((bodyResourceDescriptions) => {
@ -47,6 +45,8 @@ export class SelectCharacterScene extends AbstractCharacterScene {
});
})
this.playerModels = loadAllDefaultModels(this.load);
//this function must stay at the end of preload function
addLoader(this);
}

View File

@ -31,14 +31,13 @@ export class SelectCompanionScene extends ResizableScene {
}
preload() {
addLoader(this);
this.load.html(selectCompanionSceneKey, 'resources/html/SelectCompanionScene.html');
getAllCompanionResources(this.load).forEach(model => {
this.companionModels.push(model);
});
//this function must stay at the end of preload function
addLoader(this);
}