# HG changeset patch # User contrebasse # Date 1305922471 -7200 # Node ID 060f5d0f7a35f8f2baf538309289edc549870128 # Parent 0fd1fd1ba2d9349d2a2acbbd5fd1dc0d72339c29 Manage correctly the Campfire button diff -r 0fd1fd1ba2d9 -r 060f5d0f7a35 CampFireButton.lua --- a/CampFireButton.lua Fri May 20 19:29:13 2011 +0200 +++ b/CampFireButton.lua Fri May 20 22:14:31 2011 +0200 @@ -34,14 +34,14 @@ -- Save info cookingName = GetSpellInfo(COOKING_ID) - + -- Show if needed A.ManageCampFireBtn() end -- Hide button function A.HideCampFireBtn() - btn:Hide() + if btn then btn:Hide() end end -- Show button if applicable diff -r 0fd1fd1ba2d9 -r 060f5d0f7a35 ReagentMaker.lua --- a/ReagentMaker.lua Fri May 20 19:29:13 2011 +0200 +++ b/ReagentMaker.lua Fri May 20 22:14:31 2011 +0200 @@ -56,10 +56,15 @@ end end A.EventsFrame:SetScript("OnEvent", function(self, event) - A.ManageCampFireBtn() if event == "TRADE_SKILL_UPDATE" then t_throttle = SCAN_DELAY self:SetScript("OnUpdate", throttleScan) + A.ManageCampFireBtn() + + elseif event == "PLAYER_REGEN_DISABLED" then + A.HideCampFireBtn() + elseif event == "PLAYER_REGEN_ENABLED" then + A.ManageCampFireBtn() elseif event == "TRADE_SKILL_SHOW" then A:Initialize() @@ -104,10 +109,10 @@ A.tooltipRecipe = CreateFrame("GameTooltip", "ReagentMaker_tooltipRecipe",UIParent, "GameTooltipTemplate") A.tooltipRecipe:SetFrameStrata("TOOLTIP") A.tooltipRecipe:Hide() - + -- Button for enchanting directy on a scroll A.LoadEnchantOnScroll() - + -- Button to cast a campfire A.InitialiseCampFireBtn() end -- function @@ -194,7 +199,7 @@ -- use the mean between min and max, but make at least one... local minMade, maxMade = GetTradeSkillNumMade(reagentIndex) numToMake = math.max(math.floor(2*numToMake/(maxMade+minMade)),1) - + -- Choose number or craft directly if chooseNumber then -- the dialog window is linked to the reagent button