[QoL] Sort items on summary screen (#1880)

This commit is contained in:
HighMans 2024-06-06 13:13:14 -04:00 committed by GitHub
parent f3de114d2b
commit 17edaeb708
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,8 @@ import { Variant, getVariantTint } from "#app/data/variant";
import {Button} from "../enums/buttons";
import { Ability } from "../data/ability.js";
import i18next from "i18next";
import {modifierSortFunc} from "../modifier/modifier";
enum Page {
PROFILE,
@ -828,8 +830,9 @@ export default class SummaryUiHandler extends UiHandler {
statsContainer.add(statValue);
});
const itemModifiers = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier
&& (m as PokemonHeldItemModifier).pokemonId === this.pokemon.id, true) as PokemonHeldItemModifier[];
const itemModifiers = (this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier
&& (m as PokemonHeldItemModifier).pokemonId === this.pokemon.id, true) as PokemonHeldItemModifier[])
.sort(modifierSortFunc);
itemModifiers.forEach((item, i) => {
const icon = item.getIcon(this.scene, true);