diff --git a/public/images/ui/party_slot_main_short.json b/public/images/ui/party_slot_main_short.json new file mode 100644 index 00000000000..d738d524a5b --- /dev/null +++ b/public/images/ui/party_slot_main_short.json @@ -0,0 +1,146 @@ +{ + "textures": [ + { + "image": "party_slot_main_short.png", + "format": "RGBA8888", + "size": { + "w": 110, + "h": 294 + }, + "scale": 1, + "frames": [ + { + "filename": "party_slot_main_short", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 110, + "h": 41 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 110, + "h": 41 + }, + "frame": { + "x": 0, + "y": 0, + "w": 110, + "h": 41 + } + }, + { + "filename": "party_slot_main_short_sel", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 110, + "h": 41 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 110, + "h": 41 + }, + "frame": { + "x": 0, + "y": 41, + "w": 110, + "h": 41 + } + }, + { + "filename": "party_slot_main_short_fnt", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 110, + "h": 41 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 110, + "h": 41 + }, + "frame": { + "x": 0, + "y": 82, + "w": 110, + "h": 41 + } + }, + { + "filename": "party_slot_main_short_fnt_sel", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 110, + "h": 41 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 110, + "h": 41 + }, + "frame": { + "x": 0, + "y": 123, + "w": 110, + "h": 41 + } + }, + { + "filename": "party_slot_main_short_swap", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 110, + "h": 41 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 110, + "h": 41 + }, + "frame": { + "x": 0, + "y": 164, + "w": 110, + "h": 41 + } + }, + { + "filename": "party_slot_main_short_swap_sel", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 110, + "h": 41 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 110, + "h": 41 + }, + "frame": { + "x": 0, + "y": 205, + "w": 110, + "h": 41 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:29685f2f538901cf5bf7f0ed2ea867c3:a080ea6c8cccd1e03244214053e79796:565f7afc5ca419b6ba8dbce51ea30818$" + } +} diff --git a/public/images/ui/party_slot_main_short.png b/public/images/ui/party_slot_main_short.png new file mode 100644 index 00000000000..235810db3ac Binary files /dev/null and b/public/images/ui/party_slot_main_short.png differ diff --git a/src/loading-scene.ts b/src/loading-scene.ts index c5b0263e785..740bfab8fce 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -121,6 +121,7 @@ export class LoadingScene extends SceneBase { this.loadImage("party_bg_double", "ui"); this.loadImage("party_bg_double_manage", "ui"); this.loadAtlas("party_slot_main", "ui"); + this.loadAtlas("party_slot_main_short", "ui"); this.loadAtlas("party_slot", "ui"); this.loadImage("party_slot_overlay_lv", "ui"); this.loadImage("party_slot_hp_bar", "ui"); diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index c1951a633c2..a90f2082a0f 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -1817,6 +1817,7 @@ class PartySlot extends Phaser.GameObjects.Container { public slotHpText: Phaser.GameObjects.Text; public slotDescriptionLabel: Phaser.GameObjects.Text; // this is used to show text instead of the HP bar i.e. for showing "Able"/"Not Able" for TMs when you try to learn them + private slotBgKey: string; private pokemonIcon: Phaser.GameObjects.Container; private iconAnimHandler: PokemonIconAnimHandler; @@ -1868,10 +1869,15 @@ class PartySlot extends Phaser.GameObjects.Container { setup(partyUiMode: PartyUiMode, tmMoveId: MoveId) { const currentLanguage = i18next.resolvedLanguage ?? "en"; const offsetJa = currentLanguage === "ja"; + const isItemManageMode = partyUiMode === PartyUiMode.MODIFIER_TRANSFER || partyUiMode === PartyUiMode.DISCARD; - const slotKey = this.isBenched ? "party_slot" : "party_slot_main"; - const slotBgKey = this.pokemon.hp ? slotKey : `${slotKey}${"_fnt"}`; - this.slotBg = globalScene.add.sprite(0, 0, slotKey, slotBgKey); + const slotKey = this.isBenched + ? "party_slot" + : isItemManageMode && globalScene.currentBattle.double + ? "party_slot_main_short" + : "party_slot_main"; + this.slotBgKey = this.pokemon.hp ? slotKey : `${slotKey}${"_fnt"}`; + this.slotBg = globalScene.add.sprite(0, 0, slotKey, this.slotBgKey); this.slotBg.setOrigin(0); this.add(this.slotBg); @@ -1895,11 +1901,7 @@ class PartySlot extends Phaser.GameObjects.Container { descriptionLabelPosition: { x: 32, y: 46 }, }; - if ( - (partyUiMode === PartyUiMode.MODIFIER_TRANSFER || partyUiMode === PartyUiMode.DISCARD) && - globalScene.currentBattle.double && - !this.isBenched - ) { + if (isItemManageMode && globalScene.currentBattle.double && !this.isBenched) { magicNumbers.namePosition.y -= 8; magicNumbers.levelLabelPosition.y -= 8; magicNumbers.hpBarPosition.y -= 8; @@ -2121,8 +2123,8 @@ class PartySlot extends Phaser.GameObjects.Container { private updateSlotTexture(): void { this.slotBg.setTexture( - `party_slot${this.isBenched ? "" : "_main"}`, - `party_slot${this.isBenched ? "" : "_main"}${this.transfer ? "_swap" : this.pokemon.hp ? "" : "_fnt"}${this.selected ? "_sel" : ""}`, + this.slotBgKey, + `${this.slotBgKey}${this.transfer ? "_swap" : this.pokemon.hp ? "" : "_fnt"}${this.selected ? "_sel" : ""}`, ); } }