From f860d4576db9c37ded040c8b71425ca447b453cf Mon Sep 17 00:00:00 2001 From: Sisby folk <55819817+sisby-folk@users.noreply.github.com> Date: Sat, 4 Nov 2023 11:34:11 +1100 Subject: [PATCH] hide invisible quests using https://github.com/terrarium-earth/Heracles/pull/103 (#23) --- odysseus/HeraclesQuest.ts | 2 +- odysseus/convertFtbQuests.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/odysseus/HeraclesQuest.ts b/odysseus/HeraclesQuest.ts index a99af97..1ef6f46 100644 --- a/odysseus/HeraclesQuest.ts +++ b/odysseus/HeraclesQuest.ts @@ -266,7 +266,7 @@ export type HeraclesQuest = { settings?: { individual_progress?: boolean; - hidden?: boolean; + hidden?: "LOCKED" | "IN_PROGRESS" | "COMPLETED" | "COMPLETED_CLAIMED"; }; dependencies?: string[]; diff --git a/odysseus/convertFtbQuests.ts b/odysseus/convertFtbQuests.ts index 6db70cf..92404a2 100644 --- a/odysseus/convertFtbQuests.ts +++ b/odysseus/convertFtbQuests.ts @@ -240,6 +240,7 @@ type Chapter = QuestObject & { min_required_dependencies?: number; dependencies?: number[] | string[]; hide?: boolean; + invisible?: boolean; dependency_requirement: 'all_completed' | 'one_completed' | 'all_started' | 'one_started'; hide_text_until_complete?: boolean; size?: number; @@ -475,10 +476,17 @@ export const convertFtbQuests = async (input: QuestInputFileSystem, output: Ques const questTitle = quest.title ? formatString(quest.title) : inferredData?.title; const questSubtitle = quest.subtitle ? formatString(quest.subtitle) : undefined; const questIcon = quest.icon ? convertIcon(quest.icon) : inferredData?.icon; + let hidden: "LOCKED" | "IN_PROGRESS" | "COMPLETED" | "COMPLETED_CLAIMED" | undefined = undefined; + + if (quest.invisible) { + hidden = "COMPLETED"; + } else if (quest.hide) { + hidden = "IN_PROGRESS"; + } const heraclesQuest: HeraclesQuest = { settings: { - hidden: quest.hide + hidden }, dependencies: areNumericIds(quest.dependencies) ?