diff classes/ActionButton.lua @ 234:0e20f65375d5

Reworked button creation to not use goofy event driven semantics.
author Flick
date Tue, 22 Mar 2011 17:05:51 -0700
parents 158c9299185b
children 704f4a05a1d7
line wrap: on
line diff
--- a/classes/ActionButton.lua	Tue Mar 22 11:48:09 2011 -0700
+++ b/classes/ActionButton.lua	Tue Mar 22 17:05:51 2011 -0700
@@ -192,15 +192,14 @@
 ReAction.Button.Action = Action
 ReAction:RegisterBarType(Action, true)
 
-function Action:New( idx, barConfig, bar, idHint )
+function Action:New( config, bar, idx, idHint )
   local name = format("ReAction_%s_Action_%d",bar:GetName(),idx)
  
-  self = Super.New(self, name, barConfig.buttons[idx], bar, idx, "SecureActionButtonTemplate, ActionButtonTemplate" )
-  self.barConfig = barConfig
+  self = Super.New(self, name, config, bar, idx, "SecureActionButtonTemplate, ActionButtonTemplate" )
+  self.barConfig = bar:GetConfig()
 
   local f = self:GetFrame()
   local barFrame = bar:GetFrame()
-  local config = self:GetConfig()
 
   self.rangeTimer = TOOLTIP_UPDATE_TIME
 
@@ -629,8 +628,11 @@
   end
 end
 
-function Action.SetupBarHeader( bar, config ) -- call this as a static method
+function Action:SetupBar( bar )
+  Super.SetupBar(self,bar)
+
   local f = bar:GetFrame()
+  local config = bar:GetConfig()
   f:SetAttribute("mindcontrol",config.mindcontrol)
   f:SetAttribute("vehicle",config.vehicle)
   f:Execute(