From 7c74018dbf6083c6cf5915dd3fde7f392a89f5bd Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 19 Nov 2018 23:15:49 +1100 Subject: [PATCH] no more scene restarts monkaS --- client/src/scenes/cryp.list.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/src/scenes/cryp.list.js b/client/src/scenes/cryp.list.js index 97869dda..e48124e8 100644 --- a/client/src/scenes/cryp.list.js +++ b/client/src/scenes/cryp.list.js @@ -9,16 +9,14 @@ class CrypList extends Phaser.Scene { create() { this.registry.events.on('changedata', this.updateData, this); - - const cryps = this.registry.get('cryps'); this.graphics = this.add.graphics(); - this.renderCryps(cryps); + return true; } updateData(parent, key, data) { if (key === 'cryps') { - return this.scene.restart(); + this.renderCryps(data); } return true; } @@ -32,14 +30,14 @@ class CrypList extends Phaser.Scene { this.destroyText(); this.graphics.clear(); - const crypRows = cryps.forEach((cryp, i) => { + cryps.forEach((cryp, i) => { crypRow(this, cryp, i); }); this.input.on('gameobjectup', this.clickHandler, this); // seal the boxes in and stop rerendering them - // this.graphics.generateTexture(); + this.graphics.generateTexture(); return true; }