comparison Veneer.lua @ 103:8df154a2bfd6 v7.1.5-r104

- Fixed a tainting issue caused by trying to hook ToggleAllBags
author Nenue
date Thu, 26 Jan 2017 17:36:12 -0500
parents 1e511e9aaca5
children ff00679a7817
comparison
equal deleted inserted replaced
102:1e511e9aaca5 103:8df154a2bfd6
6 -- 5. Reanchor() 6 -- 5. Reanchor()
7 7
8 SLASH_VENEER1 = "/veneer" 8 SLASH_VENEER1 = "/veneer"
9 SLASH_VENEER2 = "/vn" 9 SLASH_VENEER2 = "/vn"
10 local VENEER_VERSION = 703 10 local VENEER_VERSION = 703
11 local LE_FREE_FRAMES_GROUP = 1
11 local type, strrep, ipairs, tinsert, tostring, select = type, string.rep, ipairs, tinsert, tostring, select 12 local type, strrep, ipairs, tinsert, tostring, select = type, string.rep, ipairs, tinsert, tostring, select
12 local pairs, tremove = pairs, tremove 13 local pairs, tremove = pairs, tremove
13 14
14 SlashCmdList.VENEER = function(cmd) 15 SlashCmdList.VENEER = function(cmd)
15 16
22 end 23 end
23 24
24 VeneerCore = { 25 VeneerCore = {
25 Frames = {}, 26 Frames = {},
26 ConfigLayers = {}, 27 ConfigLayers = {},
27 FrameClusters = {}, 28 FrameClusters = {
29 [LE_FREE_FRAMES_GROUP] = {},
30 },
28 parserDepth = 0, 31 parserDepth = 0,
29 pendingCalls = {}, 32 pendingCalls = {},
30 AddOnCheck = {} 33 AddOnCheck = {}
31 } 34 }
32 35
258 print(' cluster', anchorGroup, 'table', clusterTable, 'position', clusterIndex) 261 print(' cluster', anchorGroup, 'table', clusterTable, 'position', clusterIndex)
259 262
260 handler.anchorCluster = clusterTable 263 handler.anchorCluster = clusterTable
261 handler.anchorIndex = clusterIndex 264 handler.anchorIndex = clusterIndex
262 else 265 else
266 local clusterTable = self.FrameClusters[LE_FREE_FRAMES_GROUP]
267 handler.anchorCluster = clusterTable
268 handler.anchorIndex = #clusterTable+1
269 tinsert(clusterTable, handler.anchorIndex, handler)
263 print(' free frame') 270 print(' free frame')
264 end 271 end
265 272
266 for k,v in pairs(VeneerHandlerMixin) do 273 for k,v in pairs(VeneerHandlerMixin) do
267 if not handler[k] then 274 if not handler[k] then
317 324
318 function VeneerCore:DynamicReanchor(parent) 325 function VeneerCore:DynamicReanchor(parent)
319 parent = parent or self 326 parent = parent or self
320 print('|cFF88FF00DynamicReanchor()') 327 print('|cFF88FF00DynamicReanchor()')
321 for anchorPoint, cluster in pairs(parent.FrameClusters) do 328 for anchorPoint, cluster in pairs(parent.FrameClusters) do
322 local lastFrame 329 if anchorPoint ~= LE_FREE_FRAMES_GROUP then
323 for index, frame in ipairs(cluster) do 330 local lastFrame
324 print(' |cFF00FF00'..index, frame:GetName(), frame:IsVisible(), (lastFrame and ('|cFFFFFF00'..lastFrame:GetName()..'|r') or '|cFF00FFFFUIParent')) 331 for index, frame in ipairs(cluster) do
325 if frame:IsVisible() then 332 print(' |cFF00FF00'..index, frame:GetName(), frame:IsVisible(), (lastFrame and ('|cFFFFFF00'..lastFrame:GetName()..'|r') or '|cFF00FFFFUIParent'))
326 333 if frame:IsVisible() then
327 if frame.anchorFrame then 334
328 print(frame.anchorPoint) 335 if frame.anchorFrame then
329 frame:SetPoint(frame.anchorPoint, frame.anchorFrame, frame.anchorFrom, frame.anchorX, frame.anchorY) 336 print(frame.anchorPoint)
330 print(frame:GetTop(), frame:GetRight()) 337 frame:SetPoint(frame.anchorPoint, frame.anchorFrame, frame.anchorFrom, frame.anchorX, frame.anchorY)
331 else 338 print(frame:GetTop(), frame:GetRight())
332 anchorPoint = frame.anchorPoint or anchorPoint
333 frame:ClearAllPoints()
334 if lastFrame then
335 frame:SetPoint(anchorPoint, lastFrame, ANCHOR_OFFSET_POINT[anchorPoint], 0, 0)
336 else 339 else
337 frame:SetPoint(anchorPoint, UIParent, anchorPoint, frame.anchorX, frame.anchorY) 340 anchorPoint = frame.anchorPoint or anchorPoint
341 frame:ClearAllPoints()
342 if lastFrame then
343 frame:SetPoint(anchorPoint, lastFrame, ANCHOR_OFFSET_POINT[anchorPoint], 0, 0)
344 else
345 frame:SetPoint(anchorPoint, UIParent, anchorPoint, frame.anchorX, frame.anchorY)
346 end
347 print(frame:GetTop(), frame:GetRight())
348 lastFrame = frame
338 end 349 end
339 print(frame:GetTop(), frame:GetRight()) 350
340 lastFrame = frame
341 end 351 end
342 352
343 end 353 end
344 354 end
345 end 355
346 end 356 end
347 end 357 end
348 358
349 -- Evaluates the current visibility state and re-anchors adjacent blocks accordingly 359 -- Evaluates the current visibility state and re-anchors adjacent blocks accordingly
350 function VeneerCore:InternalReanchor(handler, printFunc) 360 function VeneerCore:InternalReanchor(handler, printFunc)