From 83159a121f2006ae8e52cbbcce65d845c8f37c20 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Tue, 4 May 2021 15:47:45 +0200 Subject: [PATCH] Revert logo loading and fix it --- front/src/Phaser/Game/GameScene.ts | 4 +++- front/src/Phaser/Login/CustomizeScene.ts | 5 +++-- front/src/Phaser/Login/SelectCharacterMobileScene.ts | 1 - front/src/Phaser/Login/SelectCharacterScene.ts | 4 ++-- front/src/Phaser/Login/SelectCompanionScene.ts | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 149d7317..71d7868f 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -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. diff --git a/front/src/Phaser/Login/CustomizeScene.ts b/front/src/Phaser/Login/CustomizeScene.ts index 795ee475..673ba20a 100644 --- a/front/src/Phaser/Login/CustomizeScene.ts +++ b/front/src/Phaser/Login/CustomizeScene.ts @@ -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() { diff --git a/front/src/Phaser/Login/SelectCharacterMobileScene.ts b/front/src/Phaser/Login/SelectCharacterMobileScene.ts index 5d874f46..e29ab798 100644 --- a/front/src/Phaser/Login/SelectCharacterMobileScene.ts +++ b/front/src/Phaser/Login/SelectCharacterMobileScene.ts @@ -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"; diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts index c9f41e69..daa35028 100644 --- a/front/src/Phaser/Login/SelectCharacterScene.ts +++ b/front/src/Phaser/Login/SelectCharacterScene.ts @@ -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); } diff --git a/front/src/Phaser/Login/SelectCompanionScene.ts b/front/src/Phaser/Login/SelectCompanionScene.ts index fe94cd90..1191415b 100644 --- a/front/src/Phaser/Login/SelectCompanionScene.ts +++ b/front/src/Phaser/Login/SelectCompanionScene.ts @@ -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); }