diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-13 19:33:33 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-13 19:33:33 +0000 |
| commit | bd26b2800e2675613c6990673ad0b7b5175aa841 (patch) | |
| tree | 26d1a89d9ed60ad73a82fbe3371d8c58578702f5 /lib/questsLoader.ts | |
| parent | 825d2cadee4ddf34d0dde8c278fc8e8a99e95b95 (diff) | |
Add zip export
Diffstat (limited to 'lib/questsLoader.ts')
| -rw-r--r-- | lib/questsLoader.ts | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/questsLoader.ts b/lib/questsLoader.ts index 296afc3..f49dce5 100644 --- a/lib/questsLoader.ts +++ b/lib/questsLoader.ts @@ -1,4 +1,4 @@ -import type { EditorQuest, EditorTask, EditorCategory } from '../stores/session'; +import type { EditorQuest, EditorTask, EditorCategory, EditorItem } from '../stores/session'; export function loadQuestsFromJson(config: any): EditorQuest[] { return Object.keys(config).map((questid: any) => { @@ -74,7 +74,7 @@ export function loadItemsFromJson(config: any): EditorItem[] { return { id: itemid, type: item.type, - config: item.config, + config: item.item, }; }); } @@ -119,4 +119,22 @@ export function mapJsonQuestToYamlObject(quest: EditorQuest): any { ...(quest.options.lockedDisplay && { lockedDisplay: quest.options.lockedDisplay }), }, } +} + +export function mapJsonCategoryToYamlObject(category: EditorCategory): any { + return { + display: { + name: category.display.name, + type: category.display.type, + lore: category.display.lore, + }, + "permission-required": category.permissionRequired, + } +} + +export function mapJsonItemToYamlObject(item: EditorItem): any { + return { + type: item.type, + item: item.config + } }
\ No newline at end of file |
