Address kev's review comments

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Sirz Benjie 2025-05-27 12:23:49 -05:00
parent 4abe3ea566
commit 970f6841db
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
3 changed files with 20 additions and 6 deletions

View File

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

View File

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

View File

@ -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
*/