It's undocumented but you can just use
GameTooltip.SetRecipeResultItem, instead of getting the Item Id for in
GameTooltip.SetItemByID
Lua Code:
function TradeSkillDetailsMixin:OnResultMouseEnter(resultButton)
if self.selectedRecipeID then
GameTooltip:SetOwner(resultButton, "ANCHOR_RIGHT");
GameTooltip:SetRecipeResultItem(self.selectedRecipeID);
CursorUpdate(resultButton);
end
resultButton.UpdateTooltip = resultButton.UpdateTooltip or function(owner) self:OnResultMouseEnter(owner); end;
end
This can be shortened to this
Lua Code:
TradeSkillFrame:HookScript("OnHide", function()
f:Hide()
end)
Lua Code:
TradeSkillFrame:HookScript("OnHide", f.Hide)
Haven't tested your addon, but is the OnHide hook actually needed if you can just parent your tooltip to the TradeSkillFrame?
Code:
local f = CreateFrame("GameTooltip", "ProfessionItemtooltip", TradeSkillFrame, "GameTooltipTemplate")