diff classes/BagButton.lua @ 151:57568d3ff3e6

fixed bags not showing when initially placed
author Flick <flickerstreak@gmail.com>
date Fri, 08 May 2009 00:35:14 +0000
parents 86564b5cbbff
children 6d7ef2a3f828
line wrap: on
line diff
--- a/classes/BagButton.lua	Fri May 08 00:25:43 2009 +0000
+++ b/classes/BagButton.lua	Fri May 08 00:35:14 2009 +0000
@@ -168,7 +168,7 @@
   f:SetCheckedTexture("Interface\\Buttons\\CheckButtonHilight")
 
   f:RegisterEvent("CURSOR_UPDATE")
-  f:RegisterEvent("UNIT_INVENTORY_CHANGED")
+  f:RegisterEvent("BAG_UPDATE")
   f:RegisterEvent("BAG_CLOSED")
   f:SetScript("OnDragStart", function(frame, ...) self:OnDragStart(...) end)
   f:RegisterForDrag("LeftButton")
@@ -234,8 +234,8 @@
   self:Update()
 end
 
-function Bag:UNIT_INVENTORY_CHANGED(unit)
-  if unit == "player" then
+function Bag:BAG_UPDATE(bag)
+  if bag == self:GetBagID() then
     self:Update()
   end
 end