# HG changeset patch # User contrebasse # Date 1302285488 -7200 # Node ID f7b23db7bcc6cabc7d4125f2acc50cd35746fff8 # Parent c37c2a46723c8e31b487a93b5ec2d9979332a968 Correct tooltips for external tradeskills like milling diff -r c37c2a46723c -r f7b23db7bcc6 ReagentMaker.lua --- a/ReagentMaker.lua Fri Apr 08 19:24:22 2011 +0200 +++ b/ReagentMaker.lua Fri Apr 08 19:58:08 2011 +0200 @@ -208,14 +208,15 @@ end -- Tooltips - local reagentIndex = A.findSkillIndex(reagentID) - if reagentIndex then + local link + if A.data[reagentID].spell then + link = GetSpellLink(A.data[reagentID].spellID) + else + link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID)) + end + if link then A.tooltipRecipe:SetOwner(btn) - if A.data[reagentID].spell then - A.tooltipRecipe:SetHyperlink(GetSpellLink(A.data[reagentID].spellID)) - else - A.tooltipRecipe:SetHyperlink(GetTradeSkillRecipeLink(reagentIndex)) - end + A.tooltipRecipe:SetHyperlink(link) A.tooltipRecipe:Show() A.tooltipRecipe:ClearAllPoints() --A.tooltipRecipe:SetPoint("TOPLEFT",btn,"TOPRIGHT") diff -r c37c2a46723c -r f7b23db7bcc6 SecureMenu.lua --- a/SecureMenu.lua Fri Apr 08 19:24:22 2011 +0200 +++ b/SecureMenu.lua Fri Apr 08 19:58:08 2011 +0200 @@ -10,12 +10,15 @@ tinsert(UISpecialFrames,"ReagentMaker_ExternalFrame") -- make it closable with escape MenuFrame:SetScript("OnEvent",function(self,event,...) - if event == "TRADE_SKILL_CLOSE" or event == "PLAYER_REGEN_DISABLED" then + if event == "TRADE_SKILL_UPDATE" then + MenuFrame.updateCounts() + elseif event == "TRADE_SKILL_CLOSE" or event == "PLAYER_REGEN_DISABLED" then MenuFrame:Hide() end end) MenuFrame:RegisterEvent("TRADE_SKILL_CLOSE") MenuFrame:RegisterEvent("PLAYER_REGEN_ENABLED") +MenuFrame:RegisterEvent("TRADE_SKILL_UPDATE") A.MenuFrame = MenuFrame -- Background adaptable vertically @@ -153,7 +156,7 @@ action(itemID,reagentIndex,IsShiftKeyDown()) end -local function updateCounts() +function MenuFrame.updateCounts() local anyMakable for i=1,numActiveEntries do btn = menuEntries[i] @@ -285,7 +288,7 @@ MenuFrame:ClearAllPoints() MenuFrame:SetPoint("TOPLEFT",TradeSkillFrame,"TOPRIGHT",-2,14) - updateCounts() + MenuFrame.updateCounts() MenuFrame:Show() end