Added a way to see the pokemon stats in the Learn Move Phase (#286)

* Added the move category icon to the fight ui

* 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

* Minor nitpicks

---------

Co-authored-by: Silvestre Emmanuel <silvestre.ramirez@wundertec.com>
Co-authored-by: Flashfyre <flashfireex@gmail.com>
This commit is contained in:
Silvestre Emmanuel 2024-04-24 23:18:23 -06:00 committed by GitHub
parent e1800e6040
commit ab8b9f0bfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 28 additions and 5 deletions

View File

@ -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;
@ -387,11 +403,11 @@ export default class SummaryUiHandler extends UiHandler {
return success || error;
}
setCursor(cursor: integer): boolean {
setCursor(cursor: integer, overrideChanged: boolean = false): boolean {
let changed: boolean;
if (this.moveSelect) {
changed = this.moveCursor !== cursor;
changed = overrideChanged || this.moveCursor !== cursor;
if (changed) {
this.moveCursor = cursor;
@ -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,15 @@ 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);
this.setCursor(0, true);
this.showMoveEffect();
}
}
else
this.summaryPageTransitionContainer.x -= 214;
this.summaryPageTransitionContainer.setVisible(false);
@ -699,6 +721,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);