From 23d8033074d635dcb638853e2cfcdd7bcc1af26f Mon Sep 17 00:00:00 2001 From: Silvestre Emmanuel Date: Wed, 24 Apr 2024 22:52:31 -0600 Subject: [PATCH] Added a way to see the pokemon stats in the Learn Move Phase -Pressing Button.LEFT now shows the stats summary page -Pressing Button.RIGHT goes back to move selection page --- src/ui/summary-ui-handler.ts | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 0fdd7606cd6..246a78f0950 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -342,6 +342,12 @@ export default class SummaryUiHandler extends UiHandler { case Button.DOWN: success = this.setCursor(this.moveCursor < 4 ? this.moveCursor + 1 : 0); break; + case Button.LEFT: + this.moveSelect = false; + this.setCursor(Page.STATS); + this.hideMoveEffect(); + success = true; + break; } } } else { @@ -358,6 +364,8 @@ export default class SummaryUiHandler extends UiHandler { switch (button) { case Button.UP: case Button.DOWN: + if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) + break; const isDown = button === Button.DOWN; const party = this.scene.getParty(); const partyMemberIndex = party.indexOf(this.pokemon); @@ -368,10 +376,18 @@ export default class SummaryUiHandler extends UiHandler { } break; case Button.LEFT: + if(this.summaryUiMode === SummaryUiMode.LEARN_MOVE) + break; if (this.cursor) success = this.setCursor(this.cursor - 1); break; case Button.RIGHT: + if(this.summaryUiMode === SummaryUiMode.LEARN_MOVE){ + this.setCursor(Page.MOVES); + this.moveSelect = true; + success = true; + break; + } if (this.cursor < pages.length - 1) success = this.setCursor(this.cursor + 1); break; @@ -449,7 +465,6 @@ export default class SummaryUiHandler extends UiHandler { }); } }); - if (this.selectedMoveIndex > -1) { if (!this.selectedMoveCursorObj) { this.selectedMoveCursorObj = this.scene.add.sprite(-2, 0, 'summary_moves_cursor', 'select'); @@ -482,8 +497,18 @@ export default class SummaryUiHandler extends UiHandler { x: forward ? '-=214' : '+=214', duration: 250, onComplete: () => { - if (forward) - this.populatePageContainer(this.summaryPageContainer); + if (forward){ + this.populatePageContainer(this.summaryPageContainer); + if(this.summaryUiMode === SummaryUiMode.LEARN_MOVE) + { + this.moveCursorObj = null; + this.extraMoveRowContainer.setVisible(true); + // Cursor needs to be setted 2 times so it triggers the changed flag to show the move description + this.setCursor(1); + this.setCursor(0); + this.showMoveEffect(); + } + } else this.summaryPageTransitionContainer.x -= 214; this.summaryPageTransitionContainer.setVisible(false); @@ -699,6 +724,7 @@ export default class SummaryUiHandler extends UiHandler { this.extraMoveRowContainer.add(extraRowText); if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) { + this.extraMoveRowContainer.setVisible(true); const newMoveTypeIcon = this.scene.add.sprite(0, 0, 'types', Type[this.newMove.type].toLowerCase()); newMoveTypeIcon.setOrigin(0, 1); this.extraMoveRowContainer.add(newMoveTypeIcon);