annotate ObjectiveTracker/Data.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 adcd7c328d07
children
rev   line source
Nenue@28 1 local B = select(2,...).frame
Nenue@28 2 local wipe, pairs, ipairs, min, max, unpack = table.wipe, pairs, ipairs, min, max, unpack
Nenue@28 3 local tinsert, tostring, format, mod = tinsert, tostring, format, mod
Nenue@28 4 local GetQuestTagInfo, GetQuestLogTitle = GetQuestTagInfo, GetQuestLogTitle
Nenue@28 5 local GetNumQuestLogEntries, GetNumQuestWatches, GetQuestLogCompletionText, IsQuestWatched, IsQuestHardWatched, GetQuestLogSpecialItemInfo, GetQuestLogSpecialItemCooldown = GetNumQuestLogEntries, GetNumQuestWatches, GetQuestLogCompletionText, IsQuestWatched, IsQuestHardWatched, GetQuestLogSpecialItemInfo, GetQuestLogSpecialItemCooldown
Nenue@28 6 local GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetTasksTable, GetNumQuestLogTasks, GetTaskInfo, GetQuestObjectiveInfo = GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetTasksTable, GetNumQuestLogTasks, GetTaskInfo, GetQuestObjectiveInfo
Nenue@28 7 local GetNumQuestLogRewardCurrencies, GetQuestLogRewardCurrencyInfo, GetNumQuestLogRewards, GetQuestLogRewardInfo, GetQuestLogRewardMoney, GetMoneyString = GetNumQuestLogRewardCurrencies, GetQuestLogRewardCurrencyInfo, GetNumQuestLogRewards, GetQuestLogRewardInfo, GetQuestLogRewardMoney, GetMoneyString
Nenue@28 8 local GetNumQuestLeaderBoards, GetAchievementNumCriteria, GetQuestLogLeaderBoard, GetAchievementCriteriaInfo = GetNumQuestLeaderBoards, GetAchievementNumCriteria, GetQuestLogLeaderBoard, GetAchievementCriteriaInfo
Nenue@28 9 local GetQuestWatchIndex, GetQuestLogIndexByID, GetSuperTrackedQuestID, SetSuperTrackedQuestID, GetQuestWatchInfo = GetQuestWatchIndex, GetQuestLogIndexByID, GetSuperTrackedQuestID, SetSuperTrackedQuestID, GetQuestWatchInfo
Nenue@28 10 local QuestHasPOIInfo, GetDistanceSqToQuest, GetQuestFactionGroup = QuestHasPOIInfo, GetDistanceSqToQuest, GetQuestFactionGroup
Nenue@28 11 local GetTrackedAchievements, GetNumTrackedAchievements, GetAchievementInfo = GetTrackedAchievements, GetNumTrackedAchievements, GetAchievementInfo
Nenue@28 12 local GetMoney, floor = GetMoney, floor
Nenue@28 13 local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
Nenue@28 14 local print = B.print('Info')
Nenue@28 15 local QUEST_TAG_DUNGEON = QUEST_TAG_DUNGEON
Nenue@28 16 local QUEST_TAG_GROUP = QUEST_TAG_GROUP
Nenue@28 17 local QUEST_TAG_ACCOUNT = QUEST_TAG_ACCOUNT
Nenue@28 18 local QUEST_TAG_TCOORDS = QUEST_TAG_TCOORDS
Nenue@28 19 local LE_QUEST_FREQUENCY_DAILY = LE_QUEST_FREQUENCY_DAILY
Nenue@28 20 local LE_QUEST_FREQUENCY_WEEKLY = LE_QUEST_FREQUENCY_WEEKLY
Nenue@28 21 local FACTION_ALLIANCE, LE_QUEST_FACTION_HORDE, FACTION_HORDE, LE_QUEST_FACTION_HORDE = FACTION_ALLIANCE, LE_QUEST_FACTION_HORDE, FACTION_HORDE, LE_QUEST_FACTION_HORDE
Nenue@28 22
Nenue@28 23 local Tracker, Bonus, AutoQuest, Quest, Cheevs = T.DefaultTracker, T.Bonus, T.AutoQuest, T.Quest, T.Cheevs
Nenue@28 24 --------------------------------------------------------------------
Nenue@28 25 --- Tracker-specific data retrieval functions
Nenue@28 26 --------------------------------------------------------------------
Nenue@28 27
Nenue@28 28
Nenue@28 29
Nenue@28 30
Nenue@28 31 -----------------------------
Nenue@28 32 --- AUTO_QUEST
Nenue@28 33 -----------------------------
Nenue@28 34 --- BONUS OBJECTIVE
Nenue@28 35 -- The default UI pops them up as you enter their relevant areas, but the data is actually available at all times.
Nenue@28 36 -- The only requirement is that you've been to said area and progressed any of the objectives.
Nenue@28 37 -- Blizzard deal with this fact by caching any task data collected during session and masking out whatever gets completed.
Nenue@28 38 -- For the addon's module structure to work, GetNumWatched method also invokes a tasks table scan.
Nenue@28 39 -- That composes the table searched by GetInfo().
Nenue@28 40
Nenue@28 41 ------------------------------------------------------------------------------------------
Nenue@28 42 --- These functions are copied from Blizzard_BonusObjectiveTracker.lua;
Nenue@28 43 -- It's kind of dumb, but this avoids the risk of code taint.
Nenue@28 44