changeset 70:1b0d7bcd252e

- anchors code
author Nenue
date Mon, 22 Aug 2016 20:38:43 -0400
parents ebc18a7412a1
children 6f8661094643
files Modules/BuffFrame.lua
diffstat 1 files changed, 43 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Modules/BuffFrame.lua	Sun Aug 21 10:28:09 2016 -0400
+++ b/Modules/BuffFrame.lua	Mon Aug 22 20:38:43 2016 -0400
@@ -15,10 +15,10 @@
 local BUFF_PROGRESS_SIZE = 4
 local BUFF_PROGRESS_INSET = 1
 local BUFF_BUTTON_ZOOM = .15
-local BORDER_SIZE_L = 0
-local BORDER_SIZE_R = 0
-local BORDER_SIZE_U = 1
-local BORDER_SIZE_D = 7
+local BORDER_SIZE_L = 1
+local BORDER_SIZE_R = 1
+local BORDER_SIZE_U = 4
+local BORDER_SIZE_D = 1
 
 
 local plugin = CreateFrame('Frame', 'VeneerBuffFrame', UIParent)
@@ -242,11 +242,13 @@
       visibility[self] = isVisible
     end
     veneer:Hide()
+    veneer.count:Hide()
     underlay:Hide()
   end)
 
   hooksecurefunc(frame, 'Show', function(self)
     veneer:Show()
+    veneer.count:Show()
     veneer.border:Show()
     underlay:Show()
     local isVisible = self:IsVisible()
@@ -386,6 +388,43 @@
     TempEnchant1:SetPoint('TOPRIGHT', BuffButton1, 'TOPRIGHT', BuffButton1:GetWidth()+4, 0)
   end
 
+  local lastBuff, topBuff
+  for i = 1, BUFF_ACTUAL_DISPLAY do
+    local buff = _G['BuffButton'..i]
+    if buff then
+      if i == 1 then
+        buff:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -120, -6)
+        topBuff = buff
+      elseif mod(i,12) == 1 then
+        buff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -14)
+        topBuff = buff
+      else
+        buff:SetPoint('TOPRIGHT', lastBuff, 'TOPLEFT')
+      end
+      lastBuff = buff
+    end
+  end
+
+  for i = 1, DEBUFF_ACTUAL_DISPLAY do
+    local debuff = _G['DebuffButton'..i]
+    if debuff then
+      if i == 1 then
+        if topBuff then
+          debuff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -14)
+        else
+          debuff:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -120, -6)
+        end
+        topBuff = debuff
+      elseif mod(i, 12) == 1 then
+        debuff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -14)
+        topBuff = debuff
+      else
+        debuff:SetPoint('TOPRIGHT', lastBuff, 'TOPLEFT')
+      end
+      lastBuff = debuff
+    end
+  end
+
 end
 
 local AuraButton_UpdateDuration = function(frame, timeLeft)