Minor nitpicks

This commit is contained in:
Flashfyre 2024-04-25 01:17:51 -04:00
parent c7f6284f7b
commit 0c4336f05c

View File

@ -376,13 +376,13 @@ export default class SummaryUiHandler extends UiHandler {
} }
break; break;
case Button.LEFT: case Button.LEFT:
if(this.summaryUiMode === SummaryUiMode.LEARN_MOVE) if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE)
break; break;
if (this.cursor) if (this.cursor)
success = this.setCursor(this.cursor - 1); success = this.setCursor(this.cursor - 1);
break; break;
case Button.RIGHT: case Button.RIGHT:
if(this.summaryUiMode === SummaryUiMode.LEARN_MOVE){ if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) {
this.setCursor(Page.MOVES); this.setCursor(Page.MOVES);
this.moveSelect = true; this.moveSelect = true;
success = true; success = true;
@ -403,11 +403,11 @@ export default class SummaryUiHandler extends UiHandler {
return success || error; return success || error;
} }
setCursor(cursor: integer): boolean { setCursor(cursor: integer, overrideChanged: boolean = false): boolean {
let changed: boolean; let changed: boolean;
if (this.moveSelect) { if (this.moveSelect) {
changed = this.moveCursor !== cursor; changed = overrideChanged || this.moveCursor !== cursor;
if (changed) { if (changed) {
this.moveCursor = cursor; this.moveCursor = cursor;
@ -499,13 +499,10 @@ export default class SummaryUiHandler extends UiHandler {
onComplete: () => { onComplete: () => {
if (forward){ if (forward){
this.populatePageContainer(this.summaryPageContainer); this.populatePageContainer(this.summaryPageContainer);
if(this.summaryUiMode === SummaryUiMode.LEARN_MOVE) if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) {
{
this.moveCursorObj = null; this.moveCursorObj = null;
this.extraMoveRowContainer.setVisible(true); this.extraMoveRowContainer.setVisible(true);
// Cursor needs to be setted 2 times so it triggers the changed flag to show the move description this.setCursor(0, true);
this.setCursor(1);
this.setCursor(0);
this.showMoveEffect(); this.showMoveEffect();
} }
} }