[Fix] Corrected legacy mode icons and adjusted double-battle button location

This commit is contained in:
Tiago Rodrigues 2025-06-16 21:32:22 +01:00
parent a265c37a61
commit 87c84203e7
6 changed files with 66 additions and 40 deletions

View File

@ -4,8 +4,8 @@
"image": "party_discard.png", "image": "party_discard.png",
"format": "RGBA8888", "format": "RGBA8888",
"size": { "size": {
"w": 75, "w": 52,
"h": 46 "h": 32
}, },
"scale": 1, "scale": 1,
"frames": [ "frames": [
@ -14,20 +14,20 @@
"rotated": false, "rotated": false,
"trimmed": false, "trimmed": false,
"sourceSize": { "sourceSize": {
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"spriteSourceSize": { "spriteSourceSize": {
"x": 0, "x": 0,
"y": 0, "y": 0,
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"frame": { "frame": {
"x": 0, "x": 0,
"y": 0, "y": 0,
"w": 75, "w": 52,
"h": 23 "h": 16
} }
}, },
{ {
@ -35,20 +35,20 @@
"rotated": false, "rotated": false,
"trimmed": false, "trimmed": false,
"sourceSize": { "sourceSize": {
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"spriteSourceSize": { "spriteSourceSize": {
"x": 0, "x": 0,
"y": 0, "y": 0,
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"frame": { "frame": {
"x": 0, "x": 0,
"y": 23, "y": 16,
"w": 75, "w": 52,
"h": 23 "h": 16
} }
} }
] ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 214 B

View File

@ -1,11 +1,11 @@
{ {
"textures": [ "textures": [
{ {
"image": "party_discard.png", "image": "party_transfer.png",
"format": "RGBA8888", "format": "RGBA8888",
"size": { "size": {
"w": 75, "w": 52,
"h": 46 "h": 32
}, },
"scale": 1, "scale": 1,
"frames": [ "frames": [
@ -14,20 +14,20 @@
"rotated": false, "rotated": false,
"trimmed": false, "trimmed": false,
"sourceSize": { "sourceSize": {
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"spriteSourceSize": { "spriteSourceSize": {
"x": 0, "x": 0,
"y": 0, "y": 0,
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"frame": { "frame": {
"x": 0, "x": 0,
"y": 0, "y": 0,
"w": 75, "w": 52,
"h": 23 "h": 16
} }
}, },
{ {
@ -35,20 +35,20 @@
"rotated": false, "rotated": false,
"trimmed": false, "trimmed": false,
"sourceSize": { "sourceSize": {
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"spriteSourceSize": { "spriteSourceSize": {
"x": 0, "x": 0,
"y": 0, "y": 0,
"w": 75, "w": 52,
"h": 23 "h": 16
}, },
"frame": { "frame": {
"x": 0, "x": 0,
"y": 23, "y": 16,
"w": 75, "w": 52,
"h": 23 "h": 16
} }
} }
] ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 214 B

View File

@ -1,7 +1,7 @@
{ {
"textures": [ "textures": [
{ {
"image": "party_discard.png", "image": "party_transfer.png",
"format": "RGBA8888", "format": "RGBA8888",
"size": { "size": {
"w": 75, "w": 75,

View File

@ -314,6 +314,7 @@ export default class PartyUiHandler extends MessageUiHandler {
this.iconAnimHandler.setup(); this.iconAnimHandler.setup();
const partyDiscardModeButton = new PartyDiscardModeButton(60, -globalScene.game.canvas.height / 15 - 1); const partyDiscardModeButton = new PartyDiscardModeButton(60, -globalScene.game.canvas.height / 15 - 1);
partyContainer.add(partyDiscardModeButton); partyContainer.add(partyDiscardModeButton);
this.PartyDiscardModeButton = partyDiscardModeButton; this.PartyDiscardModeButton = partyDiscardModeButton;
@ -1046,10 +1047,18 @@ export default class PartyUiHandler extends MessageUiHandler {
let success = false; let success = false;
switch (button) { switch (button) {
case Button.UP: case Button.UP:
if (this.cursor === 7 && this.isItemManageMode()) { if (this.cursor === 1) {
if (this.isItemManageMode()) {
success = this.setCursor(7);
break;
}
}
if (this.cursor === 7) {
if (this.isItemManageMode()) {
success = this.setCursor(0); success = this.setCursor(0);
break; break;
} }
}
success = this.setCursor(this.cursor ? (this.cursor < 6 ? this.cursor - 1 : slotCount - 1) : 6); success = this.setCursor(this.cursor ? (this.cursor < 6 ? this.cursor - 1 : slotCount - 1) : 6);
break; break;
case Button.DOWN: case Button.DOWN:
@ -1059,6 +1068,12 @@ export default class PartyUiHandler extends MessageUiHandler {
break; break;
} }
} }
if (this.cursor === 7) {
if (this.isItemManageMode()) {
success = this.setCursor(1);
break;
}
}
success = this.setCursor(this.cursor < 6 ? (this.cursor < slotCount - 1 ? this.cursor + 1 : 6) : 0); success = this.setCursor(this.cursor < 6 ? (this.cursor < slotCount - 1 ? this.cursor + 1 : 6) : 0);
break; break;
case Button.LEFT: case Button.LEFT:
@ -1750,7 +1765,7 @@ class PartySlot extends Phaser.GameObjects.Container {
? -184 + ? -184 +
(globalScene.currentBattle.double ? -40 : 0) + (globalScene.currentBattle.double ? -40 : 0) +
(28 + (globalScene.currentBattle.double ? 8 : 0)) * slotIndex (28 + (globalScene.currentBattle.double ? 8 : 0)) * slotIndex
: -124 + (globalScene.currentBattle.double ? -8 : 0) + slotIndex * 64, : -124 + (globalScene.currentBattle.double ? -20 : 0) + slotIndex * 76,
); );
this.slotIndex = slotIndex; this.slotIndex = slotIndex;
@ -2006,7 +2021,6 @@ class PartySlot extends Phaser.GameObjects.Container {
class PartyCancelButton extends Phaser.GameObjects.Container { class PartyCancelButton extends Phaser.GameObjects.Container {
private selected: boolean; private selected: boolean;
private partyCancelBg: Phaser.GameObjects.Sprite; private partyCancelBg: Phaser.GameObjects.Sprite;
private partyCancelPb: Phaser.GameObjects.Sprite; private partyCancelPb: Phaser.GameObjects.Sprite;
@ -2015,7 +2029,6 @@ class PartyCancelButton extends Phaser.GameObjects.Container {
this.setup(); this.setup();
} }
setup() { setup() {
const partyCancelBg = globalScene.add.sprite(0, 0, "party_cancel"); const partyCancelBg = globalScene.add.sprite(0, 0, "party_cancel");
this.add(partyCancelBg); this.add(partyCancelBg);
@ -2059,6 +2072,7 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
private transferIcon: Phaser.GameObjects.Sprite; private transferIcon: Phaser.GameObjects.Sprite;
private discardIcon: Phaser.GameObjects.Sprite; private discardIcon: Phaser.GameObjects.Sprite;
private partyDiscardPb: Phaser.GameObjects.Sprite;
private textBox: Phaser.GameObjects.Text; private textBox: Phaser.GameObjects.Text;
constructor(x: number, y: number) { constructor(x: number, y: number) {
@ -2068,12 +2082,14 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
} }
setup() { setup() {
this.transferIcon = globalScene.add.sprite(0, 0, "party_transfer", "normal"); this.transferIcon = globalScene.add.sprite(0, 0, "party_transfer");
this.discardIcon = globalScene.add.sprite(0, 0, "party_discard", "normal"); this.discardIcon = globalScene.add.sprite(0, 0, "party_discard");
this.partyDiscardPb = globalScene.add.sprite(-20, 0, "party_pb");
this.textBox = addTextObject(-8, -7, i18next.t("partyUiHandler:TRANSFER"), TextStyle.PARTY); this.textBox = addTextObject(-8, -7, i18next.t("partyUiHandler:TRANSFER"), TextStyle.PARTY);
this.add(this.transferIcon); this.add(this.transferIcon);
this.add(this.discardIcon); this.add(this.discardIcon);
this.add(this.partyDiscardPb);
this.add(this.textBox); this.add(this.textBox);
this.clear(); this.clear();
@ -2088,6 +2104,7 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
this.transferIcon.setFrame("selected"); this.transferIcon.setFrame("selected");
this.discardIcon.setFrame("selected"); this.discardIcon.setFrame("selected");
this.partyDiscardPb.setFrame("party_pb_sel");
} }
deselect() { deselect() {
@ -2099,6 +2116,7 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
this.transferIcon.setFrame("normal"); this.transferIcon.setFrame("normal");
this.discardIcon.setFrame("normal"); this.discardIcon.setFrame("normal");
this.partyDiscardPb.setFrame("party_pb");
} }
toggleIcon(partyMode: number) { toggleIcon(partyMode: number) {
@ -2108,6 +2126,10 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
this.discardIcon.setVisible(false); this.discardIcon.setVisible(false);
this.textBox.setVisible(true); this.textBox.setVisible(true);
this.textBox.setText(i18next.t("partyUiHandler:TRANSFER")); this.textBox.setText(i18next.t("partyUiHandler:TRANSFER"));
this.setPosition(
globalScene.currentBattle.double ? 64 : 60,
globalScene.currentBattle.double ? -106 : -globalScene.game.canvas.height / 15 - 1,
);
this.transferIcon.displayWidth = this.textBox.text.length * 9 + 3; this.transferIcon.displayWidth = this.textBox.text.length * 9 + 3;
break; break;
case PartyUiMode.MODIFIER_TRANSFER: case PartyUiMode.MODIFIER_TRANSFER:
@ -2115,6 +2137,10 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
this.discardIcon.setVisible(true); this.discardIcon.setVisible(true);
this.textBox.setVisible(true); this.textBox.setVisible(true);
this.textBox.setText("Discard"); this.textBox.setText("Discard");
this.setPosition(
globalScene.currentBattle.double ? 64 : 60,
globalScene.currentBattle.double ? -106 : -globalScene.game.canvas.height / 15 - 1,
);
this.discardIcon.displayWidth = this.textBox.text.length * 9 + 3; this.discardIcon.displayWidth = this.textBox.text.length * 9 + 3;
break; break;
default: default: