diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-12 19:18:52 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-12 19:18:52 +0000 |
| commit | a4052ffee8bc7c6c8a69eba5120b5c6c2d951b0f (patch) | |
| tree | 970921e587c0972ed4bf8a82a18bbad8dee10458 /lib | |
| parent | addf95bc7e1e694cd9ba7797c8b0847bfecaf54c (diff) | |
Add items
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/questsLoader.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/questsLoader.ts b/lib/questsLoader.ts index a4ea64f..296afc3 100644 --- a/lib/questsLoader.ts +++ b/lib/questsLoader.ts @@ -67,6 +67,18 @@ export function loadCategoriesFromJson(config: any): EditorCategory[] { }); } +export function loadItemsFromJson(config: any): EditorItem[] { + return Object.keys(config).map((itemid: any) => { + const item = config[itemid]; + + return { + id: itemid, + type: item.type, + config: item.config, + }; + }); +} + //TODO don't write fields if they're unchanged export function mapJsonQuestToYamlObject(quest: EditorQuest): any { return { |
