[Bug] Caught Pokemon Summary-Modifier Display Fix (#3145)

* Fixed modifiers not displaying on summary screen

* Addressed Typedoc issues

* Documentation added

---------

Co-authored-by: Frutescens <info@laptop>
This commit is contained in:
Mumble 2024-07-25 15:40:47 -07:00 committed by GitHub
parent a604e00369
commit 233c926721
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -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(() => {

View File

@ -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) => {