comparison ObjectiveEvents.lua @ 8:7923243ae972

ObjectiveUI & ObjectiveEvents - securehook to API calls for compatibility with addons that work with the objective tracking interface - let the API hooks invoke ObjectiveUI functions when possible - ObjectiveUI framescript handlers should use the corresponding API call if possible, so that addon space can be fully aware of our actions - Sanity check cached data when possible during 'Remove' hooks ObjectiveInfo - Add cheevID to criteria info ObjectiveCore - Index quest tracker blocks by their watch offset, and use that to verify whether the given block frame should be released into pool ObjectiveFrame - Differentiate between visible and non-visible unused buttons, and only release when their quest has been dropped
author Nenue
date Fri, 01 Apr 2016 14:40:14 -0400
parents 589de8ea05b9
children 880828018bf4
comparison
equal deleted inserted replaced
7:5301c68f28d8 8:7923243ae972
26 local BlizzHooks = { 26 local BlizzHooks = {
27 ['AddQuestWatch'] = 'AddQuestWatch', 27 ['AddQuestWatch'] = 'AddQuestWatch',
28 ['RemoveQuestWatch'] = 'RemoveQuestWatch', 28 ['RemoveQuestWatch'] = 'RemoveQuestWatch',
29 ['AbandonQuest'] = 'AbandonQuest', 29 ['AbandonQuest'] = 'AbandonQuest',
30 ['AcknowledgeAutoAcceptQuest'] = 'AcknowledgeAutoAcceptQuest', 30 ['AcknowledgeAutoAcceptQuest'] = 'AcknowledgeAutoAcceptQuest',
31 ['AddAutoQuestPopUp'] = 'AddAutoQuestPopUp' 31 ['AddAutoQuestPopUp'] = 'AddAutoQuestPopUp',
32 ['RemoveTrackedAchievement'] = 'RemoveTrackedAchievement'
32 } 33 }
33 34
34 mod.SetEvents = function() 35 mod.SetEvents = function()
35 36
36 for event, _ in pairs(SmallEvents) do 37 for event, _ in pairs(SmallEvents) do
109 ------------------------------------------------------------------- 110 -------------------------------------------------------------------
110 mod.AddQuestWatch = function(questID) 111 mod.AddQuestWatch = function(questID)
111 mod.UpdateWrapper() 112 mod.UpdateWrapper()
112 end 113 end
113 114
114 mod.RemoveQuestWatch = function(questIndex) 115 mod.RemoveQuestWatch = function(questIndex, ...)
116 print('|cFFFF8800RemoveQuestWatch', questIndex, ...)
117 local info = mod.Quest.LogInfo[questIndex]
118
119 -- remove quest refs
120 mod.Quest.LogBlock[questIndex] = nil
121 mod.Quest.QuestBlock[info.questID] = nil
122
123 -- remove if they still match
124 if mod.Quest.WatchInfo[info.watchIndex] == info then
125 print('cleaning dead WatchInfo entry')
126 mod.Quest.WatchInfo[info.watchIndex] = nil
127 end
128
115 mod.UpdateWrapper() 129 mod.UpdateWrapper()
130 QuestPOIUpdateIcons()
131 end
132
133 mod.RemoveTrackedAchievement = function(cheevID)
134 print('|cFFFF8800UntrackAchievement', cheevID)
135 mod.CleanWidgets()
116 end 136 end
117 137
118 mod.AcceptQuest = function() 138 mod.AcceptQuest = function()
119 end 139 end
120 140
121 mod.AbandonQuest = function() 141 mod.AbandonQuest = function()
142
143 QuestPOIUpdateIcons()
122 end 144 end
123 145
124 mod.TurnInQuest = function() 146 mod.TurnInQuest = function()
147
148 QuestPOIUpdateIcons()
125 end 149 end