# HG changeset patch # User Flick # Date 1250898617 0 # Node ID fc08372f0c7a20e571b44c3442a365534ab1b8ad # Parent d0a41fc7b0d79d19d7d6862ea9ff8a662968f444 - Fixed icon behavior with buttonfacade - Fixed bad usage of IsAttackAction() API (and various others) by trimming event list diff -r d0a41fc7b0d7 -r fc08372f0c7a classes/MultiCastButton.lua --- a/classes/MultiCastButton.lua Fri Aug 21 04:15:09 2009 +0000 +++ b/classes/MultiCastButton.lua Fri Aug 21 23:50:17 2009 +0000 @@ -238,26 +238,11 @@ local EMPTY_SLOT_TCOORDS = { 66/128, 96/128, 3/256, 33/256 } local eventList = { - -- TODO - "PLAYER_REGEN_ENABLED", - "PLAYER_ENTERING_WORLD", - "ACTIONBAR_PAGE_CHANGED", "ACTIONBAR_SLOT_CHANGED", - "UPDATE_BINDINGS", "ACTIONBAR_UPDATE_STATE", "ACTIONBAR_UPDATE_USABLE", "ACTIONBAR_UPDATE_COOLDOWN", - "UPDATE_INVENTORY_ALERTS", - "PLAYER_TARGET_CHANGED", - "TRADE_SKILL_SHOW", - "TRADE_SKILL_CLOSE", - "PLAYER_ENTER_COMBAT", - "PLAYER_LEAVE_COMBAT", - "START_AUTOREPEAT_SPELL", - "STOP_AUTOREPEAT_SPELL", - "UNIT_ENTERED_VEHICLE", - "UNIT_EXITED_VEHICLE", - "COMPANION_UPDATE", + "UPDATE_BINDINGS", "UPDATE_MULTI_CAST_ACTIONBAR", } @@ -327,6 +312,16 @@ f:RegisterEvent(evt) end + -- Set up a proxy for the icon texture for use with ButtonFacade + self.frames.icon.SetTexCoordRaw = self.frames.icon.SetTexCoord + self.frames.icon.SetTexCoord = function( tx, ... ) + if self:GetIconTexture() == TOTEM_TEXTURE then + tx:SetTexCoordRaw(unpack(EMPTY_SLOT_TCOORDS)) + else + tx:SetTexCoordRaw(...) + end + end + -- attach to skinner bar:SkinButton(self) diff -r d0a41fc7b0d7 -r fc08372f0c7a modules/Totem.lua --- a/modules/Totem.lua Fri Aug 21 04:15:09 2009 +0000 +++ b/modules/Totem.lua Fri Aug 21 23:50:17 2009 +0000 @@ -38,7 +38,7 @@ ReAction.RegisterCallback(self, "OnEraseBar") ReAction.RegisterCallback(self, "OnRenameBar") - -- TODO: register for learning new spells + self:RegisterEvent("UPDATE_MULTI_CAST_ACTIONBAR","PLAYER_ENTERING_WORLD") end function module:OnEnable() @@ -131,6 +131,20 @@ end end +function module:UPDATE_MULTI_CAST_ACTIONBAR() + if not InCombatLockdown() then + for bar in pairs(self.buttons) do + self:OnRefreshBar("OnRefreshBar", bar, bar:GetName()) + end + end +end + +function module:PLAYER_ENTERING_WORLD() + for bar in pairs(self.buttons) do + self:OnRefreshBar("OnRefreshBar", bar, bar:GetName()) + end +end + ---- options ---- function module:GetOptions()