diff modules/ReAction_Action/ReAction_Action.lua @ 108:b2fb8f7dc780

ButtonFacade support
author Flick <flickerstreak@gmail.com>
date Wed, 07 Jan 2009 00:57:02 +0000
parents ad49739d110d
children
line wrap: on
line diff
--- a/modules/ReAction_Action/ReAction_Action.lua	Tue Jan 06 21:10:03 2009 +0000
+++ b/modules/ReAction_Action/ReAction_Action.lua	Wed Jan 07 00:57:02 2009 +0000
@@ -20,6 +20,7 @@
 
 -- libraries
 local KB = LibStub("LibKeyBound-1.0")
+local LBF -- initialized later
 
 -- module declaration
 local moduleID = "Action"
@@ -50,6 +51,8 @@
   ReAction.RegisterCallback(self, "OnRenameBar")
   ReAction.RegisterCallback(self, "OnConfigModeChanged")
 
+  LBF = LibStub("LibButtonFacade",true)
+
   KB.RegisterCallback(self, "LIBKEYBOUND_ENABLED")
   KB.RegisterCallback(self, "LIBKEYBOUND_DISABLED")
   KB.RegisterCallback(self, "LIBKEYBOUND_MODE_COLOR_CHANGED","LIBKEYBOUND_ENABLED")
@@ -962,7 +965,7 @@
       ]])
 
     self.frame = f
-    self.normalTexture = getglobal(format("%sNormalTexture",f:GetName()))
+
 
     -- initialize the hide state
     f:SetAttribute("showgrid",0)
@@ -977,6 +980,13 @@
     -- attach the keybinder
     KBAttach(self)
 
+    -- attach to skinner
+    bar:SkinButton(self,
+      {
+        HotKey = self.hotkey,
+      }
+    )
+
     self:Refresh()
     return self
   end
@@ -1103,7 +1113,11 @@
       f:SetAttribute("showgrid",count)
 
       if count >= 1 and not f:GetAttribute("statehidden") then
-        self.normalTexture:SetVertexColor(1.0, 1.0, 1.0, 0.5);
+        if LBF then
+          LBF:SetNormalVertexColor(self.frame, 1.0, 1.0, 1.0, 0.5)
+        else
+          self.frame:GetNormalTexture():SetVertexColor(1.0, 1.0, 1.0, 0.5);
+        end
         f:Show()
       elseif count < 1 and not HasAction(self:GetActionID()) then
         f:Hide()