Mercurial > wow > reagentmaker
changeset 30:fd76c8951b7d
Save the spell link to be able to display the tooltip even when the recipe is hidden
author | contrebasse |
---|---|
date | Thu, 28 Apr 2011 20:31:25 +0200 |
parents | 15123d11fc64 |
children | 22fa64c9b2de |
files | ReagentMaker.lua data.lua |
diffstat | 2 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ReagentMaker.lua Thu Apr 28 19:46:52 2011 +0200 +++ b/ReagentMaker.lua Thu Apr 28 20:31:25 2011 +0200 @@ -204,13 +204,19 @@ -- Tooltips local link - if A.data[reagentID].spell then + if A.data[reagentID].spellLink then + link = A.data[reagentID].spellLink + elseif A.data[reagentID].spellID then link = GetSpellLink(A.data[reagentID].spellID) else + A.DEBUG("Recipe link not found for "..reagentID) + return + --[[ local reagentIndex = A.findSkillIndex(reagentID) if reagentIndex then link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID)) end + --]] end if link then
--- a/data.lua Thu Apr 28 19:46:52 2011 +0200 +++ b/data.lua Thu Apr 28 20:31:25 2011 +0200 @@ -279,10 +279,13 @@ -- number of reagent created by the recipe local minMade, maxMade = GetTradeSkillNumMade(i) + + -- recipe link (for tooltips) + local recipeLink = GetTradeSkillRecipeLink(i) -- error checking - if not reagentID or not reagentCount or not skillName or not itemID or not minMade or not maxMade then - print("Erreur de scan :",itemID,skillName,reagentID,reagentCount,minMade,maxMade) + if not reagentID or not reagentCount or not skillName or not itemID or not minMade or not maxMade or not recipeLink then + print("Erreur de scan :",itemID,skillName,reagentID,reagentCount,minMade,maxMade,recipeLink) end -- if -- remove unneeded minMade/maxMade @@ -294,6 +297,7 @@ end -- if -- skillName or...??? + -- There's still a problem when multiple recipes craft the same item if not A.data[itemID] then A.data[itemID] = {} end -- if @@ -305,6 +309,7 @@ end -- if end -- for if newSpell then + A.data[itemID].spellLink = recipeLink tinsert(A.data[itemID],{reagentID,reagentCount,minMade,maxMade,spellName=skillName}) end -- if end -- if