View Single Post
05-24-17, 09:59 AM   #1
Eommus
An Aku'mai Servant
Join Date: Apr 2017
Posts: 34
Displaying item tooltip to the right of profession window.

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:
  1. local f = CreateFrame("?", "tooltip", UIParent, "?")
  2. f:Hide()
  3.  
  4. hooksecurefunc(TradeSkillFrame.RecipeList, "OnRecipeButtonClicked", function(self, ...)
  5.     local itemId = C_TradeSkillUI.GetRecipeItemLink(TradeSkillFrame.RecipeList.selectedRecipeID):match("item:(%d+):")
  6.     if itemId ~= nil then -- some enchanting recipes show recipe spell instead of item
  7.         f:Show()
  8.     end
  9. end)
  10.  
  11. TradeSkillFrame:HookScript("OnHide", function()
  12.     f:Hide()
  13. 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.
  Reply With Quote