diff --git a/src/app/shared/components/input-item/input-item.component.ts b/src/app/shared/components/input-item/input-item.component.ts index 2bda81e..41765e6 100644 --- a/src/app/shared/components/input-item/input-item.component.ts +++ b/src/app/shared/components/input-item/input-item.component.ts @@ -7,6 +7,7 @@ import { OnInit, output, } from '@angular/core'; +import { sortBy } from 'lodash'; import { IItemDefinition } from '../../../../interfaces'; import { ModService } from '../../../services/mod.service'; @@ -33,11 +34,14 @@ export class InputItemComponent implements OnInit { this.allowNone() ? { category: 'Default', data: { name: 'none' }, value: 'none' } : undefined, - ...mod.items.map((i) => ({ - category: 'My Mod Items', - data: i, - value: i.name, - })), + ...sortBy( + mod.items.map((i) => ({ + category: 'My Mod Items', + data: i, + value: i.name, + })), + 'value' + ), ] .flat() .filter(Boolean) as ItemModel[]; diff --git a/src/app/shared/components/input-npc/input-npc.component.ts b/src/app/shared/components/input-npc/input-npc.component.ts index 0d4ea7b..40b5b1f 100644 --- a/src/app/shared/components/input-npc/input-npc.component.ts +++ b/src/app/shared/components/input-npc/input-npc.component.ts @@ -7,6 +7,7 @@ import { OnInit, output, } from '@angular/core'; +import { sortBy } from 'lodash'; import { INPCDefinition } from '../../../../interfaces'; import { ModService } from '../../../services/mod.service'; @@ -29,11 +30,14 @@ export class InputNpcComponent implements OnInit { const mod = this.modService.mod(); return [ - ...mod.npcs.map((i) => ({ - category: 'My Mod NPCs', - data: i, - value: i.npcId, - })), + ...sortBy( + mod.npcs.map((i) => ({ + category: 'My Mod NPCs', + data: i, + value: i.npcId, + })), + 'value' + ), ]; });