comparison ObjectiveTracker/APIHooks.lua @ 44:756e8aeb040b

- Default.lua - simplified the response to SuperTrackedQuestID changes - tag icons work again
author Nenue
date Mon, 25 Apr 2016 19:37:13 -0400
parents ObjectiveTracker/Events.lua@03ed70f846de
children dd1ae565f559
comparison
equal deleted inserted replaced
43:9480bd904f4c 44:756e8aeb040b
1 --- ${PACKAGE_NAME}
2 -- @file-author@
3 -- @project-revision@ @project-hash@
4 -- @file-revision@ @file-hash@
5 -- Created: 3/30/2016 1:23 AM
6 local B = select(2,...).frame
7 local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
8 local print = B.print('Objectives')
9 local OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST
10 local OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP = OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP
11 local GetQuestID = GetQuestID
12 local QuestPOIUpdateIcons = QuestPOIUpdateIcons
13
14 --- Module updates triggered by user events
15
16 T.AddQuestWatch = function(questID)
17 return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST
18 end
19 T.AbandonQuest = function()
20 QuestPOIUpdateIcons()
21 return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST
22 end
23 T.CompleteQuest = function()
24 QuestPOIUpdateIcons()
25 return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST
26 end
27 T.AddAutoQuestPopUp = function(...)
28 return OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP
29 end
30 T.RemoveAutoQuestPopUp = function(questID)
31 return OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP
32 end
33 --- SUPER_TRACKED_QUEST_CHANGED will fires
34 local tprint = B.print('Tracker')
35 T.SetSuperTrackedQuestID = function(questID)
36 tprint('SetSuperTrackedQuestID', questID)
37 for index, block in ipairs(T.Quest.usedBlocks) do
38 if block:IsVisible() then
39 if block.info.id == questID then
40 block.SelectionOverlay:Show()
41 else
42 block.SelectionOverlay:Hide()
43 end
44 end
45 end
46 T.SuperTrackedQuestID = questID
47 end
48
49
50 local previousSelection
51 --@debug@
52 local tprint = B.print('Tracker') -- @debug@
53 T.SelectQuestLogEntry = function(logIndex)
54 --@debug@
55 if previousSelection and previousSelection ~= logIndex then
56 print('swapping selection from', previousSelection, 'to', logIndex)
57 end--@end-debug@
58 previousSelection = logIndex
59 end
60
61 --- Dummies for future ideas
62 T.RemoveQuestWatch = function(questIndex, ...) end
63 T.AddTrackedAchievement = function(cheevID) end
64 T.RemoveTrackedAchievement = function(cheevID) end
65 T.AcceptQuest = function() end