From 233c926721942d0c9a299622219bb06f8c1d2318 Mon Sep 17 00:00:00 2001 From: Mumble Date: Thu, 25 Jul 2024 15:40:47 -0700 Subject: [PATCH] [Bug] Caught Pokemon Summary-Modifier Display Fix (#3145) * Fixed modifiers not displaying on summary screen * Addressed Typedoc issues * Documentation added --------- Co-authored-by: Frutescens --- src/phases.ts | 2 +- src/ui/summary-ui-handler.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index d0c0804541b..15fd1975d1c 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -5039,7 +5039,7 @@ export class AttemptCapturePhase extends PokemonPhase { this.scene.ui.setMode(Mode.MESSAGE).then(() => { promptRelease(); }); - }); + }, false); }, () => { this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => { this.scene.ui.setMode(Mode.MESSAGE).then(() => { diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 882bc42220f..405429fcd3f 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -93,6 +93,8 @@ export default class SummaryUiHandler extends UiHandler { private moveCursorBlinkTimer: Phaser.Time.TimerEvent; private pokemon: PlayerPokemon; + private playerParty: boolean; + /**This is set to false when checking the summary of a freshly caught Pokemon as it is not part of a player's party yet but still needs to display its items**/ private newMove: Move; private moveSelectFunction: Function; private transitioning: boolean; @@ -270,9 +272,16 @@ export default class SummaryUiHandler extends UiHandler { show(args: any[]): boolean { super.show(args); + /* args[] information + * args[0] : the Pokemon displayed in the Summary-UI + * args[1] : the summaryUiMode (defaults to 0) + * args[2] : the start page (defaults to Page.PROFILE) + * args[3] : contains the function executed when the user exits out of Summary UI + * args[4] : optional boolean used to determine if the Pokemon is part of the player's party or not (defaults to true, necessary for PR #2921 to display all relevant information) + */ this.pokemon = args[0] as PlayerPokemon; this.summaryUiMode = args.length > 1 ? args[1] as SummaryUiMode : SummaryUiMode.DEFAULT; - + this.playerParty = args[4] ?? true; this.scene.ui.bringToTop(this.summaryContainer); this.summaryContainer.setVisible(true); @@ -853,7 +862,7 @@ export default class SummaryUiHandler extends UiHandler { }); const itemModifiers = (this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier - && m.pokemonId === this.pokemon.id, true) as PokemonHeldItemModifier[]) + && m.pokemonId === this.pokemon.id, this.playerParty) as PokemonHeldItemModifier[]) .sort(modifierSortFunc); itemModifiers.forEach((item, i) => {