slight logic changes to fix party UI controls

when battlerCount = 2 (double battle), starting in party slot 1 and pressing DOWN -> UP -> RIGHT would move the cursor back down when it should be moving it to the right: these changes fix that
This commit is contained in:
Paul 2024-04-28 01:22:00 +02:00
parent fefc6341f6
commit 8cf7577ec7

View File

@ -392,13 +392,13 @@ export default class PartyUiHandler extends MessageUiHandler {
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:
if (this.cursor >= this.scene.currentBattle.getBattlerCount() && this.cursor < 6) if (this.cursor >= this.scene.currentBattle.getBattlerCount() && this.cursor <= 6)
success = this.setCursor(0); success = this.setCursor(0);
break; break;
case Button.RIGHT: case Button.RIGHT:
const battlerCount = this.scene.currentBattle.getBattlerCount(); const battlerCount = this.scene.currentBattle.getBattlerCount();
if (slotCount > battlerCount && this.cursor < battlerCount) if (slotCount > battlerCount && this.cursor < battlerCount)
success = this.setCursor(this.lastCursor < 6 ? this.lastCursor || battlerCount : battlerCount); success = this.setCursor(this.lastCursor < 6 || this.lastCursor ? battlerCount : battlerCount);
break; break;
} }
} }