recovery stuff

This commit is contained in:
ntr
2019-01-07 20:36:52 +11:00
parent 23aafe1e80
commit f704b80dfb
2 changed files with 6 additions and 28 deletions
+1 -26
View File
@@ -41,7 +41,6 @@ class StatSheet extends Phaser.Scene {
this.addStats(cryp);
this.addKnownSkills(cryp);
this.addLearnableSkills(cryp);
this.addControls();
}
updateData(parent, key, data) {
@@ -67,19 +66,6 @@ class StatSheet extends Phaser.Scene {
CRYP_STATS.forEach(crypStat);
}
addControls() {
const infoCback = () => {
this.forget = false;
this.addKnownSkills(this.cryp);
};
const forgetCback = () => {
this.forget = true;
this.addKnownSkills(this.cryp);
};
addButton(this, menuX, menuY, infoCback, 'Skill\nInfo');
addButton(this, menuX + menuWidth * 1.1, menuY, forgetCback, 'Forget\nSkills');
}
addKnownSkills(cryp) {
if (this.knownSkills) this.knownSkills.destroy(true);
this.knownSkills = this.add.group();
@@ -94,18 +80,7 @@ class StatSheet extends Phaser.Scene {
this.knownSkills.add(this.add.text(menuX, SKILL_Y, skill.skill, style)
.setInteractive()
.on('pointerdown', () => {
if (this.forget) {
this.registry.get('ws').sendCrypForget(cryp.id, skill.skill);
}
})
.on('pointerover', (pointer) => {
if (!this.forget) {
const { description } = SKILLS.LEARNABLE.find(s => s.name === skill.skill);
this.displaySkillText(SKILL_X, SKILL_Y, description, pointer);
}
})
.on('pointerout', () => {
if (this.skillText) this.skillText.destroy();
this.registry.get('ws').sendCrypForget(cryp.id, skill.skill);
}));
};
cryp.skills.forEach(knownSkill);