diff UI.lua @ 93:f6fae1a4c66c v2.2.95-rc1

- revision and simplification dock layout - fixed character-specific addon choices getting erroneously toggled The XML template was missing header information; that has been filled in, and it should be easier to catch problems arising from that area.
author Nenue
date Wed, 19 Oct 2016 16:47:38 -0400
parents b3ed963f482d
children 33bc8baba858
line wrap: on
line diff
--- a/UI.lua	Wed Aug 10 07:12:43 2016 -0400
+++ b/UI.lua	Wed Oct 19 16:47:38 2016 -0400
@@ -108,10 +108,10 @@
 
 
   -- update dock buttons
-  local beacon = D.dock.buttons[c.index]
+  local beacon = c.dockButton
   beacon.selected = true
   beacon.newMessage = nil
-  D.UpdateBeacon(beacon)
+  beacon:Update()
 
   for _, part in pairs(c.border) do
     part:SetColorTexture(unpack(db.frontborder))
@@ -126,11 +126,11 @@
       bc.dropmenu.icon:SetVertexColor(unpack(db.backheader))
       bc.title:SetTextColor(unpack(db.backborder))
 
-      local beacon = D.dock.buttons[bc.index]
+      local beacon = D.dock.usedButtons[bc.index]
       beacon.raised = nil
       beacon.showName = nil
       beacon.selected = nil
-      D.UpdateBeacon(beacon)
+      beacon:Update()
 
       for _, part in pairs(bc.border) do
         part:SetColorTexture(unpack(db.backborder))
@@ -236,12 +236,8 @@
     f:SetScript('OnEvent', Console_OnMovementChanged)
   end
 
-  D.dock.buttons[i] = CreateFrame('Button', 'Channel'..i..'Beacon', UIParent, 'DevianBeacon')
-  D.dock.buttons[i].icon:SetVertexColor(math.random(),math.random(),math.random())
-  D.dock.buttons[i].console = f
-  D.dock.buttons[i].index = i
-  D.dock.buttons[i].caption.name:SetText(vars.signature)
-  D.dock.buttons[i]:Show()
+  f.dockButton = D:GetDockButton(f)
+
 
   if vars.minimized then
     f:Minimize()