Bug Fixes and QoL: Minor changes to UI related bugs (#356)

* bug fix: updates move description correctly

viewing the description of move slot 1 in a pokemon's move summary UI only updated the first time it was viewed per session, exiting the party UI and re-entering caused the moves in a pokemon's summary screen to not automatically populate the description box unless you moved the cursor down to move 2 and then back up to move 1

* 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

* finalised the minor UI changes

* finalising

* refactor

* removed console logs used for testing

* bug fix: updates move description correctly

viewing the description of move slot 1 in a pokemon's move summary UI only updated the first time it was viewed per session, exiting the party UI and re-entering caused the moves in a pokemon's summary screen to not automatically populate the description box unless you moved the cursor down to move 2 and then back up to move 1

* 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

* finalised the minor UI changes

* finalising

* refactor

* removed console logs used for testing
pull/357/head^2
Nero 2024-04-30 18:42:20 +02:00 committed by GitHub
parent 1e7c329928
commit 55dc339647
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 35 additions and 15 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "pokemon-rogue-battle",
"version": "1.0.1",
"version": "1.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "pokemon-rogue-battle",
"version": "1.0.1",
"version": "1.0.3",
"dependencies": {
"@material/material-color-utilities": "^0.2.7",
"crypto-js": "^4.2.0",

View File

@ -383,6 +383,7 @@ export default class PartyUiHandler extends MessageUiHandler {
}
const slotCount = this.partySlots.length;
const battlerCount = this.scene.currentBattle.getBattlerCount();
switch (button) {
case Button.UP:
@ -392,14 +393,20 @@ export default class PartyUiHandler extends MessageUiHandler {
success = this.setCursor(this.cursor < 6 ? this.cursor < slotCount - 1 ? this.cursor + 1 : 6 : 0);
break;
case Button.LEFT:
if (this.cursor >= this.scene.currentBattle.getBattlerCount() && this.cursor < 6)
if (this.cursor >= battlerCount && this.cursor <= 6)
success = this.setCursor(0);
break;
case Button.RIGHT:
const battlerCount = this.scene.currentBattle.getBattlerCount();
if (slotCount > battlerCount && this.cursor < battlerCount)
success = this.setCursor(this.lastCursor < 6 ? this.lastCursor || battlerCount : battlerCount);
if (slotCount === battlerCount){
success = this.setCursor(6);
break;
} else if (battlerCount >= 2 && slotCount > battlerCount && this.getCursor() === 0 && this.lastCursor === 1){
success = this.setCursor(2);
break;
} else if (slotCount > battlerCount && this.cursor < battlerCount){
success = this.setCursor(this.lastCursor < 6 ? this.lastCursor || battlerCount : battlerCount);
break;
}
}
}

View File

@ -364,9 +364,16 @@ export default class SummaryUiHandler extends UiHandler {
case Button.LEFT:
this.moveSelect = false;
this.setCursor(Page.STATS);
this.hideMoveEffect();
success = true;
break;
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE){
this.hideMoveEffect();
this.destroyBlinkCursor();
success = true;
break;
} else {
this.hideMoveSelect();
success = true;
break;
}
}
}
} else {
@ -426,11 +433,9 @@ export default class SummaryUiHandler extends UiHandler {
}
setCursor(cursor: integer, overrideChanged: boolean = false): boolean {
let changed: boolean;
let changed: boolean = overrideChanged || this.moveCursor !== cursor;
if (this.moveSelect) {
changed = overrideChanged || this.moveCursor !== cursor;
if (changed) {
this.moveCursor = cursor;
const selectedMove = this.getSelectedMove();
@ -462,7 +467,6 @@ export default class SummaryUiHandler extends UiHandler {
y: `-=${14.83 * (moveDescriptionLineCount - 3)}`
});
}
}
if (!this.moveCursorObj) {
this.moveCursorObj = this.scene.add.sprite(-2, 0, 'summary_moves_cursor', 'highlight');
@ -527,6 +531,11 @@ export default class SummaryUiHandler extends UiHandler {
this.setCursor(0, true);
this.showMoveEffect();
}
else if (this.cursor===Page.MOVES) {
this.moveCursorObj = null;
this.showMoveSelect();
this.showMoveEffect();
}
}
else
this.summaryPageTransitionContainer.x -= 214;
@ -871,6 +880,12 @@ export default class SummaryUiHandler extends UiHandler {
this.moveSelect = false;
this.extraMoveRowContainer.setVisible(false);
this.moveDescriptionText.setText('');
this.destroyBlinkCursor();
this.hideMoveEffect();
}
destroyBlinkCursor(){
if (this.moveCursorBlinkTimer) {
this.moveCursorBlinkTimer.destroy();
this.moveCursorBlinkTimer = null;
@ -883,8 +898,6 @@ export default class SummaryUiHandler extends UiHandler {
this.selectedMoveCursorObj.destroy();
this.selectedMoveCursorObj = null;
}
this.hideMoveEffect();
}
showMoveEffect(instant?: boolean) {