annotate ObjectiveTracker/ObjectiveFrame.lua @ 24:66b927b46776

Refine the XML data logic, and sort out some EnableMouse inconsistencies.
author Nenue
date Mon, 11 Apr 2016 09:07:40 -0400
parents e837384ac363
children 4b3da1b221de
rev   line source
Nenue@1 1 --- ${PACKAGE_NAME}
Nenue@1 2 -- @file-author@
Nenue@1 3 -- @project-revision@ @project-hash@
Nenue@1 4 -- @file-revision@ @file-hash@
Nenue@1 5 -- Created: 3/30/2016 12:49 AM
Nenue@1 6 local B = select(2,...).frame
Nenue@23 7 local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
Nenue@23 8 local _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band
Nenue@2 9 local IsResting, UnitXP, UnitXPMax, GetXPExhaustion = IsResting, UnitXP, UnitXPMax, GetXPExhaustion
Nenue@2 10 local UnitLevel, IsQuestWatched, UIParent = UnitLevel, IsQuestWatched, UIParent
Nenue@23 11 local GetAutoQuestPopUp, GetQuestLogCompletionText = GetAutoQuestPopUp, GetQuestLogCompletionText
Nenue@23 12 local PERCENTAGE_STRING, GetQuestProgressBarPercent = PERCENTAGE_STRING, GetQuestProgressBarPercent
Nenue@23 13 local Default, AutoQuest, Quest, Bonus, Cheevs = T.DefaultHandler, T.AutoQuest, T.Quest, T.Bonus, T.Cheevs
Nenue@23 14 local InCombatLockdown, format, lshift, CreateFrame = InCombatLockdown, format, bit.lshift, CreateFrame
Nenue@21 15 local print = B.print('Tracker')
Nenue@13 16 local unitLevel = 1
Nenue@19 17 local OBJECTIVE_TRACKER_UPDATE_REASON = OBJECTIVE_TRACKER_UPDATE_REASON
Nenue@21 18 local debug = false
Nenue@1 19 --------------------------------------------------------------------
Nenue@1 20 --- Global frame layout
Nenue@1 21 --------------------------------------------------------------------
Nenue@1 22
Nenue@1 23 --- Upvalues
Nenue@23 24 local Wrapper = _G.VeneerObjectiveWrapper
Nenue@1 25 local Scroller = Wrapper.scrollArea
Nenue@23 26 local Scroll = _G.VeneerObjectiveScroll
Nenue@23 27 local orderedHandlers = T.orderedHandlers
Nenue@23 28 local orderedNames = T.orderedNames
Nenue@1 29
Nenue@1 30 --- Temp values set during updates
Nenue@1 31 local wrapperWidth, wrapperHeight
Nenue@1 32 local scrollWidth, scrollHeight
Nenue@1 33 local previousBlock
Nenue@1 34 local currentBlock
Nenue@10 35 --- todo: source these from config
Nenue@6 36 local itemButtonSize, itemButtonSpacing = 36, 1
Nenue@1 37 local titleFont, textFont = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]]
Nenue@21 38 local titleSize, textSize = 16, 16
Nenue@23 39 local titlebg, textbg = {'HORIZONTAL', 1, 0, .7, .25, 1, 0, .7, .125}, {'HORIZONTAL', 0, 0, 0, 0.4, 0, 0, 0, 0 }
Nenue@23 40 local titlebg_daily, textbg_daily = {'HORIZONTAL', 0, .7, 1, .25, 0, 1, .7, .125}, {'HORIZONTAL', 0, .7, 1, .1, 0, 1, .7, .075 }
Nenue@23 41 local textbg_account,titlebg_account = {'HORIZONTAL', 0, .45, 1, .25, 0, .45, 1, .125}, {'HORIZONTAL', 0, .45, 1, 0.4, 0, .41, 1, .085 }
Nenue@23 42 local selectionbg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 0.225}
Nenue@1 43 local titleOutline, textOutline = "OUTLINE", "OUTLINE"
Nenue@23 44 local titleSpacing, textSpacing, blockSpacing = 3, 3, 1
Nenue@23 45 local titleIndent, textIndent,selectionIndent = 2, 5, 50
Nenue@12 46 local wrapperMaxWidth, wrapperMaxHeight = 270, 490 -- these are the hard bounds, actual *Height variables are changed
Nenue@2 47 local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE'
Nenue@1 48 local headerFont, headerSize, headerHeight = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 18, 24
Nenue@2 49 local headerOutline, headerColor, headerSpacing = 'OUTLINE', {1,1,1,1}, 2
Nenue@22 50 local wrapperPosition = {'RIGHT', UIParent, 'RIGHT', -84, 0 }
Nenue@22 51 local rewardSize = 32
Nenue@21 52 local oprint = B.print('Objectives')
Nenue@21 53 local bprint = B.print('Block')
Nenue@21 54 local tprint = B.print('Tracker')
Nenue@21 55 local lprint = B.print('Line')
Nenue@1 56
Nenue@19 57 local currentPosition, anchorFrame, anchorPoint
Nenue@3 58
Nenue@24 59
Nenue@23 60
Nenue@23 61 T.AddBlock = function(handler, block)
Nenue@23 62 local print = bprint
Nenue@23 63 end
Nenue@23 64
Nenue@23 65 --- Used as an iterator of sorts for cascaded tag icon placements (the daily/faction/account icons)
Nenue@23 66 T.AddTag = function (block, tagName, tagPoint, tagAnchor, tagRelative)
Nenue@23 67 local print = bprint
Nenue@23 68 local tag = block[tagName]
Nenue@23 69 if block.info[tagName] and tag then
Nenue@23 70 tag:SetTexCoord(unpack(block.info[tagName]))
Nenue@23 71 tag:Show()
Nenue@23 72 tag:SetPoint(tagPoint, tagAnchor, tagRelative, 0, 0)
Nenue@23 73 tagPoint, tagAnchor, tagRelative = 'TOPRIGHT', tag, 'TOPLEFT'
Nenue@23 74 else
Nenue@23 75 block[tagName]:Hide()
Nenue@23 76 end
Nenue@23 77 return tagPoint, tagAnchor, tagRelative
Nenue@23 78 end
Nenue@23 79
Nenue@23 80 --- Adds the given line to the current content and advances the anchor pointer to that new line for the following call.
Nenue@23 81 T.AddLine = function(block, line)
Nenue@21 82 local print = lprint
Nenue@23 83 line:ClearAllPoints()
Nenue@23 84 line:SetPoint('LEFT', block, 'LEFT', 0, 0)
Nenue@23 85 line:SetPoint('TOP', block.endPoint, 'BOTTOM', 0, -textSpacing)
Nenue@23 86 line:SetPoint('RIGHT', block, 'RIGHT', 0, 0)
Nenue@23 87 line:SetHeight(line.height)
Nenue@23 88 line:Show()
Nenue@23 89
Nenue@23 90 block.endIndex = line.index
Nenue@23 91 block.numLines = block.numLines + 1
Nenue@23 92 block.attachmentHeight = block.attachmentHeight + (line.height + textSpacing)
Nenue@23 93 print(' |cFF0088FFsetting line #'..block.numLines..' for|r', block.info.title, "\n |cFF0088FFsize:|r", line.height,
Nenue@23 94 "|cFF0088FFpoint:|r", line:GetPoint(1), "|cFF0088FFwidget:|r", (line.widget and 'Y' or 'N'))
Nenue@23 95 block.endPoint = line
Nenue@23 96 end
Nenue@23 97
Nenue@23 98 --- Creates or retrieves a complete line data object
Nenue@23 99 T.GetLine = function(handler, block, lineIndex)
Nenue@23 100 local print = lprint
Nenue@23 101 local blockIndex = block.index
Nenue@23 102 if not block.lines then
Nenue@23 103 block.lines = {}
Nenue@21 104 end
Nenue@23 105 local lines = block.lines
Nenue@21 106 if not lines[lineIndex] then
Nenue@23 107 print(' |cFF00FF88created line #'..lineIndex..' from for '..handler.name..' block #'..blockIndex)
Nenue@23 108 lines[lineIndex] = CreateFrame('Frame', 'Vn'..handler.name .. blockIndex..'ObjectiveLine'..lineIndex, block, 'VeneerTrackerObjective')
Nenue@21 109 local line = lines[lineIndex]
Nenue@21 110 line.index = lineIndex
Nenue@21 111 line.height = 0
Nenue@21 112 line.status:SetSpacing(textSpacing)
Nenue@21 113 line.status:SetPoint('LEFT', line, 'LEFT', textIndent, 0)
Nenue@21 114 B.SetConfigLayers(line)
Nenue@2 115
Nenue@21 116 if lines[lineIndex+1] then
Nenue@21 117 lines[lineIndex+1]:ClearAllPoints()
Nenue@19 118 end
Nenue@19 119
Nenue@21 120 if debug then
Nenue@21 121 for _, region in ipairs(lines[lineIndex].debug) do
Nenue@21 122 region:Show()
Nenue@21 123 end
Nenue@19 124 end
Nenue@19 125
Nenue@13 126 end
Nenue@21 127 return lines[lineIndex]
Nenue@2 128 end
Nenue@2 129
Nenue@23 130 --- Creates or retrieves a complete block frame object
Nenue@23 131 T.GetBlock = function(handler, blockIndex)
Nenue@21 132 local print = bprint
Nenue@19 133 local block = handler.usedBlocks[blockIndex]
Nenue@21 134
Nenue@19 135 if not handler.usedBlocks[blockIndex] then
Nenue@19 136 if #handler.freeBlocks >= 1 then
Nenue@19 137 block = handler.freeBlocks[#handler.freeBlocks]
Nenue@19 138 handler.freeBlocks[#handler.freeBlocks] = nil
Nenue@19 139 else
Nenue@19 140 block = CreateFrame('Frame', 'Veneer'..tostring(handler)..'Block'..blockIndex, Scroll, 'VeneerTrackerBlock')
Nenue@21 141
Nenue@23 142
Nenue@23 143
Nenue@23 144 local c = T.Conf.Wrapper
Nenue@23 145 block.index = blockIndex
Nenue@23 146 block.SetStyle = T.SetBlockStyle
Nenue@21 147 block:SetWidth(c.Width)
Nenue@21 148
Nenue@21 149 block.title:SetSpacing(c.TitleSpacing)
Nenue@21 150 block.title:SetPoint('TOP', block, 'TOP', 0, -titleSpacing)
Nenue@21 151
Nenue@21 152 block.titlebg:SetTexture(1,1,1,1)
Nenue@24 153 block.titlebg:SetGradientAlpha(unpack(T.colors.default.titlebg))
Nenue@21 154 block.titlebg:SetPoint('TOP', block, 'TOP', 0, 0)
Nenue@21 155 block.titlebg:SetPoint('BOTTOM', block.title, 'BOTTOM', 0, -titleSpacing)
Nenue@21 156
Nenue@21 157 block.status:SetSpacing(c.TextSpacing)
Nenue@21 158 block.status:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, -textSpacing)
Nenue@21 159 block.status:SetPoint('LEFT', block.titlebg, 'LEFT', textIndent, 0)
Nenue@21 160
Nenue@21 161 block.statusbg:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, 0)
Nenue@21 162 block.statusbg:SetPoint('BOTTOM', block, 'BOTTOM', 0, 0)
Nenue@21 163 block.statusbg:SetTexture(1,1,1,1)
Nenue@24 164 block.statusbg:SetGradientAlpha(unpack(T.colors.default.textbg))
Nenue@21 165
Nenue@24 166 block.SelectionOverlay:SetGradientAlpha(unpack(T.colors.default.selectionbg))
Nenue@23 167 block.SelectionOverlay:SetPoint('TOPLEFT', selectionIndent, 0)
Nenue@21 168 block.SelectionOverlay:SetPoint('BOTTOMRIGHT')
Nenue@21 169
Nenue@22 170 block.icon:SetSize(rewardSize, rewardSize)
Nenue@22 171 block.icon:SetPoint('TOPRIGHT', block, 'TOPRIGHT', -2, -2)
Nenue@21 172
Nenue@21 173
Nenue@21 174 --- methods for event handlers
Nenue@21 175
Nenue@19 176 block.Select = handler.Select
Nenue@19 177 block.Open = handler.Open
Nenue@19 178 block.Remove = handler.Remove
Nenue@19 179 block.Link = handler.Link
Nenue@19 180 block:SetScript('OnMouseUp', handler.OnMouseUp)
Nenue@19 181 block:SetScript('OnMouseDown', handler.OnMouseDown)
Nenue@19 182 block.attachmentHeight = 0
Nenue@19 183 block:ClearAllPoints()
Nenue@21 184
Nenue@21 185 B.SetConfigLayers(block)
Nenue@21 186
Nenue@21 187 if debug then
Nenue@21 188 for _, region in ipairs(block.debug) do
Nenue@21 189 region:Show()
Nenue@21 190 end
Nenue@21 191 end
Nenue@19 192 end
Nenue@19 193 handler.usedBlocks[blockIndex] = block
Nenue@2 194 end
Nenue@19 195 return handler.usedBlocks[blockIndex]
Nenue@2 196 end
Nenue@2 197
Nenue@23 198 --- Module-specific data wrangling that has to happen during UpdateBlock()
Nenue@23 199 -- Most of this is sculpting objectives data into a parsible list.
Nenue@23 200 -- Some of it is additional block manipulation that doesn't quite fit with the other modules..
Nenue@23 201 Bonus.UpdateObjectives = function(handler, block)
Nenue@23 202 Default.UpdateObjectives(handler, block)
Nenue@21 203 end
Nenue@14 204
Nenue@23 205
Nenue@23 206 --- They are not exactly quests, but the aliases used to signal that a quest was pushed into your log by the environment.
Nenue@23 207 -- Once accepted they never appear again unless the quest is dropped (daily reset/abandon quest)
Nenue@23 208 local CLICK_TO_COMPLETE = 'Click to Complete'
Nenue@23 209 local CLICK_TO_ACCEPT = 'Click to Accept'
Nenue@23 210 AutoQuest.UpdateObjectives = function(handler, block)
Nenue@23 211 local print = lprint
Nenue@23 212 if block.info.type == 'OFFER' then
Nenue@23 213 block.status:SetText(CLICK_TO_ACCEPT)
Nenue@23 214 end
Nenue@23 215 end
Nenue@23 216
Nenue@23 217
Nenue@23 218
Nenue@23 219
Nenue@23 220 --- Does the main iterations for populating block content.
Nenue@23 221 -- Hooked by corresponding handler functions where additional details need to be sorted.
Nenue@21 222 Default.UpdateObjectives = function(handler, block)
Nenue@21 223 local print = lprint
Nenue@21 224 local info = block.info
Nenue@23 225 print(' |cFF00FF00default objectives routine', block:GetName())
Nenue@1 226
Nenue@23 227 -- reset the starting positions
Nenue@23 228 block.attachmentHeight = 0
Nenue@23 229 block.endPoint = block.titlebg
Nenue@21 230 local completionScore, completionMax = 0, 0
Nenue@21 231 local displayObjectiveHeader = false
Nenue@21 232
Nenue@21 233 if info.description and #info.description >= 1 then
Nenue@21 234 print(' |cFF00FFFF header line:|r', info.description)
Nenue@21 235 block.status:SetText(info.description)
Nenue@21 236 displayObjectiveHeader = true
Nenue@21 237 end
Nenue@21 238
Nenue@23 239 --- The first line is going to be used no matter what, so it is hard-pulled.
Nenue@23 240 -- It also ensures that we're in the right position for cleaning up the leftover lines.
Nenue@23 241 local lineIndex = 1
Nenue@23 242 local line = T.GetLine(handler, block, lineIndex)
Nenue@21 243
Nenue@23 244 block.numLines = 0
Nenue@23 245 block.attachmentHeight = 0
Nenue@23 246 if info.isComplete then
Nenue@23 247 print(' overriding line #1 for a completed block')
Nenue@23 248 if line.widget then
Nenue@23 249 line.widget:Hide()
Nenue@23 250 end
Nenue@23 251 line.status:SetText(info.completionText)
Nenue@23 252 line.height = floor(line.status:GetHeight()+.5) + textSpacing
Nenue@23 253 T.AddLine(block, line)
Nenue@23 254 else
Nenue@23 255 if info.objectives then
Nenue@23 256 for i, data in ipairs(info.objectives) do
Nenue@23 257 print(' |cFF88FF00#', i, data.type, data.text)
Nenue@23 258 displayObjectiveHeader = true
Nenue@23 259 line.height = 0
Nenue@23 260 handler:UpdateLine(block, line, data)
Nenue@22 261
Nenue@23 262 -- For progressbar and timer lines, status text may be used as the title heading
Nenue@23 263 if line.widget then
Nenue@23 264 local widgetPosition = 0
Nenue@23 265 --- WIDGET POSITION -------------------------------------------------
Nenue@23 266 line.widget:SetPoint('TOP', line, 'TOP', 0, -widgetPosition)
Nenue@23 267 line.widget:Show()
Nenue@23 268 line.height = line.widget:GetHeight() + textSpacing
Nenue@23 269 ---------------------------------------------------------------------
Nenue@23 270 if line.displayText and #line.displayText >= 1 then
Nenue@23 271 widgetPosition = line.status:GetHeight() + textSpacing
Nenue@23 272 line.status:SetText(line.displayText)
Nenue@23 273 line.height = floor(line.status:GetStringHeight()+.5) + textSpacing + line.widget.height
Nenue@23 274 print(' - progressbar has text, adjust')
Nenue@23 275 end
Nenue@23 276 elseif line.displayText then
Nenue@22 277 line.status:SetText(line.displayText)
Nenue@23 278 line.height = floor(line.status:GetStringHeight()+.5)
Nenue@22 279 end
Nenue@22 280
Nenue@23 281 T.AddLine(block, line)
Nenue@19 282
Nenue@23 283 --print(' sz', line:GetWidth(), line:GetHeight(), 'pt', line:GetPoint(1))
Nenue@23 284 --print(' |cFF44BBFF#', i, 'anchoring line, size:', line.height, 'current endpoint:', line.statusbg)
Nenue@19 285
Nenue@23 286 lineIndex = lineIndex + 1
Nenue@23 287 line = T.GetLine(handler, block, lineIndex)
Nenue@21 288 end
Nenue@14 289 end
Nenue@14 290 end
Nenue@14 291
Nenue@23 292 while (block.lines[lineIndex+1]) do
Nenue@23 293 print(' - hide |cFFFF0088'..lineIndex..'|r')
Nenue@23 294 block.lines[lineIndex]:Hide()
Nenue@23 295 lineIndex = lineIndex +1
Nenue@23 296 end
Nenue@19 297
Nenue@19 298
Nenue@23 299
Nenue@23 300 if lineIndex > 0 then
Nenue@23 301 block.attachmentHeight = block.attachmentHeight + textSpacing * 2
Nenue@23 302 print(' |cFF00FF00attachment:', block.attachmentHeight)
Nenue@23 303 end
Nenue@23 304
Nenue@23 305
Nenue@23 306 --[[
Nenue@23 307 local lines = handler.lines[block.index]
Nenue@23 308 if lines and #lines > block.numLines then
Nenue@23 309 print(' |cFFFF008' .. (#lines - block.numLines) .. ' extra lines to hide.')
Nenue@23 310 for i = block.numLines + 1, #lines do
Nenue@23 311 print(' hide', i, lines[i]:GetName())
Nenue@23 312 lines[i]:Hide()
Nenue@23 313 end
Nenue@23 314 end
Nenue@23 315 ]]
Nenue@23 316
Nenue@21 317
Nenue@21 318 if debug then
Nenue@21 319 for i, region in ipairs(block.debug) do
Nenue@21 320 for j = 1, region:GetNumPoints() do
Nenue@21 321 local _, target = region:GetPoint(j)
Nenue@21 322 if target:IsVisible() then
Nenue@21 323 region:Hide()
Nenue@21 324 else
Nenue@21 325 region:Show()
Nenue@21 326 end
Nenue@21 327 end
Nenue@21 328 end
Nenue@21 329 end
Nenue@21 330
Nenue@14 331 block.completionScore = completionScore / completionMax
Nenue@21 332 end
Nenue@14 333
Nenue@21 334
Nenue@21 335 --- Module-specific display variables
Nenue@14 336 -- * height - height of whatever display widget is involved in conveying the task
Nenue@14 337 -- * money - boolean that determines listening for money events or not
Nenue@14 338 -- * progress - number ranging 0 to 2 indicating none/partial/full completion respectively
Nenue@14 339
Nenue@21 340
Nenue@21 341
Nenue@21 342 Bonus.UpdateLine = function(handler, block, line, data)
Nenue@21 343 local info = block.info
Nenue@21 344 local print = lprint
Nenue@21 345
Nenue@21 346
Nenue@21 347 line.displayColor = 'FFFFFF'
Nenue@22 348 line.displayText = data.text
Nenue@21 349 line.progress = 0
Nenue@21 350 print(' ', data.objectiveIndex,'|cFFFF0088-|r', data.objectiveType, data.text)
Nenue@21 351 if data.objectiveType == 'progressbar' then
Nenue@21 352 line.widgetType = 'ProgressBar'
Nenue@21 353 print(' |cFFFF44DDpercent='..tostring(GetQuestProgressBarPercent(info.questID)))
Nenue@21 354 data.value = GetQuestProgressBarPercent(info.questID) or 0
Nenue@21 355 data.maxValue = 100
Nenue@21 356 if data.value >= data.maxValue then
Nenue@21 357 line.progress = 1
Nenue@21 358 elseif data.value > 0 then
Nenue@21 359 line.progress = 2
Nenue@21 360 end
Nenue@21 361 line.format = PERCENTAGE_STRING
Nenue@23 362 local widget = T.SetWidget(line, data, 'ProgressBar', info.questID..'-'..data.objectiveIndex)
Nenue@21 363 print(' |cFFFF0022** text:|r', data.text, '|cFFFF0022value:|r', data.value, '|cFFFF0022max:|r', data.maxValue)
Nenue@22 364 widget:SetPoint('TOP', line, 'TOP', 0, 0)
Nenue@21 365
Nenue@21 366 line.widget = widget
Nenue@21 367 line.height = widget.height
Nenue@21 368 else
Nenue@21 369 line.displayText = data.text
Nenue@21 370 line.widget = nil
Nenue@21 371 end
Nenue@21 372 return line
Nenue@21 373 end
Nenue@21 374
Nenue@21 375 Cheevs.UpdateLine = function(handler, block, line, data)
Nenue@21 376 local print = B.print('CheevsLine')
Nenue@21 377 line.progress = 0
Nenue@21 378 print(' ', data.objectiveIndex,'|cFF0088FF-|r', data.objectiveType, data.text)
Nenue@21 379 if data.flags then
Nenue@21 380 if band(data.flags, 0x00000001) > 0 then
Nenue@21 381 line.format = "%d/%d"
Nenue@23 382 line.widget = T.SetWidget(line, data, 'ProgressBar', data.criteriaID)
Nenue@21 383 line.height = line.widget.height
Nenue@21 384 elseif band(data.flags, 0x00000002) then
Nenue@21 385 line.widget = nil
Nenue@21 386 else
Nenue@21 387 line.widget = nil
Nenue@21 388 line.displayColor = 'FFFFFF'
Nenue@21 389 line.displayText = line.text
Nenue@21 390
Nenue@21 391 end
Nenue@21 392 else
Nenue@21 393
Nenue@21 394 line.displayText = data.text
Nenue@21 395 end
Nenue@21 396 print('line.type =', data.type)
Nenue@21 397 print(' ** qtyStr:', data.quantityString, 'qty:', data.quantity, 'assetID:', data.assetID)
Nenue@21 398 end
Nenue@21 399 Default.UpdateLine = function(block, line)
Nenue@14 400 if line.finished then
Nenue@14 401 line.progress = 2
Nenue@14 402 elseif line.quantity > 0 then
Nenue@14 403 line.progress = 1
Nenue@14 404 else
Nenue@14 405 line.progress = 0
Nenue@14 406 end
Nenue@21 407 return line
Nenue@14 408 end
Nenue@14 409
Nenue@14 410
Nenue@23 411 T.Quest.numButtons = 0
Nenue@23 412 local usedButtons = T.Quest.itemButtons
Nenue@23 413 local freeButtons = T.Quest.freeButtons
Nenue@19 414 --[=[
Nenue@23 415 T.UpdateWrapper = function(reason)
Nenue@16 416 print('|cFF00FFFFUpdateWrapper:|r', reason)
Nenue@13 417 unitLevel = UnitLevel('player')
Nenue@23 418 wrapperWidth = T.Conf.Wrapper.WrapperWidth
Nenue@23 419 scrollWidth = T.Conf.Wrapper.WrapperWidth
Nenue@1 420 local wrapperBlocks = 0
Nenue@1 421 -- Update scroll child vertical size
Nenue@1 422 scrollHeight = 0
Nenue@1 423 for i, handler in ipairs(orderedHandlers) do
Nenue@23 424 T.UpdateTracker(handler)
Nenue@19 425 local frame = handler.frame
Nenue@1 426 if handler.actualBlocks >= 1 then
Nenue@19 427 frame:SetParent(Scroll)
Nenue@19 428 frame:SetPoint('TOPLEFT', Scroll, 'TOPLEFT', 0, - scrollHeight)
Nenue@19 429 frame:SetSize(wrapperWidth, frame.height)
Nenue@19 430 print('|cFF00FFFF'..frame:GetName()..'|r h:|cFF00FF00', frame.height, '|r y:|cFF00FF00', -scrollHeight)
Nenue@19 431 scrollHeight = scrollHeight + frame.height
Nenue@19 432 frame:Show()
Nenue@14 433 else
Nenue@19 434 frame:Hide()
Nenue@1 435 end
Nenue@1 436 wrapperBlocks = wrapperBlocks + handler.actualBlocks
Nenue@1 437 end
Nenue@1 438 print('final scrollHeight:', scrollHeight)
Nenue@1 439
Nenue@1 440
Nenue@1 441
Nenue@1 442 -- Update frame dimensions
Nenue@1 443 if scrollHeight > wrapperMaxHeight then
Nenue@1 444 print(' is larger than', wrapperMaxHeight)
Nenue@1 445 wrapperHeight = wrapperMaxHeight
Nenue@1 446 else
Nenue@1 447 wrapperHeight = scrollHeight
Nenue@9 448 B.Conf.ObjectiveScroll = 0
Nenue@1 449 end
Nenue@1 450 scrollWidth = floor(scrollWidth+.5)
Nenue@1 451 scrollHeight = floor(scrollHeight+.5)
Nenue@1 452 wrapperWidth = floor(wrapperWidth+.5)
Nenue@1 453 wrapperHeight = floor(wrapperHeight+.5)
Nenue@1 454 headerHeight = floor(headerHeight+.5)
Nenue@1 455
Nenue@1 456 if wrapperBlocks >= 1 then
Nenue@10 457 for i, region in ipairs(Wrapper.headerComplex) do
Nenue@2 458 region:Show()
Nenue@2 459 end
Nenue@1 460 else
Nenue@10 461 for i, region in ipairs(Wrapper.headerComplex) do
Nenue@2 462 region:Hide()
Nenue@2 463 end
Nenue@1 464 return
Nenue@1 465 end
Nenue@14 466 --[[wrapperHeight = scrollHeight
Nenue@1 467
Nenue@14 468 print('|cFFFFFF00params:|r scroller:', scrollWidth .. ',' .. scrollHeight, 'scroll:', scrollWidth .. ',' .. scrollHeight,
Nenue@14 469 'wrapper:', wrapperWidth .. ',' .. wrapperHeight,
Nenue@14 470 'header:', headerHeight)]]
Nenue@1 471
Nenue@14 472 --Scroller:SetSize(wrapperWidth, wrapperHeight)
Nenue@13 473 Scroller:SetPoint('TOPLEFT', Wrapper, 'TOPLEFT', 0, 0)
Nenue@1 474 Scroller:SetPoint('BOTTOMRIGHT', Wrapper, 'BOTTOMRIGHT')
Nenue@1 475
Nenue@7 476
Nenue@1 477 Scroll:SetSize(scrollWidth, scrollHeight)
Nenue@7 478 Scroll:SetPoint('TOPLEFT', Scroller, 'TOPLEFT', 0, B.Conf.ObjectiveScroll or 0)
Nenue@1 479 Scroll:SetPoint('RIGHT', Scroller, 'RIGHT')
Nenue@1 480
Nenue@1 481 --Scroller:UpdateScrollChildRect()
Nenue@13 482 Wrapper:SetSize(wrapperWidth, wrapperHeight)
Nenue@1 483
Nenue@14 484 --[[ update action buttons
Nenue@6 485 print('|cFF00FF00'..Scroll:GetName()..'|r:', Scroll:GetWidth(), Scroll:GetHeight(),
Nenue@6 486 '|cFF00FF00'..Scroller:GetName()..'|r:', Scroller:GetWidth(), Scroller:GetHeight(),
Nenue@6 487 '|cFF00FF00'..Wrapper:GetName()..'|r:', Wrapper:GetWidth(), Wrapper:GetHeight(),
Nenue@6 488 '|cFF0088FFvScrollRange|r:', floor(Scroller:GetVerticalScrollRange()+.5)
Nenue@6 489 )
Nenue@18 490 --]]
Nenue@23 491 T.UpdateActionButtons()
Nenue@1 492
Nenue@1 493 end
Nenue@19 494 --]=]
Nenue@1 495
Nenue@21 496
Nenue@21 497 Default.Update = function (self, reason, ...)
Nenue@21 498 local print = tprint
Nenue@21 499 local tracker = self.frame
Nenue@21 500 local blockIndex = 0
Nenue@21 501 local trackerHeight = floor(tracker.titlebg:GetHeight()+.5)
Nenue@21 502
Nenue@21 503 self.currentAnchor = tracker.titlebg
Nenue@21 504 local numWatched = self:GetNumWatched()
Nenue@21 505 local numBlocks = self.numBlocks
Nenue@21 506 local actualBlocks = 0
Nenue@21 507 for watchIndex = 1, 25 do
Nenue@21 508 blockIndex = blockIndex + 1
Nenue@21 509 if watchIndex <= numWatched then
Nenue@21 510 local info = self:GetInfo(watchIndex)
Nenue@21 511 if info then
Nenue@21 512 local currentBlock = self:UpdateBlock(blockIndex, info)
Nenue@22 513 currentBlock:SetPoint('TOPLEFT', self.currentAnchor, 'BOTTOMLEFT', 0, 0)
Nenue@21 514 currentBlock:SetPoint('RIGHT', tracker,'RIGHT', 0, 0)
Nenue@21 515 self.currentAnchor = currentBlock
Nenue@22 516 print(' |cFFFFFF00'..watchIndex..'|r', '|cFF00FF00'..currentBlock:GetName()..'|r', currentBlock.height, trackerHeight)
Nenue@21 517 trackerHeight = trackerHeight + currentBlock.height
Nenue@21 518 numBlocks = max(numBlocks, watchIndex)
Nenue@21 519 actualBlocks = actualBlocks + 1
Nenue@21 520 else
Nenue@21 521 print(' |cFFFF0000bad GetInfo data for #'..watchIndex)
Nenue@21 522 end
Nenue@21 523
Nenue@21 524 elseif watchIndex <= numBlocks then
Nenue@21 525 local used = self.usedBlocks
Nenue@21 526 local free = self.freeBlocks
Nenue@21 527 print('clean up dead quest block')
Nenue@21 528 if used[blockIndex] then
Nenue@21 529 used[blockIndex]:Hide()
Nenue@21 530 used[blockIndex]:ClearAllPoints()
Nenue@21 531 free[#free+1]= used[blockIndex]
Nenue@21 532 used[blockIndex] = nil
Nenue@21 533 end
Nenue@21 534 else
Nenue@21 535 print(' |cFFFF9900END|r @', blockIndex)
Nenue@21 536 break -- done with quest stuff
Nenue@21 537 end
Nenue@21 538 end
Nenue@21 539 self.numWatched = numWatched
Nenue@21 540 self.numBlocks = numBlocks
Nenue@21 541 self.actualBlocks = actualBlocks
Nenue@21 542
Nenue@21 543 tracker.previousHeight = tracker.height
Nenue@21 544 if numBlocks >= 1 then
Nenue@21 545 previousBlock = nil
Nenue@21 546
Nenue@22 547 tracker.height = trackerHeight
Nenue@21 548 tracker:SetHeight(tracker.height)
Nenue@21 549 tracker:Show()
Nenue@21 550
Nenue@21 551
Nenue@21 552 else
Nenue@21 553 tracker.height = 0
Nenue@21 554 tracker:Hide()
Nenue@21 555 end
Nenue@21 556
Nenue@21 557 return tracker.numWatched, tracker.numAll
Nenue@21 558 end
Nenue@21 559
Nenue@21 560 --- Updates the selected block frame to display the given info batch
Nenue@21 561 -- If `previousBlock` is set, it will attempt to anchor to that
Nenue@21 562 -- @param blockNum the ordered block to be updated, not a watchIndex value
Nenue@21 563 -- @param info the reference returned by the GetXInfo functions
Nenue@21 564 -- REMEMBER: t.info and questData[questID] are the same table
Nenue@23 565 Default.UpdateBlock = function (handler, blockIndex, info)
Nenue@21 566 local print = bprint
Nenue@21 567 print(' Read list item |cFF00FFFF'..blockIndex..'|r')
Nenue@21 568 if not blockIndex or not info then
Nenue@21 569 return
Nenue@21 570 end
Nenue@23 571 local frame = handler.frame
Nenue@23 572 local block = T.GetBlock(handler, blockIndex)
Nenue@23 573 block.handler = handler
Nenue@21 574 block.info = info
Nenue@21 575 block.mainStyle = info.mainStyle or 'Normal'
Nenue@21 576 block.subStyle = info.subStyle
Nenue@21 577
Nenue@21 578 info.blockIndex = blockIndex
Nenue@23 579 if info.questID then handler.QuestBlock[info.questID] = block end
Nenue@23 580 if info.questLogIndex then handler.LogBlock[info.questLogIndex] = block end
Nenue@23 581 if info.watchIndex then handler.WatchBlock[info.watchIndex] = block end
Nenue@23 582 handler.BlockInfo[blockIndex] = info
Nenue@21 583
Nenue@21 584 block.endPoint = block.titlebg
Nenue@21 585 block.attachmentHeight = 0
Nenue@23 586 handler:UpdateObjectives(block)
Nenue@21 587
Nenue@21 588 block.title:SetText(info.title)
Nenue@21 589 local titleHeight = floor(block.title:GetHeight()+.5)
Nenue@21 590 local statusHeight = floor(block.status:GetHeight()+.5)
Nenue@21 591 local attachmentHeight =floor(block.attachmentHeight + .5)
Nenue@21 592 local titlebgHeight = titleHeight + titleSpacing*2
Nenue@21 593 local statusbgHeight = statusHeight + textSpacing*2
Nenue@21 594
Nenue@21 595 block.titlebg:SetHeight(titlebgHeight)
Nenue@21 596
Nenue@21 597
Nenue@23 598 print(' |cFF0088FFanchor to', handler.currentAnchor:GetName())
Nenue@21 599
Nenue@21 600 print(' |cFF00FF00total sizes:')
Nenue@21 601 print(' attachment:', attachmentHeight)
Nenue@21 602 print(' title:', titlebgHeight, '('.. titleHeight..')')
Nenue@23 603 --block.titlebg:SetHeight(block.title:GetHeight() + T.Conf.Wrapper.TitleSpacing)
Nenue@21 604 block.height = titlebgHeight + attachmentHeight
Nenue@21 605 if statusHeight > 1 then
Nenue@21 606 block.height = block.height + statusbgHeight
Nenue@21 607 print(' status:', statusbgHeight, '('.. statusHeight..')')
Nenue@21 608 else
Nenue@21 609 print(' |cFFFF0088 skipped')
Nenue@21 610 end
Nenue@21 611 block:SetHeight(block.height)
Nenue@21 612
Nenue@21 613 print(' |cFFFFFF00height|r:', block.height)
Nenue@21 614 print(' |cFF00FFFF)|r -> ', block, block:GetHeight())
Nenue@21 615
Nenue@21 616 block:Show()
Nenue@21 617
Nenue@21 618 if info.specialItem and not info.itemButton then
Nenue@21 619 print(' - |cFF00FFFFgenerating item button for info set')
Nenue@23 620 info.itemButton = T.SetItemButton(block, info)
Nenue@21 621 else
Nenue@21 622 --info.itemButton = nil
Nenue@21 623 end
Nenue@21 624
Nenue@21 625 local tagPoint, tagAnchor, tagRelative = 'TOPRIGHT', block, 'TOPRIGHT'
Nenue@21 626 if info.rewardInfo then
Nenue@21 627 print('has immediate reward')
Nenue@21 628 if info.rewardInfo[1].type == 'currency' or info.rewardInfo[1].type == 'item' then
Nenue@21 629 block.icon:Show()
Nenue@21 630 block.iconLabel:SetText(info.rewardInfo[1].count)
Nenue@22 631 block.icon:SetPoint(tagPoint, tagAnchor, tagRelative, -2, -2)
Nenue@21 632 tagPoint, tagAnchor, tagRelative = 'TOPRIGHT', block.icon, 'TOPLEFT'
Nenue@21 633 block.icon:SetTexture(info.rewardInfo[1].texture)
Nenue@21 634 end
Nenue@21 635 else
Nenue@21 636 block.icon:Hide()
Nenue@21 637 end
Nenue@21 638
Nenue@21 639 if info.selected then
Nenue@21 640 block.SelectionOverlay:Show()
Nenue@21 641 else
Nenue@21 642 block.SelectionOverlay:Hide()
Nenue@21 643 end
Nenue@23 644 -- workaround for scrollchild issue where layers fall out of sync: in this case, it's by 1 vertical pixel
Nenue@23 645 --block.highlight:SetPoint('TOPLEFT', block, 'TOPLEFT', 0, 1)
Nenue@23 646 --block.lowlight:SetPoint('BOTTOMLEFT', block, 'BOTTOMLEFT', 0, 1)
Nenue@21 647
Nenue@23 648 tagPoint, tagAnchor, tagRelative = T.AddTag(block, 'frequencyTag', tagPoint, tagAnchor, tagRelative)
Nenue@23 649 tagPoint, tagAnchor, tagRelative = T.AddTag(block, 'typeTag', tagPoint, tagAnchor, tagRelative)
Nenue@23 650 tagPoint, tagAnchor, tagRelative = T.AddTag(block, 'completionTag', tagPoint, tagAnchor, tagRelative)
Nenue@21 651
Nenue@21 652 return block
Nenue@21 653 end
Nenue@21 654 ----------
Nenue@21 655 --- Top level methods
Nenue@21 656
Nenue@21 657 local tick = 0
Nenue@23 658 function T:Update (reason, ...)
Nenue@21 659 tick = tick + 1
Nenue@21 660 local print = tprint
Nenue@21 661 reason = reason or OBJECTIVE_TRACKER_UPDATE_REASON
Nenue@21 662 local updateWrapper = 0
Nenue@21 663 local hasStuff
Nenue@21 664 local insertingStuff
Nenue@21 665
Nenue@23 666 print(format('%d |cFFFF%04X Update()', tick, lshift(reason, 4)), reason, ...)
Nenue@21 667 currentPosition = 0
Nenue@21 668 anchorPoint = 'TOP'
Nenue@21 669 anchorFrame = Scroll
Nenue@21 670
Nenue@21 671 local wrapperHeight = 0
Nenue@23 672 for id, handler in pairs(T.orderedHandlers) do
Nenue@21 673 local frame = handler.frame
Nenue@21 674
Nenue@22 675 print(format('|cFF00FFFF%s and(%04X vs %04x+%04x) = %04X|r', handler.name, reason, handler.updateReasonModule, handler.updateReasonEvents, band(reason, handler.updateReasonModule + handler.updateReasonEvents)))
Nenue@21 676 if band(reason, handler.updateReasonModule + handler.updateReasonEvents) > 0 then
Nenue@21 677 handler:Update(reason, ...)
Nenue@21 678 print(' |cFF00FF00'..id..'|r', handler.displayName, 'count:', handler.numWatched)
Nenue@21 679 insertingStuff = true
Nenue@21 680 else
Nenue@21 681 print(' |cFFFF0088'..id..'|r', 'no reason to update')
Nenue@21 682 end
Nenue@21 683
Nenue@21 684 if handler.numWatched >= 1 then
Nenue@21 685 hasStuff = true
Nenue@21 686 currentPosition = currentPosition + 1
Nenue@21 687 frame:SetParent(Scroll)
Nenue@21 688 frame:SetPoint('TOP', anchorFrame, anchorPoint, 0, 0)
Nenue@21 689 print(' |cFF00BBFFpinning to', anchorFrame:GetName(), anchorPoint)
Nenue@21 690 anchorFrame = handler.frame
Nenue@21 691 anchorPoint = 'BOTTOM'
Nenue@21 692
Nenue@21 693 print('current frame height:', frame.height)
Nenue@21 694 wrapperHeight = wrapperHeight + frame.height
Nenue@21 695 print('|cFFFF0088total height:', wrapperHeight)
Nenue@21 696 else
Nenue@21 697 handler.frame:Hide()
Nenue@21 698 end
Nenue@21 699 end
Nenue@21 700
Nenue@21 701
Nenue@21 702 if hasStuff or insertingStuff then
Nenue@21 703 print('updating height to', wrapperHeight)
Nenue@21 704 Wrapper:SetHeight(wrapperHeight)
Nenue@21 705 Scroller:SetHeight(wrapperHeight)
Nenue@21 706 Scroll:SetHeight(wrapperHeight)
Nenue@21 707 Scroller:SetVerticalScroll(B.Conf.ObjectiveScroll or 0)
Nenue@21 708 print('|cFFFF8800Wrapper:', Wrapper:GetSize())
Nenue@21 709 for i = 1, Wrapper:GetNumPoints() do
Nenue@21 710 print(' ', Wrapper:GetPoint(i))
Nenue@21 711 end
Nenue@21 712 print(' |cFF00FFFFScroller:', Scroller:GetSize())
Nenue@21 713 for i = 1, Scroller:GetNumPoints() do
Nenue@21 714 print(' ', Scroller:GetPoint(i))
Nenue@21 715 end
Nenue@21 716 print(' |cFF00FFFFScroll:', Scroll:GetSize())
Nenue@21 717 for i = 1, Scroll:GetNumPoints() do
Nenue@21 718 print(' ', Scroll:GetPoint(i))
Nenue@21 719 end
Nenue@21 720
Nenue@21 721 Wrapper:Show()
Nenue@21 722 Scroller:Show()
Nenue@21 723 Scroll:Show()
Nenue@21 724 end
Nenue@23 725 Quest.GetClosest()
Nenue@24 726 --T.UpdateActionButtons(reason)
Nenue@21 727 end
Nenue@21 728
Nenue@1 729 --- Queue any active item buttons for update for that frame
Nenue@24 730 local iprint = B.print('ItemButton')
Nenue@23 731 T.UpdateActionButtons = function(updateReason)
Nenue@24 732 local print = iprint
Nenue@6 733 Scroller.snap_upper = 0
Nenue@6 734 Scroller.snap_lower = 0
Nenue@6 735 local print = B.print('ItemButton')
Nenue@6 736 if updateReason then
Nenue@6 737 print = B.print('IB_'..updateReason)
Nenue@6 738 end
Nenue@6 739
Nenue@1 740 local previousItem
Nenue@24 741 for questID, itemButton in pairs(Quest.itemButtons) do
Nenue@23 742 local info= T.Quest.Info[questID]
Nenue@6 743
Nenue@5 744 print('|cFF00FFFF'.. questID .. '|r', itemButton:GetName())
Nenue@23 745 local block = T.Quest.QuestBlock[questID]
Nenue@1 746 if block then
Nenue@5 747 -- Dispatch the probe
Nenue@6 748 if IsQuestWatched(info.questLogIndex) then
Nenue@6 749 itemButton.previousItem = previousItem
Nenue@5 750 print(' |cFFFFFF00probing', block:GetName())
Nenue@1 751 block:SetScript('OnUpdate', function()
Nenue@5 752 if block:GetBottom() and not InCombatLockdown() then
Nenue@5 753 print(' '..block:GetName()..' |cFF00FF00probe hit!')
Nenue@23 754 T.UpdateBlockAction(block, itemButton, itemButton.previousItem) -- needs to be previousItem from this scope
Nenue@5 755 block:SetScript('OnUpdate', nil)
Nenue@22 756
Nenue@5 757 end
Nenue@5 758 end)
Nenue@6 759 previousItem = itemButton
Nenue@1 760 else
Nenue@5 761 print('hidden block or unwatched quest')
Nenue@6 762 itemButton.previousItem = nil
Nenue@5 763 itemButton:Hide()
Nenue@1 764 end
Nenue@8 765 elseif itemButton:IsVisible() then
Nenue@8 766 print(' |cFFFF0088hiding unwatched quest button', itemButton:GetName())
Nenue@6 767 itemButton.previousItem = nil
Nenue@6 768 itemButton:Hide()
Nenue@8 769 else
Nenue@8 770 print(' |cFFBBBBBBignoring hidden log quest button', itemButton:GetName())
Nenue@1 771 end
Nenue@1 772 end
Nenue@1 773 end
Nenue@1 774
Nenue@23 775 T.UpdateBlockAction = function (block, itemButton)
Nenue@24 776 local print = iprint
Nenue@5 777 print('**|cFF0088FF'..itemButton:GetName(), '|r:Update()')
Nenue@5 778 if itemButton.questID ~= block.info.questID then
Nenue@5 779 print('** |cFFFF0088mismatched block assignment', itemButton.questID,'<~>', block.info.questID)
Nenue@6 780 -- something happened between this and last frame, go back and set new probes
Nenue@23 781 return T.UpdateActionButtons()
Nenue@2 782 end
Nenue@2 783
Nenue@6 784 local previousItem = itemButton.previousItem
Nenue@6 785 local upper_bound = Scroller:GetTop() + Scroller.snap_upper
Nenue@6 786 local lower_bound = Scroller:GetBottom() + Scroller.snap_lower + itemButtonSize
Nenue@6 787 local point, anchor, relative
Nenue@6 788
Nenue@6 789 if block:GetBottom() < lower_bound then
Nenue@6 790 print('** ',block:GetName() ,'|cFFFFFF00bottom =', floor(block:GetBottom()+.5), 'threschold =', floor(lower_bound+.5))
Nenue@1 791 if previousItem then
Nenue@6 792 print('adjusting', previousItem:GetName())
Nenue@1 793 previousItem:ClearAllPoints()
Nenue@6 794 previousItem:SetPoint('BOTTOM', itemButton, 'TOP', 0, itemButtonSpacing)
Nenue@1 795 end
Nenue@1 796 itemButton:ClearAllPoints()
Nenue@6 797 itemButton.x = Wrapper:GetLeft() -4
Nenue@6 798 itemButton.y = Wrapper:GetBottom()
Nenue@6 799 point, anchor, relative = 'BOTTOMRIGHT', UIParent, 'BOTTOMLEFT'
Nenue@6 800 Scroller.snap_lower = Scroller.snap_lower + itemButtonSize + itemButtonSpacing
Nenue@6 801
Nenue@6 802 elseif block:GetTop() > upper_bound then
Nenue@6 803 print('** ',block:GetName() ,'|cFFFFFF00top =', floor(block:GetTop()+.5), 'threschold =', floor(upper_bound+.5))
Nenue@6 804 itemButton:ClearAllPoints()
Nenue@6 805 if previousItem then
Nenue@6 806 print('latch onto another piece')
Nenue@6 807 point, anchor, relative ='TOP', previousItem, 'BOTTOM'
Nenue@6 808 itemButton.x = 0
Nenue@6 809 itemButton.y = -itemButtonSpacing
Nenue@6 810 else
Nenue@6 811 print('latch at corner', Scroller:GetLeft() -itemButtonSpacing, Scroller:GetTop())
Nenue@6 812 point, anchor, relative = 'TOPRIGHT', UIParent, 'BOTTOMLEFT'
Nenue@6 813 itemButton.x = Scroller:GetLeft() -4
Nenue@6 814 itemButton.y = Scroller:GetTop()
Nenue@6 815 end
Nenue@1 816 itemButton:Show()
Nenue@6 817 Scroller.snap_upper = Scroller.snap_upper - (itemButtonSize + itemButtonSpacing)
Nenue@1 818 else
Nenue@6 819 print('** ',block:GetName() ,'|cFF00FF00span =', floor(block:GetBottom()+.5), floor(block:GetTop()+.5), 'threschold =', floor(lower_bound+.5))
Nenue@1 820 itemButton:ClearAllPoints()
Nenue@6 821 itemButton.x = block:GetLeft() - itemButtonSpacing
Nenue@6 822 itemButton.y = block:GetTop()
Nenue@6 823 point, anchor, relative = 'TOPRIGHT', UIParent, 'BOTTOMLEFT'
Nenue@1 824 end
Nenue@6 825
Nenue@6 826 itemButton:SetPoint(point, anchor, relative, itemButton.x, itemButton.y)
Nenue@6 827 itemButton:Show()
Nenue@1 828 end
Nenue@1 829
Nenue@23 830 T.UpdateItemButtonCooldown = function(button)
Nenue@1 831
Nenue@1 832 end
Nenue@18 833
Nenue@18 834 local unitLevel = UnitLevel('player')
Nenue@18 835
Nenue@18 836