Blizzard_ObjectiveTracker/Blizzard_QuestObjectiveTracker.lua

Blizzard_ObjectiveTracker/Blizzard_QuestObjectiveTracker.lua (8.3.0.34963 vs 8.2.5.31960; click to toggle context display)
  1. QUEST_TRACKER_MODULE = ObjectiveTracker_GetModuleInfoTable();
  2. QUEST_TRACKER_MODULE.updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST;
  3. QUEST_TRACKER_MODULE.updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_QUEST + OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED + OBJECTIVE_TRACKER_UPDATE_SUPER_TRACK_CHANGED;
  4. QUEST_TRACKER_MODULE.usedBlocks = { };
  5. QUEST_TRACKER_MODULE.buttonOffsets = {
  6. groupFinder = { 7, 4 },
  7. useItem = { 3, 1 },
  8. };
  9. QUEST_TRACKER_MODULE.paddingBetweenButtons = 2;
  10. -- because this header is shared, on finishing its anim it has to update all the modules that use it
  11. QUEST_TRACKER_MODULE:SetHeader(ObjectiveTrackerFrame.BlocksFrame.QuestHeader, TRACKER_HEADER_QUESTS, OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED);
  12. function QUEST_TRACKER_MODULE:OnFreeBlock(block)
  13. QuestObjectiveReleaseBlockButton_Item(block);
  14. QuestObjectiveReleaseBlockButton_FindGroup(block);
  15. block.timerLine = nil;
  16. block.questCompleted = nil;
  17. end
  18. function QUEST_TRACKER_MODULE:OnFreeTypedLine(line)
  19. line.block = nil;
  20. if ( line.state ) then
  21. line.Check:Hide();
  22. line.state = nil;
  23. line.Glow.Anim:Stop();
  24. line.Glow:SetAlpha(0);
  25. line.Sheen.Anim:Stop();
  26. line.Sheen:SetAlpha(0);
  27. line.CheckFlash.Anim:Stop();
  28. line.CheckFlash:SetAlpha(0);
  29. line.FadeOutAnim:Stop();
  30. end
  31. end
  32. local function GetInlineFactionIcon()
  33. local faction = UnitFactionGroup("player");
  34. local coords = faction == "Horde" and QUEST_TAG_TCOORDS.HORDE or QUEST_TAG_TCOORDS.ALLIANCE;
  35. return CreateTextureMarkup(QUEST_ICONS_FILE, QUEST_ICONS_FILE_WIDTH, QUEST_ICONS_FILE_HEIGHT, 16, 16
  36. , coords[1]
  37. , coords[2] - 0.02 -- Offset to stop bleeding from next image
  38. , coords[3]
  39. , coords[4], 0, 2);
  40. end
  41. function QUEST_TRACKER_MODULE:SetBlockHeader(block, text, questLogIndex, isQuestComplete, questID)
  42. QuestObjective_SetupHeader(block);
  43. local hasGroupFinder = QuestObjectiveSetupBlockButton_FindGroup(block, questID);
  44. local hasItem = QuestObjectiveSetupBlockButton_Item(block, questLogIndex, isQuestComplete);
  45. -- Special case for previous behavior...if there are no buttons then use default line width from module
  46. if not (hasItem or hasGroupFinder) then
  47. block.lineWidth = nil;
  48. end
  49. if ( C_CampaignInfo.IsCampaignQuest(questID) ) then
  50. text = text..GetInlineFactionIcon();
  51. end
  52. -- set the text
  53. block.HeaderText:SetWidth(block.lineWidth or OBJECTIVE_TRACKER_TEXT_WIDTH);
  54. local height = QUEST_TRACKER_MODULE:SetStringText(block.HeaderText, text, nil, OBJECTIVE_TRACKER_COLOR["Header"]);
  55. block.height = height;
  56. end
  57. function QUEST_TRACKER_MODULE:OnBlockHeaderClick(block, mouseButton)
  58. if ( ChatEdit_TryInsertQuestLinkForQuestID(block.id) ) then
  59. return;
  60. end
  61. if ( mouseButton ~= "RightButton" ) then
  62. CloseDropDownMenus();
  63. if ( IsModifiedClick("QUESTWATCHTOGGLE") ) then
  64. QuestObjectiveTracker_UntrackQuest(nil, block.id);
  65. else
  66. local questLogIndex = GetQuestLogIndexByID(block.id);
  67. if ( IsQuestComplete(block.id) and GetQuestLogIsAutoComplete(questLogIndex) ) then
  68. AutoQuestPopupTracker_RemovePopUp(block.id);
  69. ShowQuestComplete(questLogIndex);
  70. else
  71. QuestMapFrame_OpenToQuestDetails(block.id);
  72. end
  73. end
  74. return;
  75. else
  76. ObjectiveTracker_ToggleDropDown(block, QuestObjectiveTracker_OnOpenDropDown);
  77. end
  78. end
  79. function QUEST_TRACKER_MODULE:OnBlockHeaderEnter(block)
  80. DEFAULT_OBJECTIVE_TRACKER_MODULE:OnBlockHeaderEnter(block)
  81. if IsInGroup() then
  82. GameTooltip:ClearAllPoints();
  83. GameTooltip:SetPoint("TOPRIGHT", block, "TOPLEFT", 0, 0);
  84. GameTooltip:SetOwner(block, "ANCHOR_PRESERVE");
  85. GameTooltip:SetQuestPartyProgress(block.id);
  86. end
  87. end
  88. function QUEST_TRACKER_MODULE:OnBlockHeaderLeave(block)
  89. DEFAULT_OBJECTIVE_TRACKER_MODULE:OnBlockHeaderLeave(block)
  90. GameTooltip:Hide();
  91. end
  92. local LINE_TYPE_ANIM = { template = "QuestObjectiveAnimLineTemplate", freeLines = { } };
  93. -- *****************************************************************************************************
  94. -- ***** ANIMATIONS
  95. -- *****************************************************************************************************
  96. function QuestObjectiveTracker_FinishGlowAnim(line)
  97. if ( line.state == "ADDING" ) then
  98. line.state = "PRESENT";
  99. else
  100. local questID = line.block.id;
  101. if ( IsQuestSequenced(questID) ) then
  102. line.FadeOutAnim:Play();
  103. line.state = "FADING";
  104. else
  105. line.state = "COMPLETED";
  106. ObjectiveTracker_Update(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST);
  107. end
  108. end
  109. end
  110. function QuestObjectiveTracker_FinishFadeOutAnim(line)
  111. local block = line.block;
  112. QUEST_TRACKER_MODULE:FreeLine(block, line);
  113. for _, otherLine in pairs(block.lines) do
  114. if ( otherLine.state == "FADING" ) then
  115. -- some other line is still fading
  116. return;
  117. end
  118. end
  119. ObjectiveTracker_Update(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST);
  120. end
  121. -- *****************************************************************************************************
  122. -- ***** BLOCK DROPDOWN FUNCTIONS
  123. -- *****************************************************************************************************
  124. function QuestObjectiveTracker_OnOpenDropDown(self)
  125. local block = self.activeFrame;
  126. local questLogIndex = GetQuestLogIndexByID(block.id);
  127. local info = UIDropDownMenu_CreateInfo();
  128. info.text = GetQuestLogTitle(questLogIndex);
  129. info.isTitle = 1;
  130. info.notCheckable = 1;
  131. UIDropDownMenu_AddButton(info, UIDROPDOWN_MENU_LEVEL);
  132. info = UIDropDownMenu_CreateInfo();
  133. info.notCheckable = 1;
  134. info.text = OBJECTIVES_VIEW_IN_QUESTLOG;
  135. info.func = QuestObjectiveTracker_OpenQuestDetails;
  136. info.arg1 = block.id;
  137. info.noClickSound = 1;
  138. info.checked = false;
  139. UIDropDownMenu_AddButton(info, UIDROPDOWN_MENU_LEVEL);
  140. info.text = OBJECTIVES_STOP_TRACKING;
  141. info.func = QuestObjectiveTracker_UntrackQuest;
  142. info.arg1 = block.id;
  143. info.checked = false;
  144. UIDropDownMenu_AddButton(info, UIDROPDOWN_MENU_LEVEL);
  145. if ( GetQuestLogPushable(questLogIndex) and IsInGroup() ) then
  146. info.text = SHARE_QUEST;
  147. info.func = QuestObjectiveTracker_ShareQuest;
  148. info.arg1 = block.id;
  149. info.checked = false;
  150. UIDropDownMenu_AddButton(info, UIDROPDOWN_MENU_LEVEL);
  151. end
  152. info.text = OBJECTIVES_SHOW_QUEST_MAP;
  153. info.func = QuestObjectiveTracker_OpenQuestMap;
  154. info.arg1 = block.id;
  155. info.checked = false;
  156. info.noClickSound = 1;
  157. UIDropDownMenu_AddButton(info, UIDROPDOWN_MENU_LEVEL);
  158. end
  159. function QuestObjectiveTracker_OpenQuestDetails(dropDownButton, questID)
  160. local questLogIndex = GetQuestLogIndexByID(questID);
  161. QuestLogPopupDetailFrame_Show(questLogIndex);
  162. end
  163. function QuestObjectiveTracker_UntrackQuest(dropDownButton, questID)
  164. local superTrackedQuestID = GetSuperTrackedQuestID();
  165. local questLogIndex = GetQuestLogIndexByID(questID);
  166. RemoveQuestWatch(questLogIndex);
  167. if ( questID == superTrackedQuestID ) then
  168. QuestSuperTracking_OnQuestUntracked();
  169. end
  170. ObjectiveTracker_Update(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST);
  171. end
  172. function QuestObjectiveTracker_OpenQuestMap(dropDownButton, questID)
  173. QuestMapFrame_OpenToQuestDetails(questID);
  174. end
  175. function QuestObjectiveTracker_ShareQuest(dropDownButton, questID)
  176. local questLogIndex = GetQuestLogIndexByID(questID);
  177. QuestLogPushQuest(questLogIndex);
  178. end
  179. -- *****************************************************************************************************
  180. -- ***** UPDATE FUNCTIONS
  181. -- *****************************************************************************************************
  182. local questTrackerOrderingFlags = {
  183. { flagIndex = 18 }, --isWarCampaign flag
  184. { flagIndex = 19 }, --hasOverrideSort flag
  185. { flagIndex = nil },
  186. };
  187. local function AnyFlagsMatched(questWatchInfoTable)
  188. for i, flagIndexInfo in ipairs(questTrackerOrderingFlags) do
  189. local flagIndex = flagIndexInfo.flagIndex;
  190. if flagIndex then
  191. if questWatchInfoTable[flagIndex] then
  192. return true;
  193. end
  194. end
  195. end
  196. return false;
  197. end
  198. local function EnumQuestWatchDataHelper(func, flagIndex, questWatchInfoTable)
  199. local questID = questWatchInfoTable[1];
  200. if questID then
  201. local pushQuest = false;
  202. if flagIndex then
  203. if questWatchInfoTable[flagIndex] then
  204. pushQuest = true;
  205. end
  206. else
  207. if not AnyFlagsMatched(questWatchInfoTable) then
  208. pushQuest = true;
  209. end
  210. end
  211. if pushQuest then
  212. local done = func(questWatchInfoTable);
  213. if done then
  214. return true;
  215. end
  216. end
  217. end
  218. return false;
  219. end
  220. local function EnumQuestWatchData(func)
  221. local questWatchInfoList = {};
  222. --cache the questWatchInfo
  223. for i = 1, GetNumQuestWatches() do
  224. questWatchInfoList[i] = {GetQuestWatchInfo(i)};
  225. end
  226. for _, orderingFlag in ipairs(questTrackerOrderingFlags) do
  227. for i = 1, GetNumQuestWatches() do
  228. if EnumQuestWatchDataHelper(func, orderingFlag.flagIndex, questWatchInfoList[i]) then
  229. return;
  230. end
  231. end
  232. end
  233. end
  234. function QuestObjectiveTracker_UpdatePOIs()
    QuestPOI_ResetUsage(ObjectiveTrackerFrame.BlocksFrame);
    local showPOIs = GetCVarBool("questPOI");
    if ( not showPOIs ) then
    QuestPOI_HideUnusedButtons(ObjectiveTrackerFrame.BlocksFrame);
    return;
    end
  235. function QUEST_TRACKER_MODULE:UpdatePOIs()
  236. local playerMoney = GetMoney();
  237. local numPOINumeric = 0;
  238. EnumQuestWatchData(
  239. function(questWatchInfoTable)
  240. -- see if we already have a block for this quest
  241. local questID, title, questLogIndex, numObjectives, requiredMoney, isComplete, startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isBounty, isStory, isOnMap, hasLocalPOI, isHidden, isWarCampaign, hasOverrideSort = unpack(questWatchInfoTable);
  242. local block = QUEST_TRACKER_MODULE:GetExistingBlock(questID);
  243. if ( block ) then
  244. local shouldShowWaypoint = (questID == GetSuperTrackedQuestID()) or (questID == QuestMapFrame_GetFocusedQuestID());
  245. if ( isComplete and isComplete < 0 ) then
  246. isComplete = false;
  247. elseif ( numObjectives == 0 and playerMoney >= requiredMoney and not startEvent ) then
  248. isComplete = true;
  249. end
  250. local poiButton;
  251. if ( hasLocalPOI or (shouldShowWaypoint and C_QuestLog.GetNextWaypoint(questID) ~= nil) ) then
  252. if ( isComplete ) then
  253. poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "normal", nil);
  254. else
  255. numPOINumeric = numPOINumeric + 1;
  256. poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "numeric", numPOINumeric);
  257. end
  258. elseif ( isComplete ) then
  259. poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "remote", nil);
  260. end
  261. if ( poiButton ) then
  262. poiButton:SetPoint("TOPRIGHT", block.HeaderText, "TOPLEFT", -6, 2);
  263. end
  264. end
  265. return false;
  266. end
  267. );
    QuestPOI_SelectButtonByQuestID(ObjectiveTrackerFrame.BlocksFrame, GetSuperTrackedQuestID());
    QuestPOI_HideUnusedButtons(ObjectiveTrackerFrame.BlocksFrame);
  268. end
  269. function QuestObjectiveTracker_DoQuestObjectives(block, numObjectives, questCompleted, questSequenced, existingBlock)
  270. local objectiveCompleting = false;
  271. local questLogIndex = GetQuestLogIndexByID(block.id);
  272. for objectiveIndex = 1, numObjectives do
  273. local text, objectiveType, finished = GetQuestLogLeaderBoard(objectiveIndex, questLogIndex);
  274. if ( text ) then
  275. local line = block.lines[objectiveIndex];
  276. if ( questCompleted ) then
  277. -- only process existing lines
  278. if ( line ) then
  279. line = QUEST_TRACKER_MODULE:AddObjective(block, objectiveIndex, text, LINE_TYPE_ANIM, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Complete"]);
  280. -- don't do anything else if a line is either COMPLETING or FADING, the anims' OnFinished will continue the process
  281. if ( not line.state or line.state == "PRESENT" ) then
  282. -- this objective wasn't marked finished
  283. line.block = block;
  284. line.Check:Show();
  285. line.Sheen.Anim:Play();
  286. line.Glow.Anim:Play();
  287. line.CheckFlash.Anim:Play();
  288. line.state = "COMPLETING";
  289. end
  290. end
  291. else
  292. if ( finished ) then
  293. if ( line ) then
  294. line = QUEST_TRACKER_MODULE:AddObjective(block, objectiveIndex, text, LINE_TYPE_ANIM, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Complete"]);
  295. if ( not line.state or line.state == "PRESENT" ) then
  296. -- complete this
  297. line.block = block;
  298. line.Check:Show();
  299. line.Sheen.Anim:Play();
  300. line.Glow.Anim:Play();
  301. line.CheckFlash.Anim:Play();
  302. line.state = "COMPLETING";
  303. end
  304. else
  305. -- didn't have a line, just show completed if not sequenced
  306. if ( not questSequenced ) then
  307. line = QUEST_TRACKER_MODULE:AddObjective(block, objectiveIndex, text, LINE_TYPE_ANIM, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Complete"]);
  308. line.Check:Show();
  309. line.state = "COMPLETED";
  310. end
  311. end
  312. else
  313. if ( not questSequenced or not objectiveCompleting ) then
  314. -- new objectives need to animate in
  315. if ( questSequenced and existingBlock and not line ) then
  316. line = QUEST_TRACKER_MODULE:AddObjective(block, objectiveIndex, text, LINE_TYPE_ANIM);
  317. line.Sheen.Anim:Play();
  318. line.Glow.Anim:Play();
  319. line.state = "ADDING";
  320. PlaySound(SOUNDKIT.UI_QUEST_ROLLING_FORWARD_01);
  321. if ( objectiveType == "progressbar" ) then
  322. QUEST_TRACKER_MODULE:AddProgressBar(block, line, block.id, finished);
  323. end
  324. else
  325. QUEST_TRACKER_MODULE:AddObjective(block, objectiveIndex, text);
  326. if ( objectiveType == "progressbar" ) then
  327. QUEST_TRACKER_MODULE:AddProgressBar(block, block.currentLine, block.id, finished);
  328. end
  329. end
  330. end
  331. end
  332. end
  333. if ( line ) then
  334. line.block = block;
  335. if ( line.state == "COMPLETING" ) then
  336. objectiveCompleting = true;
  337. end
  338. end
  339. end
  340. end
  341. if ( questCompleted and not objectiveCompleting ) then
  342. for _, line in pairs(block.lines) do
  343. if ( line.state == "COMPLETED" ) then
  344. line.FadeOutAnim:Play();
  345. line.state = "FADING";
  346. end
  347. end
  348. end
  349. return objectiveCompleting;
  350. end
  351. function QUEST_TRACKER_MODULE:Update()
  352. QUEST_TRACKER_MODULE:BeginLayout();
  353. QUEST_TRACKER_MODULE.lastBlock = nil;
  354. local numPOINumeric = 0;
    QuestPOI_ResetUsage(ObjectiveTrackerFrame.BlocksFrame);
  355. local _, instanceType = IsInInstance();
  356. if ( instanceType == "arena" ) then
  357. -- no quests in arena
    QuestPOI_HideUnusedButtons(ObjectiveTrackerFrame.BlocksFrame);
  358. QUEST_TRACKER_MODULE:EndLayout();
  359. return;
  360. end
  361. local playerMoney = GetMoney();
  362. local watchMoney = false;
    local showPOIs = GetCVarBool("questPOI");
  363. EnumQuestWatchData(
  364. function(questWatchInfoTable)
  365. local questID, title, questLogIndex, numObjectives, requiredMoney, isComplete, startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isBounty, isStory, isOnMap, hasLocalPOI, isHidden, isWarCampaign, hasOverrideSort = unpack(questWatchInfoTable);
  366. -- check filters
  367. local showQuest = true;
  368. if isTask or (isBounty and not IsQuestComplete(questID)) or C_QuestLog.IsQuestDisabledForSession(questID) then
  369. showQuest = false;
  370. end
  371. if ( showQuest ) then
  372. local shouldShowWaypoint = (questID == GetSuperTrackedQuestID()) or (questID == QuestMapFrame_GetFocusedQuestID());
  373. local isSequenced = IsQuestSequenced(questID);
  374. local existingBlock = QUEST_TRACKER_MODULE:GetExistingBlock(questID);
  375. local block = QUEST_TRACKER_MODULE:GetBlock(questID);
  376. QUEST_TRACKER_MODULE:SetBlockHeader(block, title, questLogIndex, isComplete, questID);
  377. -- completion state
  378. local questFailed = false;
  379. if ( isComplete and isComplete < 0 ) then
  380. isComplete = false;
  381. questFailed = true;
  382. elseif ( numObjectives == 0 and playerMoney >= requiredMoney and not startEvent ) then
  383. isComplete = true;
  384. end
  385. if ( requiredMoney > 0 ) then
  386. watchMoney = true;
  387. end
  388. if ( isComplete ) then
  389. -- don't display completion state yet if we're animating an objective completing
  390. local objectiveCompleting = QuestObjectiveTracker_DoQuestObjectives(block, numObjectives, true, isSequenced, existingBlock);
  391. if ( not objectiveCompleting ) then
  392. if ( isAutoComplete ) then
  393. QUEST_TRACKER_MODULE:AddObjective(block, "QuestComplete", QUEST_WATCH_QUEST_COMPLETE);
  394. QUEST_TRACKER_MODULE:AddObjective(block, "ClickComplete", QUEST_WATCH_CLICK_TO_COMPLETE);
  395. else
  396. local completionText = GetQuestLogCompletionText(questLogIndex);
  397. if ( completionText ) then
  398. if ( shouldShowWaypoint ) then
  399. local waypointText = C_QuestLog.GetNextWaypointText(questID);
  400. if ( waypointText ~= nil ) then
  401. QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", WAYPOINT_OBJECTIVE_FORMAT_OPTIONAL:format(waypointText));
  402. end
  403. end
  404. QUEST_TRACKER_MODULE:AddObjective(block, "QuestComplete", completionText, nil, OBJECTIVE_DASH_STYLE_HIDE);
  405. else
  406. -- If there isn't completion text, always prefer waypoint to "Ready for turn-in".
  407. local waypointText = C_QuestLog.GetNextWaypointText(questID);
  408. if ( waypointText ~= nil ) then
  409. QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", waypointText);
  410. else
  411. QUEST_TRACKER_MODULE:AddObjective(block, "QuestComplete", QUEST_WATCH_QUEST_READY, nil, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Complete"]);
  412. end
  413. end
  414. end
  415. end
  416. elseif ( questFailed ) then
  417. QUEST_TRACKER_MODULE:AddObjective(block, "Failed", FAILED, nil, nil, OBJECTIVE_DASH_STYLE_HIDE, OBJECTIVE_TRACKER_COLOR["Failed"]);
  418. else
  419. if ( shouldShowWaypoint ) then
  420. local waypointText = C_QuestLog.GetNextWaypointText(questID);
  421. if ( waypointText ~= nil ) then
  422. QUEST_TRACKER_MODULE:AddObjective(block, "Waypoint", WAYPOINT_OBJECTIVE_FORMAT_OPTIONAL:format(waypointText));
  423. end
  424. end
  425. QuestObjectiveTracker_DoQuestObjectives(block, numObjectives, false, isSequenced, existingBlock);
  426. if ( requiredMoney > playerMoney ) then
  427. local text = GetMoneyString(playerMoney).." / "..GetMoneyString(requiredMoney);
  428. QUEST_TRACKER_MODULE:AddObjective(block, "Money", text);
  429. end
  430. -- timer bar
  431. if ( failureTime and block.currentLine ) then
  432. local currentLine = block.currentLine;
  433. if ( timeElapsed and timeElapsed <= failureTime ) then
  434. -- if a timer was attached to another line, release it
  435. if ( block.timerLine and block.timerLine ~= currentLine ) then
  436. QUEST_TRACKER_MODULE:FreeTimerBar(block, block.timerLine);
  437. end
  438. QUEST_TRACKER_MODULE:AddTimerBar(block, currentLine, failureTime, GetTime() - timeElapsed);
  439. block.timerLine = currentLine;
  440. elseif ( block.timerLine ) then
  441. QUEST_TRACKER_MODULE:FreeTimerBar(block, block.timerLine);
  442. end
  443. end
  444. end
  445. block:SetHeight(block.height);
  446. if ( ObjectiveTracker_AddBlock(block) ) then
  447. if ( existingBlock and isComplete and not block.questCompleted ) then
  448. QuestSuperTracking_OnQuestCompleted();
  449. end
  450. block.questCompleted = isComplete;
  451. block:Show();
  452. QUEST_TRACKER_MODULE:FreeUnusedLines(block);
    -- quest POI icon
    if ( showPOIs ) then
    local poiButton;
    if ( hasLocalPOI or (shouldShowWaypoint and C_QuestLog.GetNextWaypoint(questID) ~= nil) ) then
    if ( isComplete ) then
    poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "normal", nil);
    else
    numPOINumeric = numPOINumeric + 1;
    poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "numeric", numPOINumeric);
    end
    elseif ( isComplete ) then
    poiButton = QuestPOI_GetButton(ObjectiveTrackerFrame.BlocksFrame, questID, "remote", nil);
    end
    if ( poiButton ) then
    poiButton:SetParent(block);
    poiButton:SetPoint("TOPRIGHT", block.HeaderText, "TOPLEFT", -6, 2);
    end
    end
  453. else
  454. block.used = false;
  455. return true;
  456. end
  457. end
  458. return false;
  459. end
  460. );
  461. ObjectiveTracker_WatchMoney(watchMoney, OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST);
  462. QuestSuperTracking_CheckSelection();
    QuestPOI_SelectButtonByQuestID(ObjectiveTrackerFrame.BlocksFrame, GetSuperTrackedQuestID());
    QuestPOI_HideUnusedButtons(ObjectiveTrackerFrame.BlocksFrame);
  463. QUEST_TRACKER_MODULE:EndLayout();
  464. end