Update Biome Text Labels and Variable Name (#1340)
* Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object.
* Revert "Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object."
This reverts commit 0f87000aa4
.
* Reverted changes, added biome text to line one and renamed wavecounttext to a more standard name.
* Update battle-scene.ts
* Update Formatting
* Update Enums
* Revert
* Update overrides.ts
* Update battle-scene.ts
---------
Co-authored-by: Jon Studders <jonstudders1@gmail.com>
This commit is contained in:
parent
815b37d23c
commit
416d666b30
|
@ -151,8 +151,8 @@ export default class BattleScene extends SceneBase {
|
||||||
public money: integer;
|
public money: integer;
|
||||||
public pokemonInfoContainer: PokemonInfoContainer;
|
public pokemonInfoContainer: PokemonInfoContainer;
|
||||||
private party: PlayerPokemon[];
|
private party: PlayerPokemon[];
|
||||||
private lineOneText: Phaser.GameObjects.Text;
|
/** Combined Biome and Wave count text */
|
||||||
private waveCountText: Phaser.GameObjects.Text;
|
private biomeWaveText: Phaser.GameObjects.Text;
|
||||||
private moneyText: Phaser.GameObjects.Text;
|
private moneyText: Phaser.GameObjects.Text;
|
||||||
private scoreText: Phaser.GameObjects.Text;
|
private scoreText: Phaser.GameObjects.Text;
|
||||||
private luckLabelText: Phaser.GameObjects.Text;
|
private luckLabelText: Phaser.GameObjects.Text;
|
||||||
|
@ -351,9 +351,9 @@ export default class BattleScene extends SceneBase {
|
||||||
this.candyBar.setup();
|
this.candyBar.setup();
|
||||||
this.fieldUI.add(this.candyBar);
|
this.fieldUI.add(this.candyBar);
|
||||||
|
|
||||||
this.lineOneText = addTextObject(this, (this.game.canvas.width / 6) - 2, 0, startingWave.toString(), TextStyle.BATTLE_INFO);
|
this.biomeWaveText = addTextObject(this, (this.game.canvas.width / 6) - 2, 0, startingWave.toString(), TextStyle.BATTLE_INFO);
|
||||||
this.lineOneText.setOrigin(1, 0);
|
this.biomeWaveText.setOrigin(1, 0);
|
||||||
this.fieldUI.add(this.lineOneText);
|
this.fieldUI.add(this.biomeWaveText);
|
||||||
|
|
||||||
this.moneyText = addTextObject(this, (this.game.canvas.width / 6) - 2, 0, "", TextStyle.MONEY);
|
this.moneyText = addTextObject(this, (this.game.canvas.width / 6) - 2, 0, "", TextStyle.MONEY);
|
||||||
this.moneyText.setOrigin(1, 0);
|
this.moneyText.setOrigin(1, 0);
|
||||||
|
@ -481,7 +481,7 @@ export default class BattleScene extends SceneBase {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.updateLineOneText();
|
this.updateBiomeWaveText();
|
||||||
this.updateMoneyText();
|
this.updateMoneyText();
|
||||||
this.updateScoreText();
|
this.updateScoreText();
|
||||||
}
|
}
|
||||||
|
@ -795,8 +795,8 @@ export default class BattleScene extends SceneBase {
|
||||||
|
|
||||||
this.currentBattle = null;
|
this.currentBattle = null;
|
||||||
|
|
||||||
this.lineOneText.setText(startingWave.toString());
|
this.biomeWaveText.setText(startingWave.toString());
|
||||||
this.lineOneText.setVisible(false);
|
this.biomeWaveText.setVisible(false);
|
||||||
|
|
||||||
this.updateMoneyText();
|
this.updateMoneyText();
|
||||||
this.moneyText.setVisible(false);
|
this.moneyText.setVisible(false);
|
||||||
|
@ -1245,13 +1245,13 @@ export default class BattleScene extends SceneBase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLineOneText(): void {
|
updateBiomeWaveText(): void {
|
||||||
const isBoss = !(this.currentBattle.waveIndex % 10);
|
const isBoss = !(this.currentBattle.waveIndex % 10);
|
||||||
const biomeString: string = getBiomeName(this.arena.biomeType);
|
const biomeString: string = getBiomeName(this.arena.biomeType);
|
||||||
this.lineOneText.setText( biomeString + " - " + this.currentBattle.waveIndex.toString());
|
this.biomeWaveText.setText( biomeString + " - " + this.currentBattle.waveIndex.toString());
|
||||||
this.lineOneText.setColor(!isBoss ? "#404040" : "#f89890");
|
this.biomeWaveText.setColor(!isBoss ? "#404040" : "#f89890");
|
||||||
this.lineOneText.setShadowColor(!isBoss ? "#ded6b5" : "#984038");
|
this.biomeWaveText.setShadowColor(!isBoss ? "#ded6b5" : "#984038");
|
||||||
this.lineOneText.setVisible(true);
|
this.biomeWaveText.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMoneyText(): void {
|
updateMoneyText(): void {
|
||||||
|
@ -1299,8 +1299,8 @@ export default class BattleScene extends SceneBase {
|
||||||
|
|
||||||
updateUIPositions(): void {
|
updateUIPositions(): void {
|
||||||
const enemyModifierCount = this.enemyModifiers.filter(m => m.isIconVisible(this)).length;
|
const enemyModifierCount = this.enemyModifiers.filter(m => m.isIconVisible(this)).length;
|
||||||
this.lineOneText.setY(-(this.game.canvas.height / 6) + (enemyModifierCount ? enemyModifierCount <= 12 ? 15 : 24 : 0));
|
this.biomeWaveText.setY(-(this.game.canvas.height / 6) + (enemyModifierCount ? enemyModifierCount <= 12 ? 15 : 24 : 0));
|
||||||
this.moneyText.setY(this.lineOneText.y + 10);
|
this.moneyText.setY(this.biomeWaveText.y + 10);
|
||||||
this.scoreText.setY(this.moneyText.y + 10);
|
this.scoreText.setY(this.moneyText.y + 10);
|
||||||
[ this.luckLabelText, this.luckText ].map(l => l.setY((this.scoreText.visible ? this.scoreText : this.moneyText).y + 10));
|
[ this.luckLabelText, this.luckText ].map(l => l.setY((this.scoreText.visible ? this.scoreText : this.moneyText).y + 10));
|
||||||
const offsetY = (this.scoreText.visible ? this.scoreText : this.moneyText).y + 15;
|
const offsetY = (this.scoreText.visible ? this.scoreText : this.moneyText).y + 15;
|
||||||
|
|
|
@ -18,10 +18,8 @@ export function getBiomeName(biome: Biome | -1) {
|
||||||
return "Ancient Ruins";
|
return "Ancient Ruins";
|
||||||
case Biome.ABYSS:
|
case Biome.ABYSS:
|
||||||
return "The Abyss";
|
return "The Abyss";
|
||||||
case Biome.SPACE:
|
|
||||||
return "Stratosphere";
|
|
||||||
case Biome.END:
|
case Biome.END:
|
||||||
return "Final Destination";
|
return "???";
|
||||||
default:
|
default:
|
||||||
return Utils.toReadableString(Biome[biome]);
|
return Utils.toReadableString(Biome[biome]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue