Skip to content

Commit

Permalink
hide invisible quests using terrarium-earth/Heracles#103 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk authored Nov 4, 2023
1 parent 941d861 commit f860d45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion odysseus/HeraclesQuest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export type HeraclesQuest = {

settings?: {
individual_progress?: boolean;
hidden?: boolean;
hidden?: "LOCKED" | "IN_PROGRESS" | "COMPLETED" | "COMPLETED_CLAIMED";
};

dependencies?: string[];
Expand Down
10 changes: 9 additions & 1 deletion odysseus/convertFtbQuests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) ?
Expand Down

0 comments on commit f860d45

Please sign in to comment.