From 416079da88e66a9e08de42ae820ad280916345e2 Mon Sep 17 00:00:00 2001 From: EmberCM Date: Sat, 13 Jul 2024 23:37:07 -0500 Subject: [PATCH] [QoL] Offset the status indicator to keep pokeball in view (#2966) * Offset the status indicator to keep pokeball in view * Only use offsetX when the Pokemon is the enemy * Adjust position to accomodate boss health bar --- src/ui/battle-info.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index ec6fee85f98..6d90e0b4fe2 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -118,7 +118,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.championRibbon.setName("icon_champion_ribbon"); this.championRibbon.setVisible(false); this.championRibbon.setOrigin(0, 0); - this.championRibbon.setPositionRelative(this.nameText, 11.75, 11.75); + this.championRibbon.setPositionRelative(this.nameText, 8, 11.75); this.add(this.championRibbon); } @@ -538,11 +538,11 @@ export default class BattleInfo extends Phaser.GameObjects.Container { if (this.lastStatus !== StatusEffect.NONE) { this.statusIndicator.setFrame(StatusEffect[this.lastStatus].toLowerCase()); } - this.statusIndicator.setVisible(!!this.lastStatus); - if (!this.player && this.ownedIcon.visible) { - this.ownedIcon.setAlpha(this.statusIndicator.visible ? 0 : 1); - } + const offsetX = !this.player ? (this.ownedIcon.visible ? 8 : 0) + (this.championRibbon.visible ? 8 : 0) : 0; + this.statusIndicator.setPositionRelative(this.nameText, offsetX, 11.5); + + this.statusIndicator.setVisible(!!this.lastStatus); } const types = pokemon.getTypes(true);