View Single Post
05-26-17, 01:08 AM   #14
Eommus
An Aku'mai Servant
Join Date: Apr 2017
Posts: 34
Originally Posted by Kanegasi View Post
frame names are global and someone else may have used "tooltip" as well.
Originally Posted by MunkDev View Post
it's always wise to scope and name your own code properly so it doesn't conflict with anything else.
Thanks, that's enough to know.

Originally Posted by Ketho View Post
Lua Code:
  1. function TradeSkillDetailsMixin:OnResultMouseEnter(resultButton)
  2.     if self.selectedRecipeID then
  3.         GameTooltip:SetOwner(resultButton, "ANCHOR_RIGHT");
  4.         GameTooltip:SetRecipeResultItem(self.selectedRecipeID);
  5.         CursorUpdate(resultButton);
  6.     end
  7.    
  8.     resultButton.UpdateTooltip = resultButton.UpdateTooltip or function(owner) self:OnResultMouseEnter(owner); end;
  9. end
I didn't quite understand what the above code does. If it is possible, could you explain what each line does? I like using code I understand, so that I can modify it when needed.

Originally Posted by Ketho View Post
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")
Thanks, changed the parent and removed the OnHide hook. Works fine.
  Reply With Quote