I try to create an
addon like bankitems. Adding tooltips for itemcounts in your bank/bag.
When I mouse over a recipe with embedded item the additional lines are added twice. The inner tooltip uses the itemid of the outer recipe. I'm not sure what I'm looking for ... unsure if I should
a) find the itemid of the embedded item and show the right itemcount
b) dont add the tooltip to the embedded item and only show the recipe itemcount.
But so far I've not found a way to do it. Any ideas or documentation where I can read up?
Lua Code:
local function GameTooltip_OnTooltipSetItem(tooltip)
local _, link = tooltip:GetItem()
if(not link) then
return
end
local id = addon['getItemId'](link)
if(not id) then
local tip
id,tip = checkID(id)
if(id and tip) then
tooltip = tip
end
end
if(id)then
-- tooltip:AddLine()
for name,b in pairs(search(id)) do
local dname, drealm = strsplit(" - ",name)
local input,sum = output(b)
if(sum>0) then
tooltip:AddLine(format("%s %s: %s [ %s ] ",addon:getIcon(id),dname,sum,addon['colorize'](table.concat(input,', '),"ffffff")))
end
input = nil
end
specialoutput(tooltip, id)
if(db['showID']) then
tooltip:AddLine(format("Id: %i",id))
end
end
tooltip:Show()
end
GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem)