annotate ObjectiveTracker/Data.lua @ 37:e84d645c8ab8

- revised the tracker update function to build its complete data list up front and use the values as points of comparison for determining possible out of place blocks, which will be iterated over afterward to remove what wasn't re-used - also entailed revising the exact role of global event handlers and function hooks, limiting their directions of communication so one doesn't end up calling the other multiple or inifinity times - schema handling polish
author Nenue
date Mon, 18 Apr 2016 07:56:23 -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