diff 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
line wrap: on
line diff
--- a/Veneer.lua	Wed Jan 25 23:11:27 2017 -0500
+++ b/Veneer.lua	Thu Jan 26 17:36:12 2017 -0500
@@ -8,6 +8,7 @@
 SLASH_VENEER1 = "/veneer"
 SLASH_VENEER2 = "/vn"
 local VENEER_VERSION = 703
+local LE_FREE_FRAMES_GROUP = 1
 local type, strrep, ipairs, tinsert, tostring, select = type, string.rep, ipairs, tinsert, tostring, select
 local pairs, tremove = pairs, tremove
 
@@ -24,7 +25,9 @@
 VeneerCore = {
   Frames = {},
   ConfigLayers = {},
-  FrameClusters = {},
+  FrameClusters = {
+    [LE_FREE_FRAMES_GROUP] = {},
+  },
   parserDepth = 0,
   pendingCalls = {},
   AddOnCheck = {}
@@ -260,6 +263,10 @@
     handler.anchorCluster = clusterTable
     handler.anchorIndex = clusterIndex
   else
+    local clusterTable = self.FrameClusters[LE_FREE_FRAMES_GROUP]
+    handler.anchorCluster = clusterTable
+    handler.anchorIndex = #clusterTable+1
+    tinsert(clusterTable, handler.anchorIndex, handler)
     print(' free frame')
   end
 
@@ -319,30 +326,33 @@
   parent = parent or self
   print('|cFF88FF00DynamicReanchor()')
   for anchorPoint, cluster in pairs(parent.FrameClusters) do
-    local lastFrame
-    for index, frame in ipairs(cluster) do
-      print('  |cFF00FF00'..index, frame:GetName(), frame:IsVisible(), (lastFrame and ('|cFFFFFF00'..lastFrame:GetName()..'|r') or '|cFF00FFFFUIParent'))
-      if frame:IsVisible() then
+    if anchorPoint ~= LE_FREE_FRAMES_GROUP then
+      local lastFrame
+      for index, frame in ipairs(cluster) do
+        print('  |cFF00FF00'..index, frame:GetName(), frame:IsVisible(), (lastFrame and ('|cFFFFFF00'..lastFrame:GetName()..'|r') or '|cFF00FFFFUIParent'))
+        if frame:IsVisible() then
 
-        if frame.anchorFrame then
-          print(frame.anchorPoint)
-          frame:SetPoint(frame.anchorPoint, frame.anchorFrame, frame.anchorFrom, frame.anchorX, frame.anchorY)
-          print(frame:GetTop(), frame:GetRight())
-        else
-          anchorPoint = frame.anchorPoint or anchorPoint
-          frame:ClearAllPoints()
-          if lastFrame then
-            frame:SetPoint(anchorPoint, lastFrame, ANCHOR_OFFSET_POINT[anchorPoint], 0, 0)
+          if frame.anchorFrame then
+            print(frame.anchorPoint)
+            frame:SetPoint(frame.anchorPoint, frame.anchorFrame, frame.anchorFrom, frame.anchorX, frame.anchorY)
+            print(frame:GetTop(), frame:GetRight())
           else
-            frame:SetPoint(anchorPoint, UIParent, anchorPoint, frame.anchorX, frame.anchorY)
+            anchorPoint = frame.anchorPoint or anchorPoint
+            frame:ClearAllPoints()
+            if lastFrame then
+              frame:SetPoint(anchorPoint, lastFrame, ANCHOR_OFFSET_POINT[anchorPoint], 0, 0)
+            else
+              frame:SetPoint(anchorPoint, UIParent, anchorPoint, frame.anchorX, frame.anchorY)
+            end
+            print(frame:GetTop(), frame:GetRight())
+            lastFrame = frame
           end
-          print(frame:GetTop(), frame:GetRight())
-          lastFrame = frame
+
         end
 
       end
+    end
 
-    end
   end
 end