Mercurial > wow > reaction
changeset 162:fc08372f0c7a
- Fixed icon behavior with buttonfacade
- Fixed bad usage of IsAttackAction() API (and various others) by trimming event list
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Fri, 21 Aug 2009 23:50:17 +0000 |
parents | d0a41fc7b0d7 |
children | ab5c37989986 |
files | classes/MultiCastButton.lua modules/Totem.lua |
diffstat | 2 files changed, 26 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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()