From a88157b1c8d49003e7f99cb21651662f86b1924b Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 2 Aug 2025 22:47:34 +0200 Subject: [PATCH] Added smaller main slots for transfer mode in doubles --- public/images/ui/party_slot_main_short.json | 146 ++++++++++++++++++++ public/images/ui/party_slot_main_short.png | Bin 0 -> 2543 bytes src/loading-scene.ts | 1 + src/ui/party-ui-handler.ts | 22 +-- 4 files changed, 159 insertions(+), 10 deletions(-) create mode 100644 public/images/ui/party_slot_main_short.json create mode 100644 public/images/ui/party_slot_main_short.png 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 0000000000000000000000000000000000000000..235810db3ac3bab29e8f23d6b821e5a61ec26d45 GIT binary patch literal 2543 zcmbuBdo)ygAI6QrcAb(CHd86*lyV&!8jM@WEjck!qaudFh?sO-B63NSoQ{l3G~t}W zC_5!n#!O7qG&@QuX@-znXH;kCrgu-?{(skc_gcUG-RryeU(aVf&$IJ)_<3lk>Z{7h z$!U0by6r?}9CD<}O2~an-1Vo(Kqc<jyaE4+P4;P1`N)FjEahH_^nQjTLVrH?>^yQKjDU^If<)a zv%8NbrC-(l6mnF-s`SexDF*u7@=uhEhZ9P5->h;v7Vob4JYW8|-9g{+o6p=><$PY+-1J|rb&qeB!JYS$D1$P?#HC3+KE*Zo*2laM^i!*h3 zs|$-qVk-w!H0Uj2s|wAKPy7PlfhB=n6r*lzasT#V?3)R3Rjcpd4odB9`Nlpy!&{>Q zwCa<;nv%#-!5`3fiAApM>q2X--jk&tLp$mvuFUh6JYcMYkwdK zF4gP`+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-Ane&i@n(zZ5>dvo|h<57@kMDSS%AyM*||_s@}Gt|Nb-vG^_AO*JS!tdcJ&38$cC4@pIej5zO4TMLpG+T literal 0 HcmV?d00001 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" : ""}`, ); } }