From 4a0d00888796d8214d40a42a26a1cd07f67e1bd5 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Tue, 27 May 2025 12:25:58 -0500 Subject: [PATCH] Ensure hp number display fades in/out --- src/ui/battle-info/player-battle-info.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/ui/battle-info/player-battle-info.ts b/src/ui/battle-info/player-battle-info.ts index ab135b334f7..2a19f2c690c 100644 --- a/src/ui/battle-info/player-battle-info.ts +++ b/src/ui/battle-info/player-battle-info.ts @@ -21,7 +21,9 @@ export class PlayerBattleInfo extends BattleInfo { super(Math.floor(globalScene.game.canvas.width / 6) - 10, -72, true); this.hpNumbersContainer = globalScene.add.container(-15, 10).setName("container_hp"); - this.add(this.hpNumbersContainer); + + // hp number container must be beneath the stat container for overlay to display properly + this.addAt(this.hpNumbersContainer, this.getIndex(this.statsContainer)); const expBar = globalScene.add.image(-98, 18, "overlay_exp").setName("overlay_exp").setOrigin(0); this.add(expBar); @@ -41,16 +43,6 @@ export class PlayerBattleInfo extends BattleInfo { this.expMaskRect = expMaskRect; } - /** - * Toggle the stat overlay, ensuring that the hp numbers container is hidden while the stats are visible. - * @param visible - Whether the stats should be visible or not. - */ - override toggleStats(visible: boolean): void { - // Need to make the hp numbers container invisible - this.hpNumbersContainer.setVisible(!visible); - super.toggleStats(visible); - } - override initInfo(pokemon: PlayerPokemon): void { super.initInfo(pokemon); this.setHpNumbers(pokemon.hp, pokemon.getMaxHp());