Mercurial > wow > reagentmaker
diff CampFireButton.lua @ 111:af23986010ef v1.1beta0
Rewrote the main part to clarify things, should have removed some hidden nasty bugs.
author | contrebasse |
---|---|
date | Thu, 02 Jun 2011 23:07:23 +0200 |
parents | 08ede537787b |
children | c79ab5443ee5 |
line wrap: on
line diff
--- a/CampFireButton.lua Thu Jun 02 18:23:42 2011 +0200 +++ b/CampFireButton.lua Thu Jun 02 23:07:23 2011 +0200 @@ -7,6 +7,7 @@ local CooldownFrame_SetTimer = CooldownFrame_SetTimer local GetSpellCooldown = GetSpellCooldown +-- The cooldown info is not directly obtainable local function WaitCooldown(self) local start, duration, enable = GetSpellCooldown(CAMPFIRE_ID) if start>0 then @@ -19,7 +20,7 @@ function A.InitialiseCampFireBtn() if not GetTradeSkillLine() or InCombatLockdown() then return end - -- create the frame + -- Create the frame btn = CreateFrame("Button", nil, TradeSkillFrame, "SecureActionButtonTemplate") btn:SetNormalTexture(select(3,GetSpellInfo(CAMPFIRE_ID))) btn:SetHighlightTexture("Interface\\BUTTONS\\ButtonHilight-Square") @@ -67,6 +68,7 @@ -- Hide button function A.HideCampFireBtn() if btn then btn:Hide() end + btn:UnregisterAllEvents() end -- Show button if applicable