From 95c7d3400984d02b10430a561af7c6dc2bb33a5d Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Wed, 23 Apr 2025 10:05:26 -0500 Subject: [PATCH] Cleanup enemybattleinfo constructor to use chaining --- src/ui/battle-info/enemy-battle-info.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/ui/battle-info/enemy-battle-info.ts b/src/ui/battle-info/enemy-battle-info.ts index eb55cd07ee9..7df93bf35c5 100644 --- a/src/ui/battle-info/enemy-battle-info.ts +++ b/src/ui/battle-info/enemy-battle-info.ts @@ -25,17 +25,15 @@ export class EnemyBattleInfo extends BattleInfo { constructor() { super(140, -141, false); - this.ownedIcon = globalScene.add.sprite(0, 0, "icon_owned"); - this.ownedIcon.setName("icon_owned"); - this.ownedIcon.setVisible(false); - this.ownedIcon.setOrigin(0, 0); + this.ownedIcon = globalScene.add.sprite(0, 0, "icon_owned").setName("icon_owned").setVisible(false).setOrigin(0, 0); this.ownedIcon.setPositionRelative(this.nameText, 0, 11.75); this.add(this.ownedIcon); - this.championRibbon = globalScene.add.sprite(0, 0, "champion_ribbon"); - this.championRibbon.setName("icon_champion_ribbon"); - this.championRibbon.setVisible(false); - this.championRibbon.setOrigin(0, 0); + this.championRibbon = globalScene.add + .sprite(0, 0, "champion_ribbon") + .setName("icon_champion_ribbon") + .setVisible(false) + .setOrigin(0, 0); this.championRibbon.setPositionRelative(this.nameText, 8, 11.75); this.add(this.championRibbon); @@ -44,16 +42,14 @@ export class EnemyBattleInfo extends BattleInfo { this.moveBelow(this.flyoutMenu, this.box); - this.effectivenessContainer = globalScene.add.container(0, 0); + this.effectivenessContainer = globalScene.add.container(0, 0).setVisible(false); this.effectivenessContainer.setPositionRelative(this.type1Icon, 22, 4); - this.effectivenessContainer.setVisible(false); this.add(this.effectivenessContainer); this.effectivenessText = addTextObject(5, 4.5, "", TextStyle.BATTLE_INFO); this.effectivenessWindow = addWindow(0, 0, 0, 20, undefined, false, undefined, undefined, WindowVariant.XTHIN); - this.effectivenessContainer.add(this.effectivenessWindow); - this.effectivenessContainer.add(this.effectivenessText); + this.effectivenessContainer.add([this.effectivenessWindow, this.effectivenessText]); } setMini(_mini: boolean): void {} // Always mini