# HG changeset patch # User Nenue # Date 1459831152 14400 # Node ID 880828018bf40cacd786a5e0e39cd0bd6ba25c27 # Parent f660f1c1e0aa70deacece266c32944d7b0381571 ObjectiveEvents - trim down the number of events that fire full updates - begin the general outline for determining which trackers need to refresh - handlers for accepting and completing auto-popup quests ObjectiveFrame - correct variables for money reward calculation - make sure everythign is scaling to the font strings and that the font strings aren't being pinned by SetSize ObjectiveInfo - implementation of autoquest popups - discern between internal and client bonus objective indexes - acquire the correct data set from bonus objective query ObjectiveStyle - look for a style table under the previously interpreted set before deferring standard options - horizontal/vertical options in gradient - remove height-fixing for font strings diff -r f660f1c1e0aa -r 880828018bf4 ObjectiveCore.lua --- a/ObjectiveCore.lua Mon Apr 04 03:41:28 2016 -0400 +++ b/ObjectiveCore.lua Tue Apr 05 00:39:12 2016 -0400 @@ -6,9 +6,9 @@ local B = select(2,...).frame local pairs, setmetatable, type, tostring = pairs, setmetatable, type, tostring local format = string.format -local M = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') +local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') local print = B.print('Objectives') -local ObjectiveTrackerFrame = ObjectiveTrackerFrame +local ObjectiveTrackerFrame, VeneerObjectiveScroll, CreateFrame = ObjectiveTrackerFrame, VeneerObjectiveScroll, CreateFrame --[[ Full quest info is available if: @@ -25,95 +25,95 @@ - Its binary completion status ]] ---- Global Frames -local Wrapper = _G.VeneerObjectiveWrapper -local Scroller = Wrapper.scrollArea -local Scroll = _G.VeneerObjectiveScroll + + +--- Performance values +--[[ + self:RegisterEvent("QUEST_LOG_UPDATE"); + self:RegisterEvent("TRACKED_ACHIEVEMENT_LIST_CHANGED"); + self:RegisterEvent("QUEST_WATCH_LIST_CHANGED"); + self:RegisterEvent("QUEST_AUTOCOMPLETE"); + self:RegisterEvent("QUEST_ACCEPTED"); + self:RegisterEvent("SUPER_TRACKED_QUEST_CHANGED"); + self:RegisterEvent("SCENARIO_UPDATE"); + self:RegisterEvent("SCENARIO_CRITERIA_UPDATE"); + self:RegisterEvent("TRACKED_ACHIEVEMENT_UPDATE"); + self:RegisterEvent("ZONE_CHANGED_NEW_AREA"); + self:RegisterEvent("ZONE_CHANGED"); + self:RegisterEvent("QUEST_POI_UPDATE"); + self:RegisterEvent("VARIABLES_LOADED"); + self:RegisterEvent("QUEST_TURNED_IN"); + self:RegisterEvent("PLAYER_MONEY"); + ]] +mod.Reason ={ + UPDATE_MASK_AUTOQUEST = 0x00000001, + UPDATE_MASK_QUEST = 0x00000002, + UPDATE_MASK_BONUS = 0x00000004, + UPDATE_MASK_CHEEVS = 0x00000008, + UPDATE_MASK_ALL = 0x00000017, + + QUEST_LOG_UPDATE = 0x00000003, + TRACKED_ACHIEVEMENT_LIST_CHANGED = 0x00000008, + QUEST_WATCH_LIST_CHANGED = 0x00000003, + QUEST_AUTOCOMPLETE = 0x00000003, + QUEST_ACCEPTED = 0x00000003, + SUPER_TRACKED_QUEST_CHANGED = 0x00000002, + SCENARIO_UPDATE = 0x00000004, + SCENARIO_CRITERIA_UPDATE = 0x00000004, + TRACKED_ACHIEVEMENT_UPDATE = 0x00000008, + ZONE_CHANGED_NEW_AREA = 0x00000017, + ZONE_CHANGED = 0x00000017, + QUEST_POI_UPDATE = 0x00000003, + QUEST_TURNED_IN = 0x00000003, +} +mod.MoneyReasons = 0 --- Baseline defaults -M.defaults = { - -} +mod.defaults = {} --- list used to make things happen -M.orderedNames = {'Bonus', 'AutoQuest', 'Quest', 'Cheevs'} +mod.orderedNames = {'Bonus', 'AutoQuest', 'Quest', 'Cheevs'} --- ipairs() list of handlers for wrapper update -M.orderedHandlers = {} -M.orderedTrackers = {} -M.indexedTrackers = {} +mod.orderedHandlers = {} +mod.orderedTrackers = {} +mod.indexedTrackers = {} --- pairs() list of handler frames for tracker updates -M.namedTrackers = {} +mod.namedTrackers = {} --- Handler stubs -M.AutoQuest = { +mod.AutoQuest = { name = "AutoQuest", - displayName = "Local Quests", + displayName = "Notice", } -M.Quest = { +mod.Quest = { name = "Quest", displayName = "Quests", } -M.Cheevs = { +mod.Cheevs = { name = "Cheevs", displayName = "Achievements", } -M.Bonus = { +mod.Bonus = { name = "Bonus", displayName = "Bonus Objectives", } - ---- Temp values set during updates -local wrapperWidth, wrapperHeight -local scrollWidth, scrollHeight -local previousBlock -local currentBlock - -local frame_guide_init = function(self) - self.testU = self.testU or self:CreateTexture('TestU', 'OVERLAY', 'VnTestLine') - self.testB = self.testB or self:CreateTexture('TestB', 'OVERLAY', 'VnTestLine') - self.testL = self.testL or self:CreateTexture('TestL', 'OVERLAY', 'VnTestLine') - self.testR = self.testR or self:CreateTexture('TestR', 'OVERLAY', 'VnTestLine') -end -local frame_guide = function(self, target) - if not target then return end - if target:IsDragging() then return end - local thickness = 1 - local midX, midY = target:GetCenter() - local width, height = target:GetWidth() * 1.5, target:GetHeight() * 1.5 - --print('frame', target:GetLeft(), target:GetTop(), target:GetRight(), target:GetBottom()) - self.testB:ClearAllPoints() - self.testB:SetPoint('TOP', UIParent, 'BOTTOMLEFT', midX, target:GetBottom()) - self.testB:SetSize(width,thickness) - - self.testU:ClearAllPoints() - self.testU:SetPoint('BOTTOM', UIParent, 'BOTTOMLEFT', midX, target:GetTop()) - self.testU:SetSize(width,thickness) - - self.testL:ClearAllPoints() - self.testL:SetPoint('RIGHT', UIParent, 'BOTTOMLEFT', target:GetLeft(), midY) - self.testL:SetSize(thickness,height) - - self.testR:ClearAllPoints() - self.testR:SetPoint('LEFT', UIParent, 'BOTTOMLEFT', target:GetRight(), midY) - self.testR:SetSize(thickness,height) -end - --- Handler template local CreateHandler = function (self, name, index) print(self, name) - local handler = setmetatable({}, { + + local handler = setmetatable(mod[name] or {}, { __tostring = function() return name end, - __call = function (self) M.UpdateTracker(self) end + __call = function (self) mod.UpdateTracker(self) end }) - if type(M.orderedHandlers[index]) == 'table' then - return M.orderedHandlers[index] + if type(mod.orderedHandlers[index]) == 'table' then + return mod.orderedHandlers[index] end print('take up locals first') local preset = {} - for k,v in pairs(M[name]) do + for k,v in pairs(mod[name]) do preset[k] = true if type(v) == 'table' then handler[k] = {} @@ -122,6 +122,7 @@ end end + print('resulting handler contents') for k, v in pairs(self) do if not handler[k] then @@ -129,7 +130,7 @@ -- assume all tables to be local data; don't inherit or ref handler[k] = {} else - handler[k] = M.Tracker[k] + handler[k] = mod.Tracker[k] end else print(name, 'has its own', k) @@ -137,18 +138,20 @@ end print('|cFFFF4400'..tostring(name)..'|r:') for k, v in pairs(handler) do - print(string.format("%24s %8s %s", (preset[k] and '|cFFFFFFFF' or '|cFFFFFF00') .. k .. '|r', type(v), tostring(v))) + print(format("%24s %8s %s", (preset[k] and '|cFFFFFFFF' or '|cFFFFFF00') .. k .. '|r', type(v), tostring(v))) end - M[name] = handler - M.orderedHandlers[index] = handler + + mod[name] = handler + + mod.orderedHandlers[index] = handler return true end -M.Tracker = setmetatable({}, { +mod.Tracker = setmetatable({}, { __call = CreateHandler, __tostring = function() return 'DEFAULT_TRACKING_HANDLER' end }) -local Tracker = M.Tracker +local Tracker = mod.Tracker Tracker.numWatched = 0 --- number of entries being handled Tracker.numBlocks = 0 --- number of blocks created Tracker.actualBlocks = 0 --- number of blocks in use @@ -159,10 +162,8 @@ Tracker.Watched = {} -- find by watchIndex Tracker.Info = {} -- find by data ID Tracker.BlockInfo = {} -- find by block ID -Tracker.LogInfo = {} -- find by log ID (quest log mainly) -Tracker.WatchInfo = {} -Tracker.LogBlock = {} -Tracker.WatchBlock = {} +Tracker.WatchInfo = {} -- find data by watch index +Tracker.WatchBlock = {} -- find block by watch index @@ -173,8 +174,8 @@ block = handler.freeBlocks[#handler.freeBlocks] handler.freeBlocks[#handler.freeBlocks] = nil else - block = CreateFrame('Frame', 'Veneer'..tostring(handler)..'Block'..blockIndex, Scroll, 'VeneerTrackerBlock') - block.SetStyle = M.SetBlockStyle + block = CreateFrame('Frame', 'Veneer'..tostring(handler)..'Block'..blockIndex, VeneerObjectiveScroll, 'VeneerTrackerBlock') + block.SetStyle = mod.SetBlockStyle block.Select = handler.Select block.Open = handler.Open block.Remove = handler.Remove @@ -189,38 +190,10 @@ return handler.usedBlocks[blockIndex] end -function M:OnInitialize() +function mod:OnInitialize() self.InitializeWrapper() self.InitializeXPTracker() - M.SetEvents() + mod.SetEvents() ObjectiveTrackerFrame:UnregisterAllEvents() ObjectiveTrackerFrame:Hide() - end - ---[[ -QUESTLINE_UPDATE This event is not yet documented -QUESTTASK_UPDATE This event is not yet documented -QUEST_ACCEPTED Fires when a new quest is added to the player's quest log (which is what happens after a player accepts a quest). -QUEST_ACCEPT_CONFIRM Fires when certain kinds of quests (e.g. NPC escort quests) are started by another member of the player's group -QUEST_AUTOCOMPLETE Fires when a quest is automatically completed (remote handin available) -QUEST_BOSS_EMOTE This event is not yet documented -QUEST_CHOICE_CLOSE This event is not yet documented -QUEST_CHOICE_UPDATE This event is not yet documented -QUEST_COMPLETE Fires when the player is looking at the "Complete" page for a quest, at a questgiver. -QUEST_DETAIL Fires when details of an available quest are presented by a questgiver -QUEST_FINISHED Fires when the player ends interaction with a questgiver or ends a stage of the questgiver dialog -QUEST_GREETING Fires when a questgiver presents a greeting along with a list of active or available quests -QUEST_ITEM_UPDATE Fires when information about items in a questgiver dialog is updated -QUEST_LOG_UPDATE Fires when the game client receives updates relating to the player's quest log (this event is not just related to the quests inside it) -QUEST_POI_UPDATE This event is not yet documented -QUEST_PROGRESS Fires when interacting with a questgiver about an active quest -QUEST_REMOVED This event is not yet documented -QUEST_TURNED_IN Fired when a quest is turned in -QUEST_WATCH_LIST_CHANGED This event is not yet documented -QUEST_WATCH_OBJECTIVES_CHANGED This event is not yet documented -QUEST_WATCH_UPDATE Fires when the player's status regarding a quest's objectives changes, for instance picking up a required object or killing a mob for that quest. All forms of (quest objective) progress changes will trigger this event.] - -TRACKED_ACHIEVEMENT_LIST_CHANGED This event is not yet documented -TRACKED_ACHIEVEMENT_UPDATE Fires when the player's progress changes on an achievement marked for watching in the objectives tracker - ]] \ No newline at end of file diff -r f660f1c1e0aa -r 880828018bf4 ObjectiveEvents.lua --- a/ObjectiveEvents.lua Mon Apr 04 03:41:28 2016 -0400 +++ b/ObjectiveEvents.lua Tue Apr 05 00:39:12 2016 -0400 @@ -13,10 +13,31 @@ QUEST_REMOVED = 'OnQuestRemoved' } +--- Using the same values as Blizzard_ObjectiveTracker for use in securehook +local OBJECTIVE_TRACKER_UPDATE_QUEST = 0x0001; +local OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED = 0x0002; +local OBJECTIVE_TRACKER_UPDATE_TASK_ADDED = 0x0004; +local OBJECTIVE_TRACKER_UPDATE_SCENARIO = 0x0008; +local OBJECTIVE_TRACKER_UPDATE_SCENARIO_NEW_STAGE = 0x0010; +local OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT = 0x0020; +local OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED = 0x0040; +local OBJECTIVE_TRACKER_UPDATE_SCENARIO_BONUS_DELAYED = 0x0080; + +local OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST = 0x0100; +local OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP = 0x0200; +local OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE = 0x0400; +local OBJECTIVE_TRACKER_UPDATE_MODULE_SCENARIO = 0x0800; +local OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT = 0x1000; + +local OBJECTIVE_TRACKER_UPDATE_STATIC = 0x0000; +local OBJECTIVE_TRACKER_UPDATE_ALL = 0xFFFF; + +local OBJECTIVE_TRACKER_UPDATE_REASON = OBJECTIVE_TRACKER_UPDATE_ALL; -- default +local OBJECTIVE_TRACKER_UPDATE_ID = 0; + local HandlerEvents = { - QUEST_ACCEPTED = mod.Quest, - QUEST_REMOVED = mod.Quest, - QUEST_WATCH_LIST_CHANGED = mod.Quest, + QUEST_ACCEPTED = 0x0003, + QUEST_WATCH_LIST_CHANGED = 0x0003, SUPER_TRACKED_QUEST_CHANGED = mod.Quest, QUEST_LOG_UPDATE = mod.Quest, TRACKED_ACHIEVEMENT_LIST_CHANGED = mod.Cheevs, @@ -29,6 +50,7 @@ ['AbandonQuest'] = 'AbandonQuest', ['AcknowledgeAutoAcceptQuest'] = 'AcknowledgeAutoAcceptQuest', ['AddAutoQuestPopUp'] = 'AddAutoQuestPopUp', + ['RemoveAutoQuestPopUp'] = 'RemoveAutoQuestPopUp', ['RemoveTrackedAchievement'] = 'RemoveTrackedAchievement' } @@ -70,7 +92,7 @@ end if HandlerEvents[event] then print('|cFF0088FF'..event..'|r wrapper update') - mod.UpdateWrapper() + mod.UpdateWrapper(event) isHandled = true end if not isHandled then @@ -99,7 +121,7 @@ mod.OnQuestRemoved = function(_, questLogIndex, questID) - mod.UpdateWrapper() + mod.UpdateWrapper(0x00000003) end @@ -109,7 +131,7 @@ --- Function hooks for BlizzUI compatibility ------------------------------------------------------------------- mod.AddQuestWatch = function(questID) - mod.UpdateWrapper() + mod.UpdateWrapper(0x00000003) end mod.RemoveQuestWatch = function(questIndex, ...) @@ -126,7 +148,7 @@ mod.Quest.WatchInfo[info.watchIndex] = nil end - mod.UpdateWrapper() + mod.UpdateWrapper('RemovedQuestWatch' .. tostring(questIndex)) QuestPOIUpdateIcons() end @@ -146,4 +168,13 @@ mod.TurnInQuest = function() QuestPOIUpdateIcons() +end + +mod.AddAutoQuestPopUp = function(...) + print('|cFFFF8800AddAutoQuestPopUp|r', ...) + mod.UpdateWrapper(OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP) +end +mod.RemoveAutoQuestPopUp = function(...) + print('|cFFFF8800RemoveAutoQuestPopUp|r', ...) + mod.UpdateWrapper(OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP) end \ No newline at end of file diff -r f660f1c1e0aa -r 880828018bf4 ObjectiveFrame.lua --- a/ObjectiveFrame.lua Mon Apr 04 03:41:28 2016 -0400 +++ b/ObjectiveFrame.lua Tue Apr 05 00:39:12 2016 -0400 @@ -81,7 +81,7 @@ end --- xp bar - XPBar:SetWidth(wrapperWidth - Wrapper.close:GetWidth()) + XPBar:SetWidth(mod.Conf.Wrapper.WrapperWidth - Wrapper.CloseButton:GetWidth()) XPBar.statusbg:SetAllPoints(XPBar) XPBar:RegisterEvent('DISABLE_XP_GAIN') XPBar:RegisterEvent('ENABLE_XP_GAIN') @@ -243,7 +243,7 @@ --end if info.numObjectives >= 1 then - t.attachmentHeight = textSpacing + t.attachmentHeight = 0 t.status:Show() print(' lines to build:', info.numObjectives) @@ -256,6 +256,7 @@ t.status:SetText(nil) end t.title:SetText(info.title) + print(' ', t.status:CanWordWrap(), t.status:GetStringHeight()) if info.specialItem and not info.itemButton then @@ -273,12 +274,25 @@ print(' anchor to|cFF0088FF', previousBlock:GetName()) end + --- metrics are calculated in SetStyle t:SetStyle('TrackerBlock', handler.name, t.mainStyle, t.subStyle) t:Show() print(' |cFF00FFFF)|r -> ', t, t:GetHeight()) + if info.rewardInfo then + print('has immediate reward') + if info.rewardInfo[1].type == 'currency' or info.rewardInfo[1].type == 'item' then + t.icon:Show() + t.iconLabel:SetText(info.rewardInfo[1].count) + t.icon:SetSize(t.height, t.height) + t.icon:SetTexture(info.rewardInfo[1].texture) + end + + else + t.icon:Hide() + end if Devian and Devian.InWorkspace() then t.debugText:Show() @@ -309,6 +323,10 @@ if line.widget then + if attachmentHeight == 0 then + attachmentHeight = block.status.spacing + end + line.widget:Show() line.widget:SetParent(block) line.widget:SetPoint('TOPLEFT', block.status, 'BOTTOMLEFT', 0, -attachmentHeight ) @@ -329,6 +347,7 @@ block.attachmentHeight = attachmentHeight block.status:SetText(text) + block.status:SetWordWrap(true) end --- Objective parsers @@ -351,9 +370,7 @@ Bonus.ParseObjective = function(line, info) local print = B.print('BonusLine') - for k,v in pairs(line) do - print(k, v) - end + line.displayColor = 'FFFFFF' if line.text and not info.title then @@ -425,7 +442,8 @@ mod.Quest.numButtons = 0 local usedButtons = mod.Quest.itemButtons local freeButtons = mod.Quest.freeButtons -mod.UpdateWrapper = function() +mod.UpdateWrapper = function(reason) + print('|cFF00FFFFUpdateWrapper:|r', reason) unitLevel = UnitLevel('player') wrapperWidth = mod.Conf.Wrapper.WrapperWidth scrollWidth = mod.Conf.Wrapper.WrapperWidth diff -r f660f1c1e0aa -r 880828018bf4 ObjectiveInfo.lua --- a/ObjectiveInfo.lua Mon Apr 04 03:41:28 2016 -0400 +++ b/ObjectiveInfo.lua Tue Apr 05 00:39:12 2016 -0400 @@ -1,7 +1,7 @@ local B = select(2,...).frame local wipe, pairs, ipairs, min, max, unpack = table.wipe, pairs, ipairs, min, max, unpack local GetNumQuestLeaderBoards, GetAchievementNumCriteria, GetQuestLogLeaderBoard, GetAchievementCriteriaInfo = GetNumQuestLeaderBoards, GetAchievementNumCriteria, GetQuestLogLeaderBoard, GetAchievementCriteriaInfo -local GetQuestLogIndexByID, GetSuperTrackedQuestID, SetSuperTrackedQuestID, GetQuestWatchInfo = GetQuestLogIndexByID, GetSuperTrackedQuestID, SetSuperTrackedQuestID, GetQuestWatchInfo +local GetQuestWatchIndex, GetQuestLogIndexByID, GetSuperTrackedQuestID, SetSuperTrackedQuestID, GetQuestWatchInfo = GetQuestWatchIndex, GetQuestLogIndexByID, GetSuperTrackedQuestID, SetSuperTrackedQuestID, GetQuestWatchInfo local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') local print = B.print('TrackerInfo') @@ -13,9 +13,34 @@ ----------------------------- --- AUTO_QUEST -AutoQuest.GetNumWatched = GetNumAutoQuestPopUps -AutoQuest.GetInfo = function(watchIndex) - return Quest.GetInfo(watchIndex) +AutoQuest.LogInfo = {} +AutoQuest.LogBlock = {} +AutoQuest.QuestBlock = {} +AutoQuest.WatchBlock = {} +AutoQuest.GetNumWatched = function() + AutoQuest.numWatched = GetNumAutoQuestPopUps() + return AutoQuest.numWatched +end +AutoQuest.GetInfo = function(self, popupIndex) + + local questID, type = GetAutoQuestPopUp(popupIndex) + local questIndex = GetQuestLogIndexByID(questID) + local questWatchIndex = GetQuestWatchIndex(questIndex) + + local questInfo = Quest:GetInfo(questWatchIndex) + self.Info[questID] = { + title = questInfo.title, + description = type, + popupType = type, + questID = questID, + questIndex = questIndex, + popupIndex = popupIndex, + watchIndex = questWatchIndex, + numObjectives = 0 + } + + + return self.Info[questID] end ----------------------------- @@ -26,42 +51,57 @@ local taskData = {} Bonus.QuestBlock = {} +Bonus.TaskWatch = {} Bonus.GetNumWatched = function() - Bonus.TasksTable = GetTasksTable() + local tasks = GetTasksTable() local numTasks = 0 - for i, questID in ipairs(Bonus.TasksTable) do - local isInArea, isOnMap, numObjectives = GetTaskInfo(questID) - if isInArea and isOnMap then + Bonus.TaskWatch = {} + print('|cFFFFFF00Bonus.GetNumWatched()|r', #tasks) + for i, questID in ipairs(tasks) do + local t = Bonus.StoreTask(questID) + print (' taskIndex', i, 'questID', questID) + print(' isComplete', t.isComplete) + if (t.inInArea or t.isOnMap) and not t.isComplete then numTasks = numTasks + 1 + Bonus.TaskWatch[numTasks] = t end end Bonus.numAll = #Bonus.TasksTable Bonus.numWatched = numTasks return GetNumQuestLogTasks() end -Bonus.GetInfo = function(self, watchIndex) - local questID = Bonus.TasksTable[watchIndex] + +Bonus.GetInfo = function(self, taskIndex) + return Bonus.TaskWatch[taskIndex] +end + +Bonus.StoreTask = function(questID) + if not questID then - print('|cFFFF4400no quest ID for row', watchIndex) + print('|cFFFF4400invalid quest ID', questID) return end + Bonus.Info[questID] = Bonus.Info[questID] or {} + local t = Bonus.Info[questID] + local isInArea, isOnMap, numObjectives = GetTaskInfo(questID) + t.questID = questID + t.numObjectives = numObjectives + t.isInArea = isInArea + t.isOnMap = isOnMap - local t= {} - t.isInArea, t.isOnMap, t.numObjectives = GetTaskInfo(questID) - - print('isInArea', t.isInArea, 'isOnMap', t.isOnMap, 'numObj', t.numObjectives) - t.displayObjectives = false - t.isComplete = true - t.questID = questID - if t.numObjectives >= 1 then - print(t.numObjectives,'objective rows') + print(' isInArea', isInArea, 'isOnMap', isOnMap, 'numObj', numObjectives) + local displayObjectives = false + local isComplete = true + if numObjectives >= 1 then + print(' ', numObjectives,'objective rows') t.objectives = {} for i = 1, t.numObjectives do t.objectives[i] = {} local o = t.objectives[i] o.index = i - o.text, o.objectiveType, o.finished, o.displayAsObjective = GetQuestObjectiveInfo(questID, i, true) + --local text, objectiveType, finished, displayAsObjective = + o.text, o.objectiveType, o.finished, o.displayAsObjective = GetQuestObjectiveInfo(questID, i, false) print(i, '==>', o.text, o.objectiveType, o.finished, o.displayAsObjective) t.displayObjectives = t.displayObjectives or o.displayAsObjective @@ -69,6 +109,52 @@ end end + + t.displayObjectives = displayObjectives + + + local rewards = {} + t.numCurrencies = GetNumQuestLogRewardCurrencies(questID) + for i = 1, t.numCurrencies do + local name, texture, count = GetQuestLogRewardCurrencyInfo(i, questID) + tinsert(rewards,{ + type = 'currency', + index = i, + name = name, + texture = texture, + count = count + }); + end + -- items + t.numItems = GetNumQuestLogRewards(questID) + for i = 1, t.numItems do + local name, texture, count, quality, isUsable = GetQuestLogRewardInfo(i, questID) + tinsert(rewards, { + type = 'item', + index = i , + name = name, + texture = texture, + count = count, + quality = quality, + isUsable = isUsable + }); + end + -- money + + local money = GetQuestLogRewardMoney(questID) + if ( money > 0 ) then + tinsert(rewards, { + type = 'money', + name = GetMoneyString(money), + texture = "Interface\\Icons\\inv_misc_coin_01", + count = 0, + }); + end + + if #rewards >= 1 then + t.rewardInfo = rewards + end + Bonus.TasksTable[questID] = t return t @@ -80,6 +166,8 @@ Quest.freeButtons = {} Quest.POI = {} Quest.QuestBlock = {} +Quest.LogBlock = {} +Quest.LogInfo = {} Quest.GetNumWatched = function() Quest.numAll = GetNumQuestLogEntries() Quest.numWatched = GetNumQuestWatches() @@ -96,9 +184,9 @@ if not questID then return end - self.Info[questID] = self.Info[questID] or {} + Quest.Info[questID] = Quest.Info[questID] or {} - local q = self.Info[questID] + local q = Quest.Info[questID] q.watchIndex = watchIndex q.type = 'Quest' q.questID = questID diff -r f660f1c1e0aa -r 880828018bf4 ObjectiveStyle.lua --- a/ObjectiveStyle.lua Mon Apr 04 03:41:28 2016 -0400 +++ b/ObjectiveStyle.lua Tue Apr 05 00:39:12 2016 -0400 @@ -85,7 +85,7 @@ TextColor = {1, .9, .2, 1}, }, titlebg = { - Gradient = {MinColor = {0,0,0,0.25}, MaxColor = {0,0,0,.15}}, + Gradient = {'VERTICAL', MinColor = {0,0,0,0.25}, MaxColor = {0,0,0,.15}}, } } }, @@ -93,7 +93,7 @@ Normal = { titlebg = { Indent = 2, - Gradient = { MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}}, + Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}}, }, title = { TextColor = {1,1,1,0.5}, @@ -106,7 +106,7 @@ Spacing = textSpacing, }, statusbg = { - Gradient = { MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}}, + Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}}, } }, Super = { @@ -116,7 +116,7 @@ Spacing = titleSpacing, BackgroundFullWidth = true }, titlebg = { - Gradient = { MinColor = {0, .7, .6, .45}, MaxColor = {0, .7, .6, 0.23}}, + Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23}}, }, status = { TextColor = {1,1,1,1}, @@ -124,7 +124,7 @@ Spacing = textSpacing, }, statusbg = { - Gradient = { MinColor = {0, .7, .6, 0.40}, MaxColor = {0, .7, .6, 0.23} }, + Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23} }, }, }, MouseDown = { @@ -133,14 +133,14 @@ Spacing = titleSpacing, }, titlebg = { - Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, }, + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, }, }, status = { Font = {textFont, textSize, textOutline}, Spacing = textSpacing, }, statusbg = { - Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, }, + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, }, } }, Complete = { @@ -149,25 +149,46 @@ Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing, }, titlebg = { - Gradient = { MinColor = {0, 1, 0, 0.34}, MaxColor = {0, 1, 0, .17}, }, + Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, 0.34}, }, }, status = { TextColor = {1,1,1,0.5}, Font = {textFont, textSize, textOutline}, Spacing = textSpacing, }, statusbg = { - Gradient = { MinColor = {0, 1, 0, .25}, MaxColor = {0, 1, 0, 0.12}, }, + Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, .25}, }, } }, Daily = { titlebg = { - Gradient = { MinColor = {0, .4, 1, 0.34}, MaxColor = {0, 0.4, 1, .17}, }, + Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0.34}, MaxColor = {0, 0.4, 1, .17}, }, }, statusbg = { - Gradient = { MinColor = {0, .4, 1, 0.25}, MaxColor = {0, 0.4, 1, .12}, }, + Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0.25}, MaxColor = {0, 0.4, 1, .12}, }, }, }, - Cheev = { + AutoQuest = { + Normal = { + titlebg = { + Indent = 2, + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}}, + }, + title = { + TextColor = {1,1,1,1}, + Font = {titleFont, titleSize, titleOutline}, + Spacing = titleSpacing, + }, + status = { + TextColor = {0,1,0,1}, + Font = {textFont, textSize, textOutline}, + Spacing = textSpacing, + }, + statusbg = { + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}}, + } + }, + }, + Cheevs = { Normal = { title = { @@ -175,7 +196,7 @@ Spacing = titleSpacing, }, titlebg = { - Gradient = { MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, }, status = { @@ -183,7 +204,7 @@ Spacing = textSpacing, }, statusbg = { - Gradient = { MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, }, }, Complete = { @@ -192,14 +213,14 @@ Spacing = titleSpacing, }, titlebg = { - Gradient = { MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, }, status = { Font = {textFont, textSize, textOutline}, Spacing = textSpacing, }, statusbg = { - Gradient = { MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, + Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, }, }, } @@ -221,11 +242,12 @@ mod.regionStyles = {} mod.SetBlockStyle = function(frame, frameType, ...) -- var names intended to reflect argument order - print('|cFFFFFF00'..frame:GetName()..'|r') + print('|cFFFFFF00'..frame:GetName()..'|r', frameType, ...) --@debug@ local c = mod.defaults.Normal local style_list = {... } local styleName = frameType .. '-' .. table.concat(style_list,'') + local previousClass = mod.Conf.Style[frameType] if not style_cache[styleName] then local style = {} @@ -238,15 +260,21 @@ local normal = mod.defaults.Style.Normal local root = mod.defaults.Style[frameType] or normal for i, className in ipairs(style_list) do - local class = root[className] or normal[className] or root - if root[className] then - + local class = normal + if previousClass and previousClass[className] then + class = previousClass[className] + print(' ChildClass |cFFFF0088'.. className .. '|r') + elseif root[className] then + class = root[className] print(' SubClass |cFF0088FF'.. className .. '|r') elseif normal[className] then + class = normal[className] print(' SubClass Normal.|cFFFF0088'..className..'|r') else - print(' SubClass Normal') + print(' SubClass not found '..className..'') end + previousClass = class + for elementName, element in pairs(class) do if not elementName:match('^%u') then print(' scanning Element |cFF8800FF'.. elementName ..'|r') @@ -263,7 +291,6 @@ end end - end for k, elements in pairs(mod.defaults.Style.Normal) do @@ -277,7 +304,7 @@ for k,v in pairs(style) do if type(v) == 'table' and not k:match('^%u') then for kk, vv in pairs(v) do - print(' |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', tostring(vv)) + print(' |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', (type(vv) == 'table' and ('{'..table.concat(vv,', ')..'}') or tostring(vv))) end else print(' |cFFFFFFFF' .. k ..'|r =', tostring(v)) @@ -301,7 +328,7 @@ for attributeName, value in pairs(styleset) do if mod.SetBlockAttribute[attributeName] then - print(' '..elementName..':'.. attributeName ..'(', value, ')') + print(' add function '..elementName..':'.. attributeName ..'(', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value)), ')') --mod.SetBlockAttribute[attributeName](region, value) @@ -343,20 +370,26 @@ frame.statusWidth = frame.width - normalSettings.status.Indent frame.titleWidth = frame.width - normalSettings.title.Indent + print((frame.status and frame.status:GetText())) + print((frame.status and frame.status:GetWidth())) + print(frame.status and frame.title:GetStringHeight()) + print(frame.title and (frame.title:GetStringHeight() + (frame.title.spacing or 0)*2) or 0) + print(frame.status and frame.status:GetStringHeight()) + print(frame.status and (frame.status:GetStringHeight() + (frame.status.spacing or 0)*2) or 0) if frame.status then print('status ', frame.statusHeight, normalSettings.status.Indent, 0, 'statusbg', frame.statusHeight) + frame.status:SetWidth(frame.width) frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0) - frame.status:SetHeight(frame.statusHeight) + --frame.status:SetHeight(frame.statusHeight) if frame.statusbg then - - frame.statusbg:SetHeight(frame.statusHeight + (frame.attachmentHeight or 0)) + frame.statusbg:SetHeight(frame.statusHeight) frame.statusbg:SetWidth(frame.width) end end if frame.title then print('title ',frame.titleHeight, normalSettings.title.Indent, 'titlebg',frame.titleHeight) frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent) - frame.title:SetHeight(frame.titleHeight) + frame.title:SetWidth(frame.width) if frame.titlebg then frame.titlebg:SetHeight(frame.titleHeight) frame.titlebg:SetWidth(frame.width) @@ -443,7 +476,7 @@ local print = B.print('Attribute') sb.Gradient = function(region, value) print('|cFF8844FFGradient|r', region:GetName(), unpack(value)) - o = 'HORIZONTAL' + o = value[1] a1, a2, a3, a4 = unpack(value.MinColor) b1, b2, b3, b4 = unpack(value.MaxColor) region:SetVertexColor(1,1,1) diff -r f660f1c1e0aa -r 880828018bf4 ObjectiveTracker.xml --- a/ObjectiveTracker.xml Mon Apr 04 03:41:28 2016 -0400 +++ b/ObjectiveTracker.xml Tue Apr 05 00:39:12 2016 -0400 @@ -254,9 +254,11 @@