From 743e45b0f00a486137c89fe4d7765a8f58096dc1 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 27 Oct 2017 17:54:03 +0200 Subject: [PATCH] housekeeping for delayed instance --- src/game-lib-a-component-a.js | 7 +++++++ src/game-lib-system-input.js | 1 - src/game-lib-system-storage.js | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/game-lib-a-component-a.js b/src/game-lib-a-component-a.js index 7586488..6a1c959 100644 --- a/src/game-lib-a-component-a.js +++ b/src/game-lib-a-component-a.js @@ -119,6 +119,13 @@ GameLib.Component.prototype.createInstance = function() { console.log('create instance : '+ this.name); + /** + * When you do actually call 'createInstance' - it is wise to state we are no longer delayed - we assume the caller + * knows when to call createInstance, so we do the housekeeping here + * @type {boolean} + */ + this.delayed = false; + if (this.instance) { this.loaded = true; diff --git a/src/game-lib-system-input.js b/src/game-lib-system-input.js index 46cef8f..0c4a43d 100644 --- a/src/game-lib-system-input.js +++ b/src/game-lib-system-input.js @@ -164,7 +164,6 @@ GameLib.System.Input.prototype.start = function() { false ); - editorControl.delayed = false; editorControl.createInstance(); editorControl.domElement.instance.addEventListener( diff --git a/src/game-lib-system-storage.js b/src/game-lib-system-storage.js index 6fb5f79..311b80f 100644 --- a/src/game-lib-system-storage.js +++ b/src/game-lib-system-storage.js @@ -1005,8 +1005,6 @@ GameLib.System.Storage.prototype.loadImage = function(data) { image.instance = img; - image.delayed = false; - image.createInstance(); if (onLoaded) {