Mercurial > wow > buffalo2
changeset 58:f253baf6022d
ObjectiveTracker:
- Quest tracker now checks all of its allotted frames for data validity,
- it also uses GetQuestLogTitle to verify non-zero log indexes
author | Nenue |
---|---|
date | Fri, 08 Jul 2016 18:01:49 -0400 |
parents | 3cecf50070ba |
children | 07ef62fe201f |
files | ObjectiveTracker/Default.lua ObjectiveTracker/Layout.lua ObjectiveTracker/ObjectiveTracker.xml ObjectiveTracker/QuestData.lua Veneer.lua |
diffstat | 5 files changed, 39 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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)
--- 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 @@ </FontString> </Layer> </Layers> + <Frames> + <Button name="$parentRefreshBtn" parentArray="debug" parentKey="refresh"> + <Anchors> + <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" x="0" y="-20" /> + </Anchors> + <Size x="30" y="20" /> + <ButtonText inherits="GameFontNormal" text="GetNumWatched" /> + <NormalTexture setAllPoints="true"> + <Color a="1" r="0" g="0" b="0" /> + </NormalTexture> + <PushedTexture setAllPoints="true"> + <Color r="1" g="1" b="1" a="1" /> + </PushedTexture> + </Button> + </Frames> </Frame>
--- 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