diff modules/ReAction_Action/ReAction_Action.lua @ 50:c3c64e2def50

Assorted cleanup for hide/show grid, action ID labels, draggable resizing, etc
author Flick <flickerstreak@gmail.com>
date Tue, 22 Apr 2008 20:37:44 +0000
parents dcf8116560a1
children c9df7866ff31
line wrap: on
line diff
--- a/modules/ReAction_Action/ReAction_Action.lua	Mon Apr 14 23:03:19 2008 +0000
+++ b/modules/ReAction_Action/ReAction_Action.lua	Tue Apr 22 20:37:44 2008 +0000
@@ -130,29 +130,38 @@
         if b then
           if mode then
             ActionButton_ShowGrid(b.frame)
-            if not b.actionIDLabel then
-              local label = b:GetFrame():CreateFontString(nil,"OVERLAY","GameFontNormalLarge")
-              label:SetAllPoints()
-              label:SetJustifyH("CENTER")
-              label:SetShadowColor(0,0,0,1)
-              label:SetShadowOffset(2,-2)
-              label:SetText(tostring(b:GetActionID()))
-              b.actionIDLabel = label
-            end
-            b.actionIDLabel:Show()
+            self:showActionIDLabel(b)
           else
-            if b.actionIDLabel then
-              b.actionIDLabel:Hide()
-            end
             ActionButton_HideGrid(b.frame)
+            self:hideActionIDLabel(b)
           end
-
         end
       end
     end
   end
 end
 
+function module:showActionIDLabel(button)
+  if not button.actionIDLabel then
+    local label = button:GetFrame():CreateFontString(nil,"OVERLAY","GameFontNormalLarge")
+    label:SetAllPoints()
+    label:SetJustifyH("CENTER")
+    label:SetShadowColor(0,0,0,1)
+    label:SetShadowOffset(2,-2)
+    label:SetText(tostring(button:GetActionID()))
+    button.actionIDLabel = label
+  end
+  button.actionIDLabel:Show()
+end
+
+function module:hideActionIDLabel(button)
+  if button.actionIDLabel then
+    button.actionIDLabel:Hide()
+  end
+end
+
+
+
 -- use-count of action IDs
 local ActionIDList = setmetatable( {}, {
   __index = function(self, idx)
@@ -213,6 +222,11 @@
   if not module.db.profile.hideEmptyButtons then
     ActionButton_ShowGrid(self.frame)
   end
+
+  if ReAction.configMode then
+    ActionButton_ShowGrid(self.frame)
+    module:showActionIDLabel(self)
+  end
 end
 
 function Button:Destroy()