Misc frontend fixes
This commit is contained in:
@@ -36,16 +36,9 @@ class StatSheet extends Phaser.Scene {
|
||||
this.registry.events.on('changedata', this.updateData, this);
|
||||
this.cryp = cryp;
|
||||
this.forget = false;
|
||||
|
||||
const crypStat = (stat, i) => {
|
||||
const STAT_X = WIDTH / 10;
|
||||
const STAT_Y = (i + 1) * TEXT_MARGIN;
|
||||
this.add.text(STAT_X, STAT_Y, `${stat.stat}: ${stat.base}`, TEXT.NORMAL);
|
||||
};
|
||||
|
||||
const CRYP_STATS = [cryp.stamina, cryp.phys_dmg, cryp.spell_dmg];
|
||||
this.add.text(WIDTH / 10, 0, cryp.name, TEXT.HEADER);
|
||||
CRYP_STATS.forEach(crypStat);
|
||||
|
||||
this.addStats(cryp);
|
||||
this.addKnownSkills(cryp);
|
||||
this.addLearnableSkills(cryp);
|
||||
this.addControls();
|
||||
@@ -56,9 +49,24 @@ class StatSheet extends Phaser.Scene {
|
||||
const cryp = data.find(c => c.id === this.cryp.id);
|
||||
this.cryp = cryp;
|
||||
this.addKnownSkills(cryp);
|
||||
this.addStats(cryp);
|
||||
}
|
||||
}
|
||||
|
||||
addStats(cryp) {
|
||||
if (this.stats) this.stats.destroy(true);
|
||||
this.stats = this.add.group();
|
||||
|
||||
const crypStat = (stat, i) => {
|
||||
const STAT_X = WIDTH / 10;
|
||||
const STAT_Y = (i + 1) * TEXT_MARGIN;
|
||||
this.stats.add(this.add
|
||||
.text(STAT_X, STAT_Y, `${stat.stat}: ${stat.base}`, TEXT.NORMAL));
|
||||
};
|
||||
const CRYP_STATS = [cryp.stamina, cryp.phys_dmg, cryp.spell_dmg];
|
||||
CRYP_STATS.forEach(crypStat);
|
||||
}
|
||||
|
||||
addControls() {
|
||||
const infoCback = () => {
|
||||
this.forget = false;
|
||||
|
||||
Reference in New Issue
Block a user