Hi,
I am building a simple addon that will display the tooltip of the output item of a recipe to the right top of the profession window, when that recipe is clicked in the profession window recipes list. The tooltip will be sticky, I mean when the recipe is clicked, the tooltip will be displayed and stay there until the profession window is closed. Please see below image:
http://imgur.com/xY8t682
I was able to get the output item ID on recipe click, display the (empty) frame on recipe click (I tested it with a simple button frame) and hide the frame with "profession window close" using the following:
Lua Code:
local f = CreateFrame("?", "tooltip", UIParent, "?")
f:Hide()
hooksecurefunc(TradeSkillFrame.RecipeList, "OnRecipeButtonClicked", function(self, ...)
local itemId = C_TradeSkillUI.GetRecipeItemLink(TradeSkillFrame.RecipeList.selectedRecipeID):match("item:(%d+):")
if itemId ~= nil then -- some enchanting recipes show recipe spell instead of item
f:Show()
end
end)
TradeSkillFrame:HookScript("OnHide", function()
f:Hide()
end)
I just need to actually create the frame to display the item tooltip as described above. I don't know what frame type and template I should use (tooltip? simpleHTML?), also I don't know how to populate the frame via item info.
Thanks for any tips and ideas.