annotate Veneer.lua @ 113:2105b6e5095f

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