# HG changeset patch # User Nenue # Date 1468015309 14400 # Node ID f253baf6022d1a705f4df03c5ec3cdff38a17f92 # Parent 3cecf50070ba3113c62a9e6f0bcb1b2b344a1d97 ObjectiveTracker: - Quest tracker now checks all of its allotted frames for data validity, - it also uses GetQuestLogTitle to verify non-zero log indexes diff -r 3cecf50070ba -r f253baf6022d ObjectiveTracker/Default.lua --- a/ObjectiveTracker/Default.lua Fri Jun 10 20:53:59 2016 -0400 +++ b/ObjectiveTracker/Default.lua Fri Jul 08 18:01:49 2016 -0400 @@ -135,7 +135,7 @@ if not index then return end - local info = handler.WatchList[index] -- should match up with whatever the internal watch list has + local info = handler.WatchList[index] -- should match corresponding internal watch lists if they exist if not info then return end diff -r 3cecf50070ba -r f253baf6022d ObjectiveTracker/Layout.lua --- a/ObjectiveTracker/Layout.lua Fri Jun 10 20:53:59 2016 -0400 +++ b/ObjectiveTracker/Layout.lua Fri Jul 08 18:01:49 2016 -0400 @@ -38,12 +38,13 @@ local Wrapper = _G.VeneerObjectiveWrapper local Scroller = Wrapper.scrollArea local Scroll = _G.VeneerObjectiveScroll -local orderedHandlers = T.orderedHandlers -local orderedNames = T.orderedNames +local orderedHandlers = T.orderedHandlers -- ['module'].frame +local orderedNames = T.orderedNames -- ['module'].frame --- FRAME TEMP VARIABLES local wrapperWidth, wrapperHeight = 0, 0 local scrollWidth, scrollHeight +local blockPosition --- SCHEMA VARIABLES local schemaName, lastSchema = { @@ -82,7 +83,6 @@ local titleSpacing, textSpacing, blockSpacing = 3, 3, 1 local titleIndent, textIndent,selectionIndent = 2, 5, 50 --- END SCHEMA -local blockPosition local SetAnimate = function(reason, animate) diff -r 3cecf50070ba -r f253baf6022d ObjectiveTracker/ObjectiveTracker.xml --- a/ObjectiveTracker/ObjectiveTracker.xml Fri Jun 10 20:53:59 2016 -0400 +++ b/ObjectiveTracker/ObjectiveTracker.xml Fri Jul 08 18:01:49 2016 -0400 @@ -324,6 +324,21 @@ + + + diff -r 3cecf50070ba -r f253baf6022d ObjectiveTracker/QuestData.lua --- a/ObjectiveTracker/QuestData.lua Fri Jun 10 20:53:59 2016 -0400 +++ b/ObjectiveTracker/QuestData.lua Fri Jul 08 18:01:49 2016 -0400 @@ -101,7 +101,6 @@ local GetQuestWatchIndex = GetQuestWatchIndex local numAnimating = 0 -local blocksChecked = {} --- Get a total of things to show, and straighten out the index while we're at it --- Return the number shown, total in log, and the info table to parse @@ -118,13 +117,8 @@ local bottomIndex = 1 local start, limit = 1, numAll - if id and not added then - -- if a particular id is supplied, add to checklist - if self.InfoBlock[id] then - blocksChecked[self.InfoBlock[id]] = self.InfoBlock[id] - end - end + --- Update the index tables numAnimating = 0 local numEntries = 0 for logIndex = start, limit do @@ -132,11 +126,11 @@ local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(logIndex) local watchIndex = GetQuestWatchIndex(logIndex) - --- Start of crazy audit flagging + if watchIndex and watchIndex >= bottomIndex then -- do watch data pointers match? - local watchInfo = self.WatchInfo[watchIndex] - local watchBlock = self.WatchBlock[watchIndex] + local watchInfo, watchBlock = self.WatchInfo[watchIndex], self.WatchBlock[watchIndex] + if watchInfo and watchInfo.questID ~= questID then print('GetNumWatched', 'trimming WatchInfo ['..watchIndex..'] =/=', questID) self.WatchInfo[watchIndex] = nil @@ -144,7 +138,6 @@ if watchBlock and watchBlock.info.questID ~= questID then print('GetNumWatched', 'trimming WatchBlock ['..watchIndex..'] =/=', watchBlock:GetName()) self.WatchBlock[watchIndex] = nil - blocksChecked[watchBlock] = watchBlock end end @@ -155,7 +148,6 @@ if logBlock.info.questID ~= questID then print('GetQuests', 'replace info', logBlock.info.questID, '->', questID) self.LogBlock[logIndex] = nil - blocksChecked[logBlock] = logBlock end end --- end of crazy audit flagging @@ -169,20 +161,24 @@ - --- After GetInfo pass, look for any non-conformant blocks and deal with them + --- Clean up blocks that got cut off for some reason for index, block in ipairs(self.usedBlocks) do - - local logIndex = GetQuestLogIndexByID(block.info.questID, 'player') -- animating blocks have been evaluated if not block.blockFadeOut:IsPlaying() then - if not logIndex then + + local logIndex = GetQuestLogIndexByID(block.info.questID, 'player') + print('GetNumWatched', GetQuestLogTitle(logIndex)) + local questID = select(8,GetQuestLogTitle(logIndex)) + print('GetNumWatched', questID) + + if questID == 0 then self:ClearBlock(block) - print('GetNumWatched', '|cFF44FF00'.. index, (block and block:GetName() or '|cFFFF0000-|r'), '(trim not active)') + print('GetNumWatched', '|cFF44FF00'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex, questID, '(unresolved)', block.info.title) elseif not IsQuestWatched(block.info.logIndex) then self:ClearBlock(block) - print('GetNumWatched', '|cFFFF4400'.. index, (block and block:GetName() or '|cFFFF0000-|r'), '(trim non-watched)') + print('GetNumWatched', '|cFFFF4400'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex, questID, '(unwatched)', block.info.title) else - print('GetNumWatched', '|cFF0088FF'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex or '|cFF444444-|r') + print('GetNumWatched', '|cFF0088FF'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex or '|cFF444444-|r', block.info.title) end else @@ -574,3 +570,7 @@ print('removing', block.info.logIndex, 'from watcher') RemoveQuestWatch(block.info.logIndex) end + +Quest.OnRemoved = function(block) + print('OnRemoved', block:GetID()) +end \ No newline at end of file diff -r 3cecf50070ba -r f253baf6022d Veneer.lua --- a/Veneer.lua Fri Jun 10 20:53:59 2016 -0400 +++ b/Veneer.lua Fri Jul 08 18:01:49 2016 -0400 @@ -502,6 +502,7 @@ local name = self:GetName() + if self.drag then self:RegisterForDrag('LeftButton') self:SetScript('OnDragStart', prototypes.OnDragStart)