diff modules/ReAction_PetAction/ReAction_PetAction.lua @ 90:7cabc8ac6c16

Updates for wow 3.0 - TOC update - updated changed APIs/frame names - rewrote state code per new SecureHandlers API - cleaned up Bar, ActionButton code - removed AceLibrary/Dewdrop, menu from bar right-click - fixed various small bugs Updated WowAce external locations Updated README.html
author Flick <flickerstreak@gmail.com>
date Wed, 15 Oct 2008 16:29:41 +0000
parents fc83b3f5b322
children c2504a8b996c
line wrap: on
line diff
--- a/modules/ReAction_PetAction/ReAction_PetAction.lua	Mon Oct 13 23:32:33 2008 +0000
+++ b/modules/ReAction_PetAction/ReAction_PetAction.lua	Wed Oct 15 16:29:41 2008 +0000
@@ -61,7 +61,9 @@
   if bar.config.type == moduleID then
     -- auto show/hide when pet exists
     bar:GetFrame():SetAttribute("unit","pet")
-    RegisterUnitWatch(bar:GetFrame())
+    if not ReAction:GetConfigMode() then
+      RegisterUnitWatch(bar:GetFrame())
+    end
     self:OnRefreshBar(event, bar, name)
   end
 end
@@ -192,11 +194,16 @@
 })
 
 local frameRecycler = {}
+local meta = { __index = Button }
 
 function Button:New( bar, idx, config )
   -- create new self
-  self = setmetatable( { }, { __index = Button } )
-  self.bar, self.idx, self.config = bar, idx, config
+  self = setmetatable( 
+    { 
+      bar = bar,
+      idx = idx,
+      config = config,
+    }, meta )
 
   local name = config.name or ("ReAction_%s_%s_%d"):format(bar:GetName(),moduleID,idx)
   config.name = name
@@ -205,10 +212,9 @@
   
   -- have to recycle frames with the same name:
   -- otherwise you either get references to old textures because named CreateFrame()
-  -- doesn't overwrite existing globals (below)
-  -- or, if you set them to nil in the global table, you get taint because of the
-  -- crappy PetActionBar code.
-  local parent = bar:GetButtonFrame()
+  -- doesn't overwrite existing globals. Can't set them to nil in the global table, 
+  -- as it causes taint.
+  local parent = bar:GetFrame()
   local f = frameRecycler[name]
   if f then
     f:SetParent(parent)
@@ -222,7 +228,7 @@
   self.frame = f
   self.icon = _G[("%sIcon"):format(name)]
   self.acTex = _G[("%sAutoCastable"):format(name)]
-  self.acModel = _G[("%sAutoCast"):format(name)]
+  self.acModel = _G[("%sShine"):format(name)]
   self.cooldown = _G[("%sCooldown"):format(name)]
   self.hotkey = _G[("%sHotKey"):format(name)]
 
@@ -249,7 +255,7 @@
       end
     end)
 
-  self.binder = ReAction:AttachBinder(self)
+  --self.binder = ReAction:AttachBinder(self)
 
   self:Refresh()
   return self