Mercurial > wow > buffalo2
diff 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 |
line wrap: on
line diff
--- a/ObjectiveEvents.lua Fri Apr 01 12:27:05 2016 -0400 +++ b/ObjectiveEvents.lua Fri Apr 01 14:40:14 2016 -0400 @@ -28,7 +28,8 @@ ['RemoveQuestWatch'] = 'RemoveQuestWatch', ['AbandonQuest'] = 'AbandonQuest', ['AcknowledgeAutoAcceptQuest'] = 'AcknowledgeAutoAcceptQuest', - ['AddAutoQuestPopUp'] = 'AddAutoQuestPopUp' + ['AddAutoQuestPopUp'] = 'AddAutoQuestPopUp', + ['RemoveTrackedAchievement'] = 'RemoveTrackedAchievement' } mod.SetEvents = function() @@ -111,15 +112,38 @@ mod.UpdateWrapper() end -mod.RemoveQuestWatch = function(questIndex) +mod.RemoveQuestWatch = function(questIndex, ...) + print('|cFFFF8800RemoveQuestWatch', questIndex, ...) + local info = mod.Quest.LogInfo[questIndex] + + -- remove quest refs + mod.Quest.LogBlock[questIndex] = nil + mod.Quest.QuestBlock[info.questID] = nil + + -- remove if they still match + if mod.Quest.WatchInfo[info.watchIndex] == info then + print('cleaning dead WatchInfo entry') + mod.Quest.WatchInfo[info.watchIndex] = nil + end + mod.UpdateWrapper() + QuestPOIUpdateIcons() +end + +mod.RemoveTrackedAchievement = function(cheevID) + print('|cFFFF8800UntrackAchievement', cheevID) + mod.CleanWidgets() end mod.AcceptQuest = function() end mod.AbandonQuest = function() + + QuestPOIUpdateIcons() end mod.TurnInQuest = function() + + QuestPOIUpdateIcons() end \ No newline at end of file