Update spacing of icons upon Name/Tera update (#655)

This change will update the relative position of the Tera, Splice, and Shiny icons when the Name or Tera Type updates. Fixes #618
This commit is contained in:
Reid McInroy 2024-05-09 00:18:26 -04:00 committed by GitHub
parent e39b157767
commit c6749b1fb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -417,7 +417,10 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
if (nameUpdated || teraTypeUpdated) {
this.splicedIcon.setVisible(!!pokemon.fusionSpecies);
this.teraIcon.setPositionRelative(this.nameText, this.nameText.displayWidth + this.genderText.displayWidth + 1, 2);
this.splicedIcon.setPositionRelative(this.nameText, this.nameText.displayWidth + this.genderText.displayWidth + 1 + (this.teraIcon.visible ? this.teraIcon.displayWidth + 1 : 0), 1.5);
this.shinyIcon.setPositionRelative(this.nameText, this.nameText.displayWidth + this.genderText.displayWidth + 1 + (this.teraIcon.visible ? this.teraIcon.displayWidth + 1 : 0) + (this.splicedIcon.visible ? this.splicedIcon.displayWidth + 1 : 0), 2.5);
}
if (this.lastStatus !== (pokemon.status?.effect || StatusEffect.NONE)) {