diff Overlay.lua @ 77:da8ba8783924

- added revision updater to each code file - Changed button/bar class mechanic to metatable-based - Changed buttons to live within a sub-frame, to play nicely between show-empty-buttons and hidestates - bar frame is now available only via accessor - Changed some semantics with AddButton/PlaceButton - Cleaned up action buttons options, fixed hide-when-empty option - moved show-action-ID-label as a button method - converted drag overlay from nested-frame to :Raise() - fixed ReAction:SetConfigMode() to not call event when mode doesn't change - Fixed ordering for dynamic state tab (always last)
author Flick <flickerstreak@gmail.com>
date Mon, 23 Jun 2008 22:27:50 +0000
parents 06cd74bdc7da
children 42ec2938d65a
line wrap: on
line diff
--- a/Overlay.lua	Thu Jun 19 17:48:57 2008 +0000
+++ b/Overlay.lua	Mon Jun 23 22:27:50 2008 +0000
@@ -7,6 +7,8 @@
 local format = string.format
 local GameTooltip = GameTooltip
 
+ReAction:UpdateRevision("$Revision: 103 $")
+
 -- Looking for a lightweight AceConfig3-struct-compatible 
 -- replacement for Dewdrop (e.g. forthcoming AceConfigDropdown-3.0?).
 -- Considering Blizzard's EasyMenu/UIDropDownMenu, but that's
@@ -55,7 +57,7 @@
 -- Bar config overlay
 --
 -- localize some of these for small OnUpdate performance boost
-local Bar           = ReAction.Bar.prototype
+local Bar           = ReAction.Bar
 local GetSize       = Bar.GetSize
 local GetButtonSize = Bar.GetButtonSize
 local GetButtonGrid = Bar.GetButtonGrid
@@ -413,15 +415,7 @@
   f:SetResizable(true)
   f:SetClampedToScreen(true)
 
-  -- buttons on the bar should be direct children of the bar frame.
-  -- The control elements need to float on top of this, which we could
-  -- do with SetFrameLevel() or Raise(), but it's more reliable to do it
-  -- via frame nesting, hence good old foo's appearance here.
-  local foo = CreateFrame("Frame",nil,f)
-  foo:SetAllPoints()
-  foo:SetClampedToScreen(true)
-
-  local control = CreateFrame("Button", nil, foo)
+  local control = CreateFrame("Button", nil, f)
   control:EnableMouse(true)
   control:SetToplevel(true)
   control:SetPoint("TOPLEFT", -4, 4)
@@ -433,6 +427,7 @@
     edgeSize = 16,
     insets = { left = 0, right = 0, top = 0, bottom = 0 },
   })
+  control:SetClampedToScreen(true)
 
   -- textures
   local bgTex = control:CreateTexture(nil,"BACKGROUND")
@@ -509,11 +504,11 @@
     edge:Show()
   end
 
-  -- corner drag handles, again nested in an anonymous frame so that they are on top
-  local foo2 = CreateFrame("Frame",nil,control)
-  foo2:SetAllPoints(true)
+  -- corner drag handles, nested in an anonymous frame so that they are on top
+  local foo = CreateFrame("Frame",nil,control)
+  foo:SetAllPoints(true)
   for _, point in pairs({"BOTTOMLEFT","TOPLEFT","BOTTOMRIGHT","TOPRIGHT"}) do
-    local corner = CreateFrame("Frame",nil,foo2)
+    local corner = CreateFrame("Frame",nil,foo)
     corner:EnableMouse(true)
     corner:SetWidth(12)
     corner:SetHeight(12)
@@ -669,6 +664,7 @@
       self.controlFrame = CreateControls(self)
     end
     self.controlFrame:Show()
+    self.controlFrame:Raise()
   elseif self.controlFrame then
     CloseMenu(self.controlFrame)
     self.controlFrame:Hide()