mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 21:32:18 +02:00
Sort items in summary screen by type then name.
This commit is contained in:
parent
c454e2d232
commit
99f1e51a3d
@ -808,10 +808,11 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
statValue.setOrigin(1, 0);
|
||||
statsContainer.add(statValue);
|
||||
});
|
||||
//Sort items by item type then item name.
|
||||
let itemModifiers = (this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier
|
||||
&& (m as PokemonHeldItemModifier).pokemonId === this.pokemon.id, true) as PokemonHeldItemModifier[])
|
||||
.sort(((a, b)=>a.type.name.localeCompare(b.type.name) && a.constructor.name.localeCompare(b.constructor.name)));
|
||||
|
||||
const itemModifiers = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier
|
||||
&& (m as PokemonHeldItemModifier).pokemonId === this.pokemon.id, true) as PokemonHeldItemModifier[];
|
||||
|
||||
itemModifiers.forEach((item, i) => {
|
||||
const icon = item.getIcon(this.scene, true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user