annotate Veneer.lua @ 116:ddfe19d70a34

ArtifactPower: - Further 7.2 accommodations, relating to tokens that grant millions of AP. Currency: - Ancient Mana zones list expanded - Legionfall War Supplies, Nethershards, and Blood of Sargeras are tracked globally PaperDoll: - Should update more effectively when delayed artifact data loads in. WorldState: - Fixed hanging panels after OrderHallCommandBar is hidden.
author Nenue
date Wed, 26 Apr 2017 20:06:38 -0400
parents 8c94bee4fdfc
children 1f68c46bc4de
rev   line source
Nenue@88 1 -- Veneer Custom Interface Framework
Nenue@88 2 -- 1. vn OnLoad
Nenue@88 3 -- 2. OnEvent where IsLoggedIn() == true
Nenue@88 4 -- 3. Setup() where (not self.initialized)
Nenue@88 5 -- 4. Update()
Nenue@88 6 -- 5. Reanchor()
Nick@109 7 local ADDON, Veneer = ...
Nenue@90 8 local VENEER_VERSION = 703
Nenue@103 9 local LE_FREE_FRAMES_GROUP = 1
Nenue@93 10 local type, strrep, ipairs, tinsert, tostring, select = type, string.rep, ipairs, tinsert, tostring, select
Nenue@93 11 local pairs, tremove = pairs, tremove
Nick@109 12 local print = DEVIAN_WORKSPACE and function(...) _G.print('Veneer', ...) end or nop
Nick@113 13 local eprint = DEVIAN_WORKSPACE and function(...) _G.print('VeneerEvent', ...) end or nop
Nick@109 14 local wipe = table.wipe
Nenue@84 15
Nick@109 16 SLASH_VENEER1 = "/veneer"
Nick@109 17 SLASH_VENEER2 = "/vn"
Nenue@84 18 SlashCmdList.VENEER = function(cmd)
Nenue@90 19 if Veneer.ConfigMode then
Nenue@90 20 Veneer.ConfigMode = false
Nenue@90 21 else
Nenue@90 22 Veneer.ConfigMode = true
Nenue@90 23 end
Nenue@90 24 Veneer:UpdateConfigLayers()
Nenue@84 25 end
Nenue@88 26
Nenue@115 27 Veneer.modules = {}
Nick@109 28 Veneer.Frames = {}
Nick@109 29 Veneer.ConfigLayers = {}
Nick@109 30 Veneer.FrameClusters = {
Nick@109 31 [LE_FREE_FRAMES_GROUP] = {}
Nick@109 32 }
Nick@109 33 Veneer.parserDepth = 0
Nick@109 34 Veneer.pendingCalls = {}
Nick@109 35 Veneer.AddOnCheck = {}
Nenue@0 36
Nenue@59 37 local defaults = {
Nenue@59 38 enableAll = true,
Nenue@90 39 ConfigMode = true
Nenue@59 40 }
Nenue@84 41
Nenue@71 42 local configMode
Nenue@79 43 local anonID = 0
Nenue@79 44 local IsFrameHandle = IsFrameHandle
Nenue@79 45 local GetAnonymousName = function(key)
Nenue@79 46 if not key then
Nenue@71 47 anonID = anonID + 1
Nenue@79 48 key = anonID
Nenue@71 49 end
Nenue@79 50 return 'VN' .. key
Nenue@71 51 end
Nenue@79 52 local GetTableName = function(table)
Nenue@79 53 return (IsFrameHandle(table) and table:GetName()) or tostring(table)
Nenue@79 54 end
Nenue@79 55
Nenue@87 56 local OFFSET_PARALLELS = {
Nenue@87 57 TOP = {'LEFT', 'RIGHT', 'SetHeight'},
Nenue@87 58 BOTTOM = {'LEFT', 'RIGHT', 'SetHeight'},
Nenue@87 59 LEFT = {'TOP', 'BOTTOM', 'SetWidth'},
Nenue@87 60 RIGHT = {'TOP', 'BOTTOM', 'SetWidth'},
Nenue@87 61 }
Nenue@87 62 local ANCHOR_OFFSET_POINT = {
Nenue@87 63 TOP = 'BOTTOM',
Nenue@87 64 TOPLEFT = 'BOTTOMRIGHT',
Nenue@87 65 TOPRIGHT = 'BOTTOMLEFT',
Nenue@87 66 LEFT = 'RIGHT',
Nenue@87 67 RIGHT = 'LEFT',
Nenue@87 68 CENTER = 'CENTER',
Nenue@87 69 BOTTOM = 'TOP',
Nenue@87 70 BOTTOMRIGHT = 'TOPLEFT',
Nenue@87 71 BOTTOMLEFT = 'TOPRIGHT',
Nenue@87 72 }
Nenue@87 73 local ANCHOR_INSET_DELTA = {
Nenue@87 74 TOP = {0, -1},
Nenue@87 75 TOPLEFT = {1, -1},
Nenue@87 76 TOPRIGHT = {-1,-1},
Nenue@87 77 LEFT = {1, 0},
Nenue@87 78 BOTTOMLEFT = {1, 1},
Nenue@87 79 BOTTOM = {0, 1},
Nenue@87 80 BOTTOMRIGHT = {-1, 1},
Nenue@87 81 RIGHT = {-1, 0},
Nenue@87 82 CENTER = {0, 0},
Nenue@72 83 }
Nenue@72 84
Nick@109 85 function Veneer:print(...)
Nenue@84 86 local txt = '|cFFFFFF00Veneer|r:'
Nenue@84 87 for i = 1, select('#', ...) do
Nenue@84 88 txt = txt .. ' '.. tostring(select(i, ...))
Nenue@84 89 end
Nenue@84 90
Nenue@84 91 DEFAULT_CHAT_FRAME:AddMessage(txt)
Nenue@84 92 end
Nenue@84 93
Nick@109 94 function Veneer:OnLoad()
Nenue@84 95 print('|cFFFFFF00Veneer!|r')
Nenue@84 96 self:RegisterEvent('ADDON_LOADED')
Nenue@84 97 self:RegisterEvent('PLAYER_LOGIN')
Nenue@115 98 self:RegisterEvent('PLAYER_REGEN_ENABLED')
Nenue@115 99 self:RegisterEvent('PLAYER_REGEN_DISABLED')
Nenue@84 100
Nenue@84 101 self.DEVIAN_PNAME = 'Veneer'
Nenue@84 102 self:RegisterForDrag('LeftButton')
Nenue@88 103
Nenue@88 104
Nenue@84 105 end
Nenue@84 106
Nenue@90 107 local select, IsAddOnLoaded, IsLoggedIn = select, IsAddOnLoaded, IsLoggedIn
Nenue@90 108
Nick@109 109 function Veneer:OnEvent(event, ...)
Nick@113 110 local print = eprint
Nenue@97 111 print('|cFFFF0088OnEvent()|r',event, ...)
Nenue@98 112 if (event == 'PLAYER_LOGIN') or (event == 'ADDON_LOADED') then
Nenue@90 113 print(IsLoggedIn(), self.initialized)
Nenue@84 114 if IsLoggedIn() and not self.intialized then
Nenue@84 115 self:Setup()
Nenue@90 116 self.intialized = true
Nenue@90 117 print('popping init sequence', self.intialized)
Nenue@90 118 end
Nenue@90 119
Nenue@90 120
Nenue@90 121 if self.intialized then
Nenue@90 122 local addon = ...
Nenue@90 123 if self.AddOnCheck[addon] then
Nenue@90 124 print(' - setting up '..addon..' dependent modules:')
Nenue@90 125 local keepChecking = false
Nenue@90 126 for index, handler in ipairs(self.AddOnCheck[addon]) do
Nenue@90 127 print(' -', handler:GetName(), (not handler.initialized) and (handler.addonFrame and not _G[handler.addonFrame]))
Nenue@90 128 if not handler.initialized then
Nenue@90 129 print(' '..handler:GetName()..':Setup()')
Nenue@90 130 handler:Setup()
Nenue@90 131 handler.initialized = true
Nenue@90 132 end
Nenue@90 133 end
Nenue@90 134 if not keepChecking then
Nenue@90 135 self.AddOnCheck[addon] = nil
Nenue@90 136 end
Nenue@90 137 end
Nenue@84 138 end
Nenue@115 139 elseif event == 'PLAYER_REGEN_ENABLED' then
Nenue@115 140 for _, module in pairs(self.modules) do
Nenue@115 141 if module:IsShown() and module.hideCombat then
Nenue@115 142 module:Hide()
Nenue@115 143 end
Nenue@115 144 end
Nenue@115 145
Nenue@115 146 elseif event == 'PLAYER_REGEN_DISABLED' then
Nenue@115 147 for _, module in pairs(self.modules) do
Nenue@115 148 if module:IsShown() and module.hideCombat then
Nenue@115 149 module:Show()
Nenue@115 150 end
Nenue@115 151 end
Nenue@84 152 end
Nenue@84 153 end
Nenue@84 154
Nick@109 155 function Veneer:OnDragStart()
Nenue@84 156 self:StartMoving()
Nenue@84 157 end
Nenue@84 158
Nick@109 159 function Veneer:OnDragStop()
Nenue@84 160 self:StopMovingOrSizing()
Nenue@84 161 end
Nenue@84 162
Nenue@93 163 local VeneerModule_Setup = function(frame)
Nenue@97 164 if not frame.initialized then
Nenue@97 165 local doSetup = (not frame.addonTrigger) or select(2, IsAddOnLoaded(frame.addonTrigger))
Nenue@97 166 print(' '..frame:GetName()..'.doSetup =', doSetup)
Nenue@97 167 if doSetup then
Nenue@93 168 frame:Setup()
Nenue@93 169 frame.initialized = true
Nenue@98 170 else
Nick@109 171 frame:RegisterEvent('ADDON_LOADED')
Nenue@93 172 end
Nenue@97 173
Nenue@93 174 end
Nenue@93 175 end
Nenue@93 176
Nick@109 177 function Veneer:Setup ()
Nenue@97 178 print('|cFFFF0088Setup()|r')
Nenue@90 179 local resetConfig = (not VeneerData)
Nenue@90 180 if (not VeneerData) then
Nenue@84 181 VeneerData = defaults
Nenue@90 182 VeneerData.version = VENEER_VERSION
Nenue@84 183 end
Nenue@84 184 self.data = VeneerData
Nenue@93 185 self:ExecuteOnClusters(nil, VeneerModule_Setup)
Nenue@90 186
Nenue@90 187 self.ConfigMode = VeneerData.ConfigMode
Nenue@90 188 self:UpdateConfigLayers()
Nenue@90 189 self:Reanchor()
Nenue@90 190 self:Update()
Nenue@87 191 end
Nenue@84 192
Nick@109 193 function Veneer:UpdateConfigLayers()
Nenue@90 194 if VeneerData then
Nenue@90 195
Nenue@90 196 VeneerData.ConfigMode = self.ConfigMode
Nenue@90 197 end
Nenue@90 198
Nenue@90 199 self:print('Config mode '..(self.ConfigMode and '|cFF00FF00ON|r' or '|cFFFF0000OFF|r')..'.')
Nenue@90 200 self:ExecuteOnClusters(nil, function(frame)
Nenue@90 201 if frame.UpdateConfigLayers then
Nenue@90 202 frame:UpdateConfigLayers(self.ConfigMode)
Nenue@90 203 end
Nenue@90 204
Nenue@90 205
Nenue@90 206 if type(frame.ConfigLayer) == 'table' then
Nenue@90 207 for index, region in ipairs(frame.ConfigLayer) do
Nenue@90 208 print('setting', frame:GetName() .. '['.. index..']', 'to', self.ConfigMode)
Nenue@90 209
Nenue@90 210 region:SetShown(self.ConfigMode)
Nenue@90 211 end
Nenue@90 212 end
Nenue@90 213
Nenue@90 214 self.ConfigLayers[frame] = frame:IsShown()
Nenue@90 215 if self.ConfigMode then
Nenue@90 216 print(frame:GetName(), self.ConfigLayers[frame])
Nenue@90 217 frame:SetShown(self.ConfigMode)
Nenue@90 218 else
Nenue@90 219 frame:SetShown(self.ConfigLayers[frame])
Nenue@90 220 end
Nenue@90 221 end)
Nenue@90 222 end
Nenue@84 223
Nenue@93 224
Nick@109 225 function Veneer:GetClusterFromArgs (...)
Nenue@87 226 return primaryAnchor, clusterTable, insertPosition
Nenue@84 227 end
Nenue@84 228
Nick@108 229 -- args: frame object, list of anchor groups, true for forced top, number for priority layer
Nenue@115 230 local mixins = {}
Nick@109 231 function Veneer:AddHandler(handler, ...)
Nenue@115 232 print('|cFFFFFF00'..handler:GetName()..':|r', handler.moduleName, ...)
Nenue@87 233
Nenue@115 234 wipe(mixins)
Nick@108 235 for k,v in pairs(VeneerHandlerMixin) do
Nick@108 236 if not handler[k] then
Nenue@115 237 tinsert(mixins, k)
Nick@108 238 handler[k] = v
Nick@108 239 end
Nick@108 240 end
Nenue@115 241 if #mixins >= 1 then
Nenue@115 242 print('* Mixins:|cFF00FF88', table.concat(mixins, ', '))
Nenue@115 243 end
Nenue@115 244
Nenue@115 245 self.modules[handler] = handler
Nick@108 246
Nenue@102 247 if not handler.anchorFrame then
Nick@113 248
Nenue@115 249 local primaryAnchor = handler.anchorPoint or 'CENTER'
Nenue@115 250 local clusterPriority = handler.anchorPriority
Nenue@115 251 self.FrameClusters[primaryAnchor] = self.FrameClusters[primaryAnchor] or {}
Nenue@115 252 local clusterTable = self.FrameClusters[primaryAnchor]
Nick@113 253 local clusterIndex
Nick@113 254
Nick@113 255 if clusterPriority then
Nick@113 256 for i = 1, #clusterTable do
Nenue@115 257
Nick@113 258 if clusterTable[i].anchorPriority and (clusterTable[i].anchorPriority > clusterPriority) then
Nenue@115 259 clusterIndex = i
Nick@113 260 print('|cFF00BB00insert position:', clusterPriority, clusterIndex)
Nick@113 261 break
Nick@113 262 else
Nenue@115 263 print('pass', clusterTable[i])
Nenue@115 264 clusterIndex = i+1
Nick@113 265 end
Nick@113 266 end
Nick@113 267 else
Nick@113 268 print('|cFF00BB00inserting at front')
Nenue@115 269 clusterIndex = #clusterTable + 1
Nick@113 270 end
Nick@113 271
Nick@113 272 if not clusterIndex then
Nick@113 273 clusterIndex = #clusterTable + 1
Nick@113 274 end
Nick@113 275
Nick@113 276
Nenue@90 277 tinsert(clusterTable, clusterIndex, handler)
Nenue@115 278 print(' cluster', (clusterDepth or 1) .. '.' .. primaryAnchor, clusterTable, 'priority', clusterPriority, 'position', clusterIndex)
Nenue@90 279
Nenue@102 280 handler.anchorCluster = clusterTable
Nenue@102 281 handler.anchorIndex = clusterIndex
Nenue@102 282 else
Nenue@103 283 local clusterTable = self.FrameClusters[LE_FREE_FRAMES_GROUP]
Nenue@103 284 handler.anchorCluster = clusterTable
Nenue@103 285 handler.anchorIndex = #clusterTable+1
Nenue@103 286 tinsert(clusterTable, handler.anchorIndex, handler)
Nenue@102 287 print(' free frame')
Nenue@102 288 end
Nenue@87 289
Nenue@90 290 if handler.addonTrigger and not IsAddOnLoaded(handler.addonTrigger) then
Nenue@90 291 print('|cFFFF4400 -- dependency:', handler.addonTrigger)
Nenue@90 292 self.AddOnCheck[handler.addonTrigger] = self.AddOnCheck[handler.addonTrigger] or {}
Nenue@90 293 tinsert(self.AddOnCheck[handler.addonTrigger], handler)
Nenue@90 294 end
Nenue@90 295
Nenue@115 296
Nenue@87 297 if self.initialized then
Nenue@90 298 print(' -- initialization check')
Nenue@90 299 if handler.Setup then
Nenue@90 300 local doInit = (not handler.initialized)
Nenue@90 301 if handler.addonTrigger and not IsAddOnLoaded(handler.addonTrigger) then
Nenue@90 302 doInit = false
Nenue@90 303 end
Nenue@90 304 -- room to add other checks
Nenue@90 305
Nenue@90 306 if doInit then
Nenue@90 307 handler:Setup()
Nenue@90 308 handler.initialized = true
Nenue@90 309 self:InternalReanchor(handler)
Nenue@90 310 end
Nenue@87 311 end
Nenue@87 312 end
Nenue@87 313 end
Nenue@87 314
Nick@109 315 function Veneer:Reanchor()
Nenue@87 316 self:ExecuteOnClusters(nil, 'Reanchor')
Nenue@88 317 self:DynamicReanchor(self)
Nenue@87 318 end
Nenue@87 319
Nick@109 320 function Veneer:Update()
Nenue@90 321 self:ExecuteOnClusters(nil, function(frame)
Nenue@90 322 if frame.initialized and frame.Update then
Nenue@90 323 frame:Update()
Nenue@90 324 end
Nenue@90 325 end)
Nenue@88 326 self:Reanchor()
Nenue@87 327 end
Nenue@87 328
Nenue@87 329 -- updates anchor relations to and from the target handler
Nick@109 330 function Veneer:GetAnchor(...)
Nenue@87 331
Nenue@87 332 end
Nenue@87 333
Nick@113 334 -- Recursives updates frame group anchors
Nick@113 335 function Veneer:EvaluateAnchors(parent)
Nenue@88 336 parent = parent or self
Nick@113 337 local print = eprint
Nenue@88 338 print('|cFF88FF00DynamicReanchor()')
Nenue@88 339 for anchorPoint, cluster in pairs(parent.FrameClusters) do
Nenue@103 340 if anchorPoint ~= LE_FREE_FRAMES_GROUP then
Nenue@103 341 local lastFrame
Nenue@103 342 for index, frame in ipairs(cluster) do
Nick@108 343 print(' |cFF00FF00'..index, frame:GetName(), frame:IsShown(), (lastFrame and ('|cFFFFFF00'..lastFrame:GetName()..'|r') or '|cFF00FFFFUIParent'))
Nick@108 344 if frame:IsShown() then
Nenue@90 345
Nenue@103 346 if frame.anchorFrame then
Nenue@103 347 print(frame.anchorPoint)
Nenue@103 348 frame:SetPoint(frame.anchorPoint, frame.anchorFrame, frame.anchorFrom, frame.anchorX, frame.anchorY)
Nick@112 349 print('anchored to', frame.anchorFrame,frame:GetTop(), frame:GetRight())
Nenue@90 350 else
Nenue@103 351 anchorPoint = frame.anchorPoint or anchorPoint
Nenue@103 352 frame:ClearAllPoints()
Nenue@103 353 if lastFrame then
Nenue@103 354 frame:SetPoint(anchorPoint, lastFrame, ANCHOR_OFFSET_POINT[anchorPoint], 0, 0)
Nick@112 355
Nick@112 356 print('moved after', lastFrame,frame:GetTop(), frame:GetRight())
Nenue@103 357 else
Nenue@103 358 frame:SetPoint(anchorPoint, UIParent, anchorPoint, frame.anchorX, frame.anchorY)
Nick@112 359 print('stub', anchorPoint, frame.anchorX, frame.anchorY)
Nenue@103 360 end
Nenue@103 361 lastFrame = frame
Nenue@90 362 end
Nenue@103 363
Nenue@88 364 end
Nenue@90 365
Nenue@88 366 end
Nenue@103 367 end
Nenue@88 368
Nenue@88 369 end
Nenue@88 370 end
Nenue@88 371
Nick@113 372 Veneer.DynamicReanchor = Veneer.EvaluateAnchors
Nick@113 373
Nenue@88 374 -- Evaluates the current visibility state and re-anchors adjacent blocks accordingly
Nick@109 375 function Veneer:InternalReanchor(handler, printFunc)
Nick@113 376 local print = eprint
Nenue@87 377 print('|cFF00FFFFVeneer:InternalReanchor('..handler:GetName()..')')
Nenue@90 378 if handler.anchorFrame then
Nenue@90 379 handler:SetPoint(handler.anchorPoint, handler.anchorFrame, handler.anchorFrom, handler.anchorX, handler.anchorY)
Nenue@90 380 return
Nenue@90 381 end
Nenue@90 382
Nenue@90 383
Nenue@87 384 local anchorPoint = handler.anchorPath or handler.anchorPoint
Nenue@87 385 local anchorParent, anchorTo = UIParent, anchorPoint
Nenue@88 386 local subPoint, subTo
Nenue@88 387 local nextFrame
Nenue@88 388 for index, frame in ipairs(handler.anchorCluster) do
Nenue@88 389 print(' |cFF00FF00'..index, frame:GetName(), frame:IsVisible())
Nick@108 390 if frame:IsShown() then
Nenue@88 391 if frame ~= handler then
Nenue@88 392 anchorParent = frame
Nenue@88 393 anchorTo = ANCHOR_OFFSET_POINT[anchorPoint]
Nenue@87 394
Nenue@88 395 else
Nenue@88 396 nextFrame = handler.anchorCluster[index+1]
Nenue@88 397 if nextFrame then
Nenue@88 398
Nenue@88 399 subPoint = nextFrame.anchorPath or nextFrame.anchorPoint
Nenue@88 400 subTo = ANCHOR_OFFSET_POINT[subPoint]
Nenue@88 401 nextFrame:ClearAllPoints()
Nenue@88 402 nextFrame:SetPoint(subPoint, handler, subTo, 0, 0)
Nenue@88 403 print(' -- pushing '..nextFrame:GetName()..' down the anchor chain', subPoint, subTo)
Nenue@88 404 end
Nenue@88 405 break
Nenue@87 406 end
Nenue@87 407 end
Nenue@87 408 end
Nenue@87 409
Nick@108 410 if handler:IsShown() then
Nenue@88 411 handler:SetPoint(anchorPoint, anchorParent, anchorTo, 0, 0)
Nenue@88 412 else
Nenue@88 413 if anchorParent and nextFrame then
Nenue@88 414 nextFrame:SetPoint(subPoint, handler, subTo, 0, 0)
Nenue@88 415 end
Nenue@88 416 end
Nenue@88 417
Nenue@87 418
Nenue@87 419 print(handler.anchorPoint, anchorParent, anchorTo)
Nenue@87 420 if printFunc then
Nenue@87 421 printFunc('|cFF88FF00'..handler:GetName()..':SetPoint(', handler.anchorPoint, anchorParent, anchorTo)
Nenue@87 422 end
Nenue@88 423 end
Nenue@87 424
Nick@109 425 function Veneer:SlideBlock(frame, ...)
Nick@113 426 local print = eprint
Nenue@89 427 local aX, aY = frame:GetLeft(), frame:GetTop()
Nenue@88 428
Nenue@89 429 frame:SetPoint('TOPLEFT', frame, 'BOTTOMLEFT', aX, aY)
Nenue@89 430 frame.animation = frame.animation or {}
Nenue@89 431 frame.animation.startX = aX
Nenue@89 432 frame.animation.startY = aY
Nenue@88 433
Nenue@89 434 local targetPoint, targetParent, targetAnchor, offsetX, offsetY = ...
Nenue@89 435 frame.BlockSlide:SetScript('OnFinished', function()
Nenue@89 436 frame:SetPoint(targetPoint, targetParent, targetAnchor, offsetX, offsetY)
Nenue@89 437 VeneerAnimationMixin.OnFinished(frame)
Nenue@89 438 end)
Nenue@88 439
Nenue@84 440 end
Nenue@84 441
Nenue@115 442 -- execute a function on all clusters in display order
Nick@109 443 function Veneer:ExecuteOnClusters(layer, method)
Nick@113 444 local print = eprint
Nenue@84 445 self.parserDepth = self.parserDepth + 1
Nenue@84 446 if not layer then
Nenue@87 447 if self.parserDepth > 1 then
Nenue@84 448 tinsert(self.pendingCalls, method)
Nenue@84 449 print('delaying walk for', method)
Nenue@84 450 return
Nenue@84 451 end
Nenue@97 452 print('|cFF00FF00ExecuteOnClusters|r('..tostring(layer)..', '..tostring(method)..')')
Nenue@84 453 else
Nenue@87 454 print(' Level '..self.parserDepth)
Nenue@84 455 end
Nenue@87 456
Nenue@87 457 layer = layer or self.FrameClusters
Nenue@84 458 for anchor, cluster in pairs(layer) do
Nenue@84 459 for index, frame in ipairs(cluster) do
Nenue@87 460 print(' '..anchor..'.'..index..' = '..frame:GetName())
Nenue@90 461 if type(method) == 'function' then
Nenue@90 462 method(frame, true)
Nenue@90 463 elseif frame[method] then
Nenue@87 464 print(' |cFF00FF00'..frame:GetName())
Nenue@87 465 frame[method](frame, true)
Nenue@84 466 end
Nenue@84 467 end
Nenue@84 468 if cluster.FrameClusters then
Nenue@84 469 self:ExecuteOnClusters(cluster.FrameClusters, method)
Nenue@84 470 end
Nenue@84 471 end
Nenue@84 472 self.parserDepth = self.parserDepth - 1
Nenue@84 473
Nenue@84 474 if (self.parserDepth == 0) and (#self.pendingCalls >= 1) then
Nenue@84 475 local delayedMethod = tremove(self.pendingCalls, 1)
Nenue@84 476 print('starting delayed walk for', delayedMethod)
Nenue@84 477 self:ExecuteOnClusters(nil, delayedMethod)
Nenue@84 478 end
Nenue@84 479 end
Nenue@84 480
Nenue@72 481
Nenue@71 482
Nenue@88 483 -- Takes frame handle and assigns a block to it
Nick@109 484 function Veneer:Acquire (frame, template)
Nick@113 485 local print = eprint
Nenue@71 486 if not frame then
Nenue@71 487 print('|cFFFF4400Unable to acquire frame...|r')
Nenue@71 488 return
Nenue@71 489 end
Nenue@84 490 local veneer = self.Frames[frame]
Nenue@84 491 if not veneer then
Nenue@94 492 local name = GetAnonymousName()
Nenue@94 493 veneer = CreateFrame('Frame', name, frame, template)
Nenue@90 494 print(self:GetName()..':Acquire()', frame:GetName(), template)
Nenue@71 495
Nenue@84 496 veneer:SetAllPoints(frame)
Nenue@84 497 veneer:SetParent(frame)
Nenue@84 498 veneer.label:SetText(name)
Nenue@84 499 veneer.bg:SetColorTexture(0,0,0,0)
Nenue@84 500 veneer:Hide()
Nenue@84 501 veneer:EnableMouse(false)
Nenue@84 502 -- find current X/Y
Nenue@84 503 veneer.currentLeft = frame:GetLeft()
Nenue@84 504 veneer.currentTop = frame:GetTop()
Nenue@84 505 self.Frames[frame] = veneer
Nenue@71 506 end
Nenue@84 507 return veneer
Nick@109 508 end
Nick@109 509
Nick@109 510 VeneerCore = Veneer