Mercurial > wow > buffalo2
view ObjectiveTracker/Events.lua @ 34:9856ebc63fa4
- half solution to Update being fired multiple times during load
- change securefunc handlers to dispense a reason code; catch that reason code in the enclosure passed to hooksecurefunc, and decide whether to update or not from there.
author | Nenue |
---|---|
date | Sun, 17 Apr 2016 00:21:45 -0400 |
parents | 48b3e3959a0a |
children | e84d645c8ab8 |
line wrap: on
line source
--- ${PACKAGE_NAME} -- @file-author@ -- @project-revision@ @project-hash@ -- @file-revision@ @file-hash@ -- Created: 3/30/2016 1:23 AM local B = select(2,...).frame local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') local print = B.print('Objectives') local _G = _G local OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT = OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT local OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST_ADDED = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST_ADDED local OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST local OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP = OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP local GetQuestID, GetQuestLogIndexByID, AddQuestWatch, SetSuperTrackedQuestID = GetQuestID, GetQuestLogIndexByID, AddQuestWatch, SetSuperTrackedQuestID local QuestPOIUpdateIcons = QuestPOIUpdateIcons ------------------------------------------------------------------- --- Deal with blizzard API calls that affect the tracker/log contents --- mainly just hiding blocks until they can be picked up by the next update event ------------------------------------------------------------------- T.AddQuestWatch = function(questID) if not B.Conf.VeneerObjectiveWrapper.enabled then return end return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST end local Quest = T.Quest T.RemoveQuestWatch = function(questIndex, ...) print('|cFFFF8800RemoveQuestWatch', questIndex, ...) local block = T.Quest.LogBlock[questIndex] if block then block:Hide() end return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST end T.AddTrackedAchievement = function(cheevID) T.CleanWidgets() return OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT end T.RemoveTrackedAchievement = function(cheevID) T.CleanWidgets() return OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT end T.AcceptQuest = function() end T.AbandonQuest = function() QuestPOIUpdateIcons() return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST end T.CompleteQuest = function() local questID = GetQuestID() if T.Quest.Info[questID] then local q = T.Quest.Info[questID] if q.logIndex then local block = T.Quest.LogBlock[q.logIndex] if block and block.id == questID then block:Hide() end end end QuestPOIUpdateIcons() return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST end T.AddAutoQuestPopUp = function(...) return OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP end T.RemoveAutoQuestPopUp = function(questID) return OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP end T.SetSuperTrackedQuestID = function(questID) --T:Update() end