From 4ec5ad9e3301b484a5ab392d1c4d7e0e2089eccb Mon Sep 17 00:00:00 2001 From: kharhamel Date: Tue, 11 May 2021 16:44:31 +0200 Subject: [PATCH] FIX: trackDirtyAnims now listen to more generic events --- front/src/Phaser/Game/DirtyScene.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/src/Phaser/Game/DirtyScene.ts b/front/src/Phaser/Game/DirtyScene.ts index 03ec9a95..27ebd3cb 100644 --- a/front/src/Phaser/Game/DirtyScene.ts +++ b/front/src/Phaser/Game/DirtyScene.ts @@ -2,6 +2,7 @@ import {ResizableScene} from "../Login/ResizableScene"; import GameObject = Phaser.GameObjects.GameObject; import Events = Phaser.Scenes.Events; import AnimationEvents = Phaser.Animations.Events; +import StructEvents = Phaser.Structs.Events; /** * A scene that can track its dirty/pristine state. @@ -23,12 +24,11 @@ export abstract class DirtyScene extends ResizableScene { } this.isAlreadyTracking = true; const trackAnimationFunction = this.trackAnimation.bind(this); - this.events.on(Events.ADDED_TO_SCENE, (gameObject: GameObject) => { + this.sys.updateList.on(StructEvents.PROCESS_QUEUE_ADD, (gameObject: GameObject) => { this.objectListChanged = true; gameObject.on(AnimationEvents.ANIMATION_UPDATE, trackAnimationFunction); }); - - this.events.on(Events.REMOVED_FROM_SCENE, (gameObject: GameObject) => { + this.sys.updateList.on(StructEvents.PROCESS_QUEUE_REMOVE, (gameObject: GameObject) => { this.objectListChanged = true; gameObject.removeListener(AnimationEvents.ANIMATION_UPDATE, trackAnimationFunction); });