remove team check fixed scene swap

This commit is contained in:
Mashy
2018-12-04 20:26:17 +10:00
parent 8df814d1a6
commit 681b9dab4e
4 changed files with 23 additions and 16 deletions
+1 -4
View File
@@ -104,10 +104,7 @@ class Combat extends Phaser.Scene {
}
// update log
// shallow copy because reverse mutates
const content = Array.from(game.log).reverse().join('\n');
// this.log.setText(Array.from(game.log).reverse());
console.log(this.log);
this.log.setText(content);
this.log.setText(Array.from(game.log).reverse());
// has the phase changed?
const phaseChange = (this.registry.get('gamePhase') === game.phase);
if (phaseChange) return false;
+7 -1
View File
@@ -11,8 +11,14 @@ class CrypList extends Phaser.Scene {
}
create() {
this.registry.events.off('changedata', this.updateData, this);
this.registry.events.off('setdata', this.updateData, this);
this.registry.events.on('changedata', this.updateData, this);
this.registry.events.on('setdata', this.updateData, this);
if (this.registry.get('cryps')) {
this.renderList();
this.renderGameList();
}
return true;
}
@@ -60,7 +66,7 @@ class CrypList extends Phaser.Scene {
if (cryp) {
this.scene.add('StatSheet', StatSheet);
this.scene.run('StatSheet', { cryp });
this.scene.sleep();
this.scene.stop();
}
return true;
}
+2
View File
@@ -20,6 +20,8 @@ class StatSheet extends Phaser.Scene {
this.cryp = cryp;
this.stats = new Stats(this, cryp);
this.addControls(cryp);
this.addSkills(cryp);
this.skills = true;
}
addControls(cryp) {