# HG changeset patch
# User Nenue
# Date 1460980583 14400
# Node ID e84d645c8ab8f60108ff4b87d5741b9d0ccf3f85
# Parent a487841050bef803a75226529a4cb12fee6427dd
- 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
diff -r a487841050be -r e84d645c8ab8 Core.xml
--- a/Core.xml Sun Apr 17 13:00:31 2016 -0400
+++ b/Core.xml Mon Apr 18 07:56:23 2016 -0400
@@ -30,7 +30,7 @@
-
+
diff -r a487841050be -r e84d645c8ab8 Init.lua
--- a/Init.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/Init.lua Mon Apr 18 07:56:23 2016 -0400
@@ -19,11 +19,19 @@
local moduleStack = {
}
+--- Utilities
+B.wipeall = function (...)
+ for i = 1, select('#', ...) do
+ wipe(select(i, ...))
+ end
+end
+
--- Various region categories
B.displays = {}
B.configLayers = {}
B.configLayersRef = {}
+
--@debug@
--- Generates a print handler pointing to a static channel signature
-- @usage func = B.print(sig)
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/Achievements.lua
--- a/ObjectiveTracker/Achievements.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/Achievements.lua Mon Apr 18 07:56:23 2016 -0400
@@ -11,53 +11,66 @@
local GetTime, GetAchievementNumCriteria, GetAchievementCriteriaInfo = GetTime, GetAchievementNumCriteria, GetAchievementCriteriaInfo
local GetNumTrackedAchievements, GetTrackedAchievements, GetAchievementInfo = GetNumTrackedAchievements, GetTrackedAchievements, GetAchievementInfo
local Default, Cheevs = T.DefaultHandler, T.Cheevs
-local print = B.print('Tracker')
-local lprint = B.print('Line')
-local iprint = B.print('Info')
+local wipe = table.wipe
+local print, bprint, lprint, iprint = B.print('Tracker'), B.print('Block'), B.print('Line'), B.print('iprint')
--- Data retrieval
-Cheevs.GetNumWatched = function(self)
- print('|cFF00FF00' .. GetTime())
- Cheevs.trackedCheevs = {GetTrackedAchievements()}
- return GetNumTrackedAchievements()
-end
-Cheevs.GetInfo = function(self, watchIndex)
- --- step 1: confirm primary data and begin an entry if needed
- local cheevID = Cheevs.trackedCheevs[watchIndex]
- local id, name, points, completed, month, day, year, description, flags, icon, rewardText, isGuildAch, wasEarnedByMe, earnedBy = GetAchievementInfo(cheevID)
- if not id then return false end
+Cheevs.GetNumWatched = function(self, targetID, isNew)
+ local trackedList = {GetTrackedAchievements() }
+ local numWatched, numAll = #trackedList, #self.WatchList
+ print(' |cFF00FF88GetNumWatched:|r',self.name, numWatched, ' ('..numAll..' recorded)')
+ local start = 1
+ local limit = max(numAll, #trackedList)
+ if targetID then
+ if not isNew and self.Info[targetID] then
+ -- if it's only an update, we can limit the scope
+ start = self.Info[targetID].watchIndex
+ print(' |cFF0088FFGetNumWatched: limit selection to['..start..'-'..limit..']')
+ if self.InfoBlock[targetID] then
+ self.InfoBlock[targetID]:Hide()
+ end
- if not self.Info[cheevID] then self.Info[cheevID] = {} end
- local c = self.Info[cheevID]
- local numObjectives = GetAchievementNumCriteria(cheevID)
-
- local tagInfo = {}
- local objectives = c.objectives or {}
- for i = 1, numObjectives do
- local description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(cheevID, i)
- local line = objectives[i] or {}
- line.objectiveIndex = i
- line.cheevID = cheevID
- line.text = description
- line.type = type
- line.finished = completed
- line.value = quantity
- line.maxValue = requiredQuantity
- line.characterName = characterName
- line.flags = flags
- line.assetID = assetID
- line.quantityString = quantityString
- line.criteriaID = criteriaID
- objectives[i] = line
+ end
end
+ for index = start, limit do
+ if index > numWatched then
+ self.WatchList[index] = nil
+ print(' % dropping watch entry #'..index)
+ else
+ local cheevID = trackedList[index]
+ if not self.Info[cheevID] then
+ self.Info[cheevID] = self:GetInfo(cheevID, index)
+ else
+ print(' |cFF00FFBBGetInfo:', cheevID, 'already pulled')
+ end
+ self:GetObjectives(cheevID)
+ local info = self.Info[cheevID]
+ local watchBlock = self.WatchBlock[cheevID]
+
+ self.Info[cheevID].watchIndex = index
+ self.WatchList[index] = info
+ end
+ end
+
+ numAll = #self.WatchList
+ return numWatched, numAll, self.WatchList
+end
+Cheevs.GetInfo = function(self, cheevID, watchIndex)
+ --- step 1: confirm primary data and begin an entry if needed
+ local id, name, points, completed, month, day, year, description, flags, icon, rewardText, isGuildAch, wasEarnedByMe, earnedBy = GetAchievementInfo(cheevID)
+ if not id then return nil end
+
+ print(' |cFF44AAFFGetInfo: pulling', id..',', name, earnedBy)
+
+
+ self.Info[cheevID] = self.Info[cheevID] or {}
+ local c = self.Info[cheevID]
local rewards = {}
- print(' |cFF0088FFGetInfo|r:', watchIndex, '|cFF00FFFF', name)
+ c.schema = 'achievement'
c.rewardInfo = rewards
- c.numObjectives = numObjectives
- c.objectives = objectives
c.type = 'Cheevs'
c.title = name
c.points = points
@@ -73,44 +86,84 @@
c.wasEarnedByMe = wasEarnedByMe
c.earnedBy = earnedBy
+ local tagInfo = {}
c.tagInfo = tagInfo
c.watchIndex = watchIndex
c.id = cheevID
c.cheevID = cheevID
+
+ self.Info[cheevID] = c
self.WatchInfo[watchIndex] = c
- return self.Info[cheevID]
+ return c
+end
+
+Cheevs.GetObjectives = function(self, cheevID)
+ local c = self.Info[cheevID]
+ c.numObjectives = GetAchievementNumCriteria(cheevID)
+ c.objectives = c.objectives or {}
+ for i = 1, c.numObjectives do
+ local description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(cheevID, i)
+ local line = c.objectives[i] or {}
+ line.objectiveIndex = i
+ line.cheevID = cheevID
+ line.text = description
+ line.type = type
+ line.finished = completed
+ line.value = quantity
+ line.maxValue = requiredQuantity
+ line.characterName = characterName
+ line.flags = flags
+ line.assetID = assetID
+ line.quantityString = quantityString
+ line.criteriaID = criteriaID
+ c.objectives[i] = line
+
+ print(' |cFF44FFDDGetObjectives:|r', i, type, description, quantityString)
+ end
end
--- Content handlers
Cheevs.UpdateLine = function(handler, block, line, data)
local print = B.print('CheevsLine')
local attachment
+ local text
line.progress = 0
print(' ', data.objectiveIndex,'|cFF0088FF-|r', data.objectiveType, data.text)
if data.flags then
if band(data.flags, 0x00000001) > 0 then
line.format = "%d/%d"
- line.widget = T.SetWidget(line, data, 'ProgressBar', data.criteriaID)
- line.height = line.widget.height
+ attachment = T.SetWidget(line, data, 'ProgressBar', data.criteriaID)
+ attachment.value = data.value
+ attachment.maxValue = data.maxValue
+ attachment:SetParent(handler.frame)
+
+ print(attachment:GetNumPoints())
+ for i = 1, attachment:GetNumPoints() do
+ print(' ',attachment:GetPoint(i))
+ end
+ attachment.status:SetFormattedText("%d/%d", data.value, data.maxValue)
+ attachment:SetPoint('TOP', line, 'TOP')
+ line.height = attachment.height
elseif band(data.flags, 0x00000002) then
line.widget = nil
+ text = line.text
else
line.widget = nil
line.displayColor = 'FFFFFF'
- line.displayText = line.text
+ text = line.text
end
else
line.displayText = data.text
end
- print('line.type =', data.type)
- print(' ** qtyStr:', data.quantityString, 'qty:', data.quantity, 'assetID:', data.assetID)
- return line.displayText, line.widget
+ print(' |cFF00DD22UpdateLine:|r', data.type, data.quantityString, 'qty:', data.quantity, 'assetID:', data.assetID)
+ return text, attachment, 'default'
end
Cheevs.Select = function(self, block)
Cheevs.Link(self, block)
+ T:Update(self.updateReasonModule, block.info.cheevID)
end
Cheevs.Remove = function(self, block)
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/AutoQuestPopups.lua
--- a/ObjectiveTracker/AutoQuestPopups.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/AutoQuestPopups.lua Mon Apr 18 07:56:23 2016 -0400
@@ -12,6 +12,7 @@
local GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle = GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle
--- Data retrieval
function AutoQuest:GetNumWatched ()
+ if true then return 0, 0, nil end
print(self.name, self)
--Quest:GetNumWatched()
self.numWatched = GetNumAutoQuestPopUps()
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/BonusObjectives.lua
--- a/ObjectiveTracker/BonusObjectives.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/BonusObjectives.lua Mon Apr 18 07:56:23 2016 -0400
@@ -86,6 +86,7 @@
Bonus.QuestBlock = {}
Bonus.WatchInfo = {}
function Bonus:GetNumWatched ()
+ if true then return 0, 0, nil end
local print = iprint
print(self.name, self)
@@ -257,6 +258,7 @@
attachment.maxValue = 100
attachment:SetPoint('TOP', line, 'TOP', 0, 0)
attachment.status:SetFormattedText(PERCENTAGE_STRING, percent)
+ attachment:SetParent(handler.frame)
print(attachment.status:GetText())
print(' |cFFFF0022** text:|r', data.text, '|cFFFF0022value:|r', data.value, '|cFFFF0022max:|r', data.maxValue)
end
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/DefaultTracker.lua
--- a/ObjectiveTracker/DefaultTracker.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/DefaultTracker.lua Mon Apr 18 07:56:23 2016 -0400
@@ -89,20 +89,28 @@
Default.UpdateTracker = function (handler, reason, id, isNew)
local print = tprint
- local tracker = handler.frame
+ local frame = handler.frame
local blockIndex = 0
+ print(format(' |cFFFF8800UpdateTracker|r(%s): %s', handler.name, reason))
handler.updateReason = reason
- handler.numWatched = handler:GetNumWatched()
- if handler.numWatched >= 1 then
+ local numWatched, numAll, watchTable = handler:GetNumWatched(id, isNew)
- print(' |cFF00FF88GetNumWatched:|r',handler.name, handler.numWatched, 'of', handler.numAll)
+ if numWatched >= 1 then
+ if watchTable then
+ print('|cFF00FF00 n ID Obj wID Log Blk')
+ for i, w in ipairs(watchTable) do
+ print(format(' %2d => %6d %3d %3d %3s %s', i, w.id, w.numObjectives, w.watchIndex, (w.logIndex or ''), (handler.InfoBlock[w.id] and handler.InfoBlock[w.id]:GetName() or '')))
+ end
+ end
end
+ handler.numWatched = numWatched
+ handler.numAll = numAll
handler.numBlocks = 0
handler.currentBlock = 0
- handler.currentAnchor = tracker.titlebg
- for blockIndex = 1, handler.numWatched do
+ handler.currentAnchor = frame.titlebg
+ for blockIndex = 1, numWatched do
local currentBlock = handler:UpdateBlock(blockIndex, id, isNew)
if currentBlock then
handler:AddBlock(currentBlock)
@@ -116,39 +124,41 @@
local numBlocks = handler.numBlocks
local used = handler.usedBlocks
local free = handler.freeBlocks
- print(format(' |cFFFF8800UpdateTracker|r(%s): |cFFFF8800%04X|r --- blocks |cFFFF8800%d|r, (used/free: |cFFFF8800%d|r/|cFFFF8800%d|r)', handler.name, band(reason, handler.updateReasonModule + handler.updateReasonEvents, reason), numBlocks, #used, #free))
- return tracker.numWatched, tracker.numAll
+ print(format(' (%s): |cFFFF8800%04X|r --- blocks |cFFFF8800%d|r, (used/free: |cFFFF8800%d|r/|cFFFF8800%d|r)', handler.name, band(reason, handler.updateReasonModule + handler.updateReasonEvents, reason), numBlocks, #used, #free))
+ return numWatched, numAll
end
-Default.UpdateBlock = function (handler, blockIndex, id, added)
+Default.UpdateBlock = function (handler, index)
local print = bprint
- if not blockIndex then
+ if not index then
return
end
- local info = handler:GetInfo(blockIndex) -- should match up with whatever the internal watch list has
+ local info = handler.WatchList[index] -- should match up with whatever the internal watch list has
if not info then
return
end
- print(' Updating |cFF00FF00'..handler.displayName..'|r|cFF00FFFF'..blockIndex..'|r|cFF0099FF', info.id ,'|r')
+ print(' Updating |cFF00FF00'..handler.displayName..'|r|cFF00FFFF'..index..'|r|cFF0099FF', info.id ,'|r')
local frame = handler.frame
local block = handler:GetBlock(info.id)
- if added then
- -- do something if the block is being assigned a new thing
- end
-
block.handler = handler
block.info = info
- info.blockIndex = blockIndex
- if info.questID then handler.QuestBlock[info.questID] = block end
- if info.logIndex then handler.LogBlock[info.logIndex] = block end
- if info.watchIndex then handler.WatchBlock[info.watchIndex] = block end
- handler.BlockInfo[blockIndex] = info
- local newSchema = handler:UpdateObjectives(block)
- if newSchema and newSchema ~= blockSchema then
- T.UpdateSchema('block', newSchema)
+ info.blockIndex = index
+ if info.id then
+ print(' storing id', info.id, 'for', block:GetName())
+ handler.InfoBlock[info.id] = block
end
+ if info.logIndex then
+ print(' storing logIndex', info.logIndex, 'for', block:GetName())
+ handler.LogBlock[info.logIndex] = block
+ end
+ if info.watchIndex then
+ print(' storing watchIndex', info.watchIndex, 'for', block:GetName())
+ handler.WatchBlock[info.watchIndex] = block
+ end
+ handler.BlockInfo[index] = info
+ handler:UpdateObjectives(block)
block.title:SetText(info.title)
@@ -201,15 +211,20 @@
tagPoint, tagAnchor, tagRelative = handler:AddTag(block, 'completionTag', tagPoint, tagAnchor, tagRelative)
end
+ if info.schema then
+ block.schema = info.schema
+ end
+
if info.statusKey and (Devian and Devian.InWorkspace()) then
- block.debugText:SetText(info.statusKey)
+ block.debugText:SetText(tostring(info.statusKey) .. ' ' .. tostring(block.posIndex) .. ' '.. tostring(info.logIndex))
block.debugText:Show()
end
return block
end
-Default.UpdateObjectives = function(handler, block, block_schema)
+Default.UpdateObjectives = function(handler, block)
local print = lprint
+ local block_schema = block.schema
local info = block.info
print(' |cFF00FF00default.objectives', block:GetName())
-- reset the starting positions
@@ -271,10 +286,10 @@
T:Update()
end
Default.Open = function(handler, block)
- T:Update(handler.watchReasonModule)
+ T:Update(handler.updateReasonModule)
end
Default.Remove = function(handler, block)
- T:Update(handler.watchReasonModule)
+ T:Update(handler.updateReasonModule)
end
Default.Report = function(handler, block)
print('Stats:', handler.numWatched,'items tracked,', handler.numBlocks,'blocks assigned.')
@@ -296,7 +311,7 @@
self.initialButton = nil
self.modChatLink = nil
self.modQuestWatch = nil
- T:Update(self.handler.updateReasonModule)
+ --T:Update(self.handler.updateReasonModule)
print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r')
end
Default.OnMouseDown = function(self, button)
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/Events.lua
--- a/ObjectiveTracker/Events.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/Events.lua Mon Apr 18 07:56:23 2016 -0400
@@ -26,22 +26,19 @@
local Quest = T.Quest
T.RemoveQuestWatch = function(questIndex, ...)
print('|cFFFF8800RemoveQuestWatch', questIndex, ...)
- local block = T.Quest.LogBlock[questIndex]
- if block then
- block:Hide()
- end
- return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST
+
+ --return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST
end
T.AddTrackedAchievement = function(cheevID)
T.CleanWidgets()
- return OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT
+ --return OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT
end
T.RemoveTrackedAchievement = function(cheevID)
T.CleanWidgets()
- return OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT
+ --return OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT
end
T.AcceptQuest = function()
@@ -57,7 +54,7 @@
local q = T.Quest.Info[questID]
if q.logIndex then
local block = T.Quest.LogBlock[q.logIndex]
- if block and block.id == questID then
+ if block then
block:Hide()
end
end
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/Frame.lua
--- a/ObjectiveTracker/Frame.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/Frame.lua Mon Apr 18 07:56:23 2016 -0400
@@ -30,7 +30,7 @@
local orderedNames = T.orderedNames
--- FRAME TEMP VARIABLES
-local wrapperWidth, wrapperHeight
+local wrapperWidth, wrapperHeight = 0, 0
local scrollWidth, scrollHeight
--- SCHEMA VARIABLES
@@ -80,26 +80,27 @@
headerHeight, headerSpacing = c.headerHeight, c.headerSpacing
headerColor = c.headerColor
headerbg = c.headerbg
- headerFont, headerSize, headerOutline = c.headerFont, c.headerSize, c.headerOutline
+ headerFont, headerSize, headerOutline = unpack(c.headerFont)
trackerSchema = newSchema
elseif layer == 'block' then
titlebg = c.titlebg
- titleFont, titleSize, titleOutline = c.titleFont, c.titleSize, c.titleOutline
+ titleFont, titleSize, titleOutline = unpack(c.titleFont)
selectionbg = c.selectionbg
titleSpacing, textSpacing, blockSpacing = c.titleSpacing, c.textSpacing, c.blockSpacing
- titleIndent, textIndent,selectionIndent = 2, 5, 50
+ titleIndent, textIndent,selectionIndent = c.titleIndex, c.textIndex, c.selectionIndent
titleColor = c.titleColor
+ print(unpack(c.titleColor))
rewardSize = 24
- blockSchema = newSchema
- textFont, textSize, textOutline = c.textFont, c.textSize, c.textOutline
+ textFont, textSize, textOutline = unpack(c.textFont)
textbg = c.textbg
textIndent = c.textIndent
rewardSize = c.rewardSize
+ blockSchema = newSchema
elseif layer == 'line' then
textColor = c.textColor
lineSchema = newSchema
end
- print('|cFFFF0088UpdateSchema:|r', layer, lastSchema[layer], '->', newSchema)
+ tprint('|cFFFF0088UpdateSchema:|r', layer, lastSchema[layer], '->', newSchema)
end
-- todo: figure out why objectives go invisible
local anchorPoint, anchorFrame
@@ -146,7 +147,7 @@
end)
else
- print(' |cFF00BBFFpinning to', anchorFrame:GetName(), anchorPoint, '|rcurrent frame height:', frame.height)
+ print(' |cFF00BBFFpinning '..handler.name..' to', anchorFrame:GetName(), anchorPoint, '|rcurrent frame height:', frame.height)
print(' |cFFFF0088total height:', wrapperHeight)
frame:ClearAllPoints()
frame:SetParent(Scroll)
@@ -183,37 +184,40 @@
block.index = blockIndex
+ print('blockschema', blockSchema, block.schema)
if blockSchema ~= block.schema then
+ T.UpdateSchema('block', block.schema)
print('new schema detected, applicating...')
- block.schema = blockSchema
- block:SetWidth(T.Conf.Wrapper.Width)
- block.title:SetSpacing(titleSpacing)
- block.title:SetPoint('TOP', block, 'TOP', 0, -titleSpacing)
- block.title:SetPoint('LEFT', block, 'LEFT', titleIndent, 0)
- block.titlebg:SetTexture(1,1,1,1)
- block.titlebg:SetGradientAlpha(unpack(titlebg))
- block.titlebg:SetPoint('TOP', block, 'TOP', 0, 0)
- block.titlebg:SetPoint('BOTTOM', block.title, 'BOTTOM', 0, -titleSpacing)
- block.status:SetSpacing(textSpacing)
- block.status:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, -textSpacing)
- block.status:SetPoint('LEFT', block.titlebg, 'LEFT', textIndent, 0)
- block.statusbg:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, 0)
- block.statusbg:SetPoint('BOTTOM', block, 'BOTTOM', 0, 0)
- block.statusbg:SetTexture(1,1,1,1)
- block.statusbg:SetGradientAlpha(unpack(textbg))
- block.SelectionOverlay:SetGradientAlpha(unpack(selectionbg))
- block.SelectionOverlay:SetPoint('TOPLEFT', selectionIndent, 0)
- block.SelectionOverlay:SetPoint('BOTTOMRIGHT')
+ end
- local anchor, target, point, x, y = 'TOPRIGHT', block, 'TOPRIGHT', -2, -2
- for i, tile in ipairs(block.rewardTile) do
- print(rewardSize)
- tile:SetSize(rewardSize, rewardSize)
- tile:ClearAllPoints()
- tile:SetPoint(anchor, target, point, x, y)
- block.rewardLabel[i]:SetPoint('TOP', tile, 'TOP', 0, 0)
- anchor, target, point, x, y = 'TOPRIGHT', tile, 'TOPLEFT', -2, 0
- end
+ block:SetWidth(T.Conf.Wrapper.Width)
+ block.title:SetSpacing(titleSpacing)
+ block.title:SetPoint('TOP', block, 'TOP', 0, -titleSpacing)
+ block.title:SetPoint('LEFT', block, 'LEFT', titleIndent, 0)
+ block.title:SetTextColor(unpack(titleColor))
+ block.titlebg:SetTexture(1,1,1,1)
+ block.titlebg:SetGradientAlpha(unpack(titlebg))
+ block.titlebg:SetPoint('TOP', block, 'TOP', 0, 0)
+ block.titlebg:SetPoint('BOTTOM', block.title, 'BOTTOM', 0, -titleSpacing)
+ block.status:SetSpacing(textSpacing)
+ block.status:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, -textSpacing)
+ block.status:SetPoint('LEFT', block.titlebg, 'LEFT', textIndent, 0)
+ block.statusbg:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, 0)
+ block.statusbg:SetPoint('BOTTOM', block, 'BOTTOM', 0, 0)
+ block.statusbg:SetTexture(1,1,1,1)
+ block.statusbg:SetGradientAlpha(unpack(textbg))
+ block.SelectionOverlay:SetGradientAlpha(unpack(selectionbg))
+ block.SelectionOverlay:SetPoint('TOPLEFT', selectionIndent, 0)
+ block.SelectionOverlay:SetPoint('BOTTOMRIGHT')
+
+ local anchor, target, point, x, y = 'TOPRIGHT', block, 'TOPRIGHT', -2, -2
+ for i, tile in ipairs(block.rewardTile) do
+ --print(rewardSize)
+ tile:SetSize(rewardSize, rewardSize)
+ tile:ClearAllPoints()
+ tile:SetPoint(anchor, target, point, x, y)
+ block.rewardLabel[i]:SetPoint('TOP', tile, 'TOP', 0, 0)
+ anchor, target, point, x, y = 'TOPRIGHT', tile, 'TOPLEFT', -2, 0
end
@@ -302,6 +306,9 @@
end
end
line:SetPoint('TOP', block.endPoint, 'BOTTOM', 0, -textSpacing)
+ line.status:SetPoint('LEFT', line, 'LEFT', textIndent, 0)
+ line:SetPoint('LEFT', block, 'LEFT')
+ line:SetPoint('RIGHT', block, 'RIGHT')
line:Show()
@@ -360,7 +367,7 @@
local line = lines[lineIndex]
line.index = lineIndex
line.height = 0
- line.schema = 'default'
+ line.schema = ''
B.SetConfigLayers(line)
if debug then
@@ -377,10 +384,10 @@
--- Creates or retrieves a complete block frame object
--- todo: make it use data index to avoid re-coloring every block
-Default.GetBlock = function(handler, logIndex)
+Default.GetBlock = function(handler, index)
local print = bprint
- print('|cFF0088FFgetting a block for logID', logIndex ..',', #handler.usedBlocks,'used', #handler.freeBlocks, 'free')
- local block = handler.LogBlock[logIndex]
+ print('|cFF0088FFgetting a block for index', index ..',', #handler.usedBlocks,'used', #handler.freeBlocks, 'free')
+ local block = handler.InfoBlock[index]
local used = handler.usedBlocks
if not block then
@@ -394,6 +401,7 @@
local blockIndex = (#handler.usedBlocks + #handler.freeBlocks) + 1
block = CreateFrame('Frame', 'Veneer'..tostring(handler)..'Block'..blockIndex, handler.frame, 'VeneerTrackerBlock')
--block:SetParent()
+ block.schema = ''
block.lines = {}
block.numLines = 0
block.currentLine = 0
@@ -412,7 +420,7 @@
block.index = blockIndex
print(' |cFF00FFBBcreating new|r', block:GetName())
end
- handler.LogBlock[logIndex] = block
+ handler.InfoBlock[index] = block
tinsert(handler.usedBlocks, block)
block.posIndex = #handler.usedBlocks
else
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/ObjectiveTracker.lua
--- a/ObjectiveTracker/ObjectiveTracker.lua Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/ObjectiveTracker.lua Mon Apr 18 07:56:23 2016 -0400
@@ -126,8 +126,10 @@
freeBlocks = {}, --- blocks hidden due to list shrinkage
usedBlocks = {}, --- block in use
BlockInfo = {}, --- by block creation offset, used by framescript
+ WatchList = {}, --- ordered manifest of watched items
--- Indexes
+ InfoBlock = {}, --- by unique ID
LogBlock = {}, --- by API log offset, used by GetBlock if possible
WatchBlock = {}, --- block by internal offset, used in GetBlock scope
WatchInfo = {}, --- info by internal offset, used in Update scope
@@ -154,6 +156,7 @@
T.Cheevs = {
name = "Cheevs",
displayName = "Achievements",
+ schema = 'achievement',
updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT,
updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT +
OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED,
@@ -258,12 +261,12 @@
end
Event.QUEST_WATCH_LIST_CHANGED = function(questID, added)
- if ( added ) then
+ if ( added == true ) then
if ( not IsQuestTask(questID) ) then
return OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, questID, added
end
- else
- return OBJECTIVE_TRACKER_UPDATE_QUEST, questID, added
+ elseif questID then
+ return OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, questID, added
end
end
@@ -274,8 +277,8 @@
end
return OBJECTIVE_TRACKER_UPDATE_ALL
end
-Event.SUPER_TRACKED_QUEST_CHANGED = function()
- return OBJECTIVE_TRACKER_UPDATE_QUEST
+Event.SUPER_TRACKED_QUEST_CHANGED = function(questID)
+ return OBJECTIVE_TRACKER_UPDATE_QUEST, questID
end
Event.ZONE_CHANGED = function()
local inMicroDungeon = IsPlayerInMicroDungeon();
@@ -306,11 +309,7 @@
return OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT
end
Event.TRACKED_ACHIEVEMENT_LIST_CHANGED = function(achievementID, added)
- if ( added ) then
- return OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED, achievementID
- else
- return OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT
- end
+ return OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED, achievementID, added
end
Event.ZONE_CHANGED_NEW_AREA = function ()
if ( not WorldMapFrame:IsShown() and GetCVarBool("questPOI") ) then
@@ -452,38 +451,26 @@
local Play = function(file) if Devian and Devian.InWorkspace() then PlaySoundFile(file) end end
+local tprint = B.print('Tracker')
T.OnHookedFunc = function(name, ...)
- print('|cFFFF8800securehook:|r', name, '|cFF00FFFFargs:|r', ...)
- local updateReason = T[name](...)
+ tprint('|cFFFF8800securehook:|r', name, '|cFF00FFFFargs:|r', ...)
+ local updateReason, arg1, arg2, arg3 = T[name](...)
if updateReason then
- print('|cFF00FFFFupdate reason:|r', updateReason)
- T:Update(updateReason)
+ print('|cFF00FFFFupdate reason:|r', updateReason, arg1, arg2, arg3)
+ T:Update(updateReason, arg1, arg2, arg3)
end
end
function T:OnEvent (event, ...)
local isHandled
- print('OnEvent(|cFF00FF00'.. event ..'|r):', ...)
+ tprint('OnEvent(|cFF00FF00'.. event ..'|r):', ...)
local reason, arg1, arg2, arg3
if Event[event] then
if type(Event[event]) == 'function' then
Play([[Interface\Addons\SharedMedia_MyMedia\sound\Info.ogg]])
reason, arg1, arg2, arg3 = Event[event](...)
- elseif type(Event[event]) == 'table' then
- Play([[Interface\Addons\SharedMedia_MyMedia\sound\Link.ogg]])
- for i, action in ipairs(Event[event]) do
- if type(action) == 'function' then
- reason, arg1, arg2, arg3 = action(event, ...)
- else
- reason = action
- end
-
- if reason then
- T:Update(reason, arg1, arg2, arg3)
- end
- end
else
- --Play([[Interface\Addons\SharedMedia_MyMedia\sound\Heart.ogg]])
+ Play([[Interface\Addons\SharedMedia_MyMedia\sound\Heart.ogg]])
reason = Event[event]
end
else
diff -r a487841050be -r e84d645c8ab8 ObjectiveTracker/ObjectiveTracker.xml
--- a/ObjectiveTracker/ObjectiveTracker.xml Sun Apr 17 13:00:31 2016 -0400
+++ b/ObjectiveTracker/ObjectiveTracker.xml Mon Apr 18 07:56:23 2016 -0400
@@ -103,6 +103,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ local hour, min = GetGameTime()
+ self.time:SetFormattedText("%d:%d", hour, min)
+
+
+
+