diff --git a/client/src/scenes/cryp.list.js b/client/src/scenes/cryp.list.js index 7bb8f5c0..4abe6d38 100755 --- a/client/src/scenes/cryp.list.js +++ b/client/src/scenes/cryp.list.js @@ -10,7 +10,6 @@ class CrypList extends Phaser.Scene { create() { this.registry.events.on('changedata', this.updateData, this); - this.input.on('gameobjectup', this.clickHandler, this); return true; } @@ -33,12 +32,7 @@ class CrypList extends Phaser.Scene { } this.CrypPage = new CrypPage(this, cryp); } - } - - clickHandler(pointer, crypBox) { - this.displaySkills(crypBox.cryp); return true; - // this.registry.get('ws').sendGamePve(crypBox.cryp.id); } } diff --git a/client/src/scenes/cryp.row.js b/client/src/scenes/cryp.row.js index 0d279946..bd5db5e2 100755 --- a/client/src/scenes/cryp.row.js +++ b/client/src/scenes/cryp.row.js @@ -16,14 +16,17 @@ const yPos = i => (i * ROW_HEIGHT + ROW_MARGIN) + TOP_MARGIN; class CrypRow extends Phaser.GameObjects.Group { constructor(list, cryps) { super(list); + this.cryps = cryps; cryps.forEach((cryp, i) => { const X_ORIGIN = xPos(i); const Y_ORIGIN = yPos(i); const row = list.add.rectangle(X_ORIGIN, Y_ORIGIN, ROW_WIDTH, ROW_HEIGHT, ROW_FILL * Math.random()) .setInteractive() .setOrigin(0); - row.cryp = cryp; + row.on('pointerdown', () => { + list.displaySkills(cryp); + }); this.add(row); this.add(list.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 0), cryp.name, TEXT.HEADER)); this.add(list.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 1), cryp.stamina.base, TEXT.NORMAL));