put clicks abck in

This commit is contained in:
ntr 2018-11-28 22:29:18 +11:00
parent 6f44ada3d9
commit 5c9af086bd
2 changed files with 10 additions and 12 deletions

View File

@ -194,4 +194,4 @@ class CombatCryps extends Phaser.GameObjects.Group {
}
}
module.exports = CombatCryps;
module.exports = { CombatCryps, CrypImage, CrypSkill };

View File

@ -3,7 +3,7 @@ const fs = require('fs');
const { throttle } = require('lodash');
const { POSITIONS: { COMBAT }, TEXT } = require('./constants');
const CombatCryps = require('./combat.cryps');
const { CombatCryps, CrypImage, CrypSkill } = require('./combat.cryps');
const renderResolutions = require('./combat.render.resolutions');
const CRYP_KEY_MAP = ['keydown_ONE', 'keydown_TWO', 'keydown_THREE'];
@ -33,14 +33,14 @@ class Combat extends Phaser.Scene {
this.registry.set('game', null);
}, 0, this);
// this.input.on('pointerup', (pointer, obj) => {
// if (obj[0] instanceof CrypImage || obj[0] instanceof CrypSkill) {
// obj[0].clickHandler();
// } else if (this.registry.get('activeSkill')) {
// this.registry.get('activeSkill').clearTint();
// this.registry.set('activeSkill', null);
// }
// });
this.input.on('pointerup', (pointer, obj) => {
if (obj[0] instanceof CrypImage || obj[0] instanceof CrypSkill) {
obj[0].clickHandler();
} else if (this.registry.get('activeSkill')) {
this.registry.get('activeSkill').clearTint();
this.registry.set('activeSkill', null);
}
});
this.combatCryps = new CombatCryps(this);
@ -82,8 +82,6 @@ class Combat extends Phaser.Scene {
// do we need to render resolution animations?
if (game.resolved.length !== this.renderedResolves) {
// Turn skills off...in future we might get it to show something else instead
this.combatCryps.removeSkills();
const newResolutions = game.resolved.slice(this.renderedResolves);
renderResolutions(this, game, this.combatCryps, newResolutions);
this.renderedResolves = game.resolved.length;