diff --git a/src/ui/battle-info/battle-info.ts b/src/ui/battle-info/battle-info.ts index 3b4c3dc3fc3..0ded38b4a76 100644 --- a/src/ui/battle-info/battle-info.ts +++ b/src/ui/battle-info/battle-info.ts @@ -264,7 +264,8 @@ export default abstract class BattleInfo extends Phaser.GameObjects.Container { .on("pointerout", () => globalScene.ui.hideTooltip()); } - /** Called by {@linkcode initInfo} to initialize the shiny icon + /** + * Called by {@linkcode initInfo} to initialize the shiny icon * @param pokemon - The pokemon object attached to this battle info * @param baseXOffset - The x offset to use for the shiny icon * @param doubleShiny - Whether the pokemon is shiny and its fusion species is also shiny @@ -379,9 +380,10 @@ export default abstract class BattleInfo extends Phaser.GameObjects.Container { } //#endregion - getTextureName(): string { - return `pbinfo_${this.player ? "player" : "enemy"}${!this.player && this.boss ? "_boss" : this.mini ? "_mini" : ""}`; - } + /** + * Return the texture name of the battle info box + */ + abstract getTextureName(): string; setMini(_mini: boolean): void {} @@ -424,7 +426,7 @@ export default abstract class BattleInfo extends Phaser.GameObjects.Container { } } - /** Update the pokemon name inside the container ,*/ + /** Update the pokemon name inside the container */ protected updateName(name: string): boolean { if (this.lastName === name) { return false; diff --git a/src/ui/battle-info/enemy-battle-info.ts b/src/ui/battle-info/enemy-battle-info.ts index 956d70bf6eb..5fba74b1113 100644 --- a/src/ui/battle-info/enemy-battle-info.ts +++ b/src/ui/battle-info/enemy-battle-info.ts @@ -27,6 +27,10 @@ export class EnemyBattleInfo extends BattleInfo { return [Stat.HP, Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.ACC, Stat.EVA, Stat.SPD]; } + override getTextureName(): string { + return this.boss ? "pbinfo_enemy_boss_mini" : "pbinfo_enemy_mini"; + } + constructor() { super(140, -141, false); diff --git a/src/ui/battle-info/player-battle-info.ts b/src/ui/battle-info/player-battle-info.ts index 77a1065dc56..ab135b334f7 100644 --- a/src/ui/battle-info/player-battle-info.ts +++ b/src/ui/battle-info/player-battle-info.ts @@ -12,6 +12,11 @@ export class PlayerBattleInfo extends BattleInfo { override get statOrder(): Stat[] { return [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.ACC, Stat.EVA, Stat.SPD]; } + + override getTextureName(): string { + return this.mini ? "pbinfo_player_mini" : "pbinfo_player"; + } + constructor() { super(Math.floor(globalScene.game.canvas.width / 6) - 10, -72, true); @@ -55,6 +60,7 @@ export class PlayerBattleInfo extends BattleInfo { this.statValuesContainer.setPosition(8, 7); } + override setMini(mini: boolean): void { if (this.mini === mini) { return; @@ -166,7 +172,9 @@ export class PlayerBattleInfo extends BattleInfo { }); } - /** Updates the info on the info bar. + /** + * Updates the info on the info bar. + * * In addition to performing all the steps of {@linkcode BattleInfo.updateInfo}, * it also updates the EXP Bar */