[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
This commit is contained in:
EmberCM 2024-07-13 23:37:07 -05:00 committed by GitHub
parent 8d5bfa51e8
commit 416079da88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);