From 86d187b5119929bd3c26a77088a0b01e0bf2b817 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Thu, 17 Jan 2019 23:05:52 +0100 Subject: [PATCH] Update quest tracker on ignore/unignore --- CleanJournal.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/CleanJournal.lua b/CleanJournal.lua index acc3e51..f9d3ace 100644 --- a/CleanJournal.lua +++ b/CleanJournal.lua @@ -1,3 +1,6 @@ +-- TODO: Hide ignored quests on compass +-- TODO: Fix gamepad support + -- TODO: Use localisation files ZO_CreateStringId("SI_AO_IGNORED_QUEST_CATEGORY", "Ignored") ZO_CreateStringId("SI_AO_IGNORE_QUEST_TOOLTIP", "Ignore") @@ -49,8 +52,6 @@ end -- function AO_ToggleIgnoreQuest(questIndex) - -- TODO: Make it impossible to ignore all quests (but what when you complete the last unignored quest?) - local quests, categories, seenCategories = QUEST_JOURNAL_MANAGER:GetQuestListData() local quest = AO_GetQuestByIndex(questIndex) @@ -61,6 +62,10 @@ function AO_ToggleIgnoreQuest(questIndex) WORLD_MAP_QUEST_BREADCRUMBS:OnQuestAdded(questIndex) PlaySound(SOUNDS.QUEST_SHARE_ACCEPTED) + + if FOCUSED_QUEST_TRACKER:GetNumTracked() == 0 then + FOCUSED_QUEST_TRACKER:ForceAssist(questIndex) + end else AO_IGNORED_QUESTS[quest.name] = true @@ -70,6 +75,17 @@ function AO_ToggleIgnoreQuest(questIndex) WORLD_MAP_QUEST_BREADCRUMBS:OnQuestRemoved(false, questIndex) PlaySound(SOUNDS.QUEST_SHARE_DECLINED) + + local lastTracked = FOCUSED_QUEST_TRACKER:GetLastTracked() + if lastTracked.trackType == TRACK_TYPE_QUEST and lastTracked.arg1 == questIndex then + local IGNORE_SCENE_RESTRICTION = true + FOCUSED_QUEST_TRACKER:AssistNext(IGNORE_SCENE_RESTRICTION) + + lastTracked = FOCUSED_QUEST_TRACKER:GetLastTracked() + if lastTracked.trackType == TRACK_TYPE_QUEST and lastTracked.arg1 == questIndex then + FOCUSED_QUEST_TRACKER:ClearTracker() + end + end end SYSTEMS:GetObject("questJournal"):OnQuestsUpdated()