Skip to content

Commit

Permalink
closes #49
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Aug 19, 2024
1 parent 95de2d3 commit baeeab8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions src/app/shared/components/input-item/input-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
OnInit,
output,
} from '@angular/core';
import { sortBy } from 'lodash';
import { IItemDefinition } from '../../../../interfaces';
import { ModService } from '../../../services/mod.service';

Expand All @@ -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[];
Expand Down
14 changes: 9 additions & 5 deletions src/app/shared/components/input-npc/input-npc.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
OnInit,
output,
} from '@angular/core';
import { sortBy } from 'lodash';
import { INPCDefinition } from '../../../../interfaces';
import { ModService } from '../../../services/mod.service';

Expand All @@ -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'
),
];
});

Expand Down

0 comments on commit baeeab8

Please sign in to comment.