Thread Tools Display Modes
08-09-10, 10:40 AM   #1
krissie182
A Defias Bandit
Join Date: Aug 2010
Posts: 2
Help calling game tooltips

So I'm working on my first addon and I'm working with ace3 and such. I'm working on a frame with certain icons in it representing various in game items and when I mouse over them I would like for them to display the wow tooltip for that particular item. So far I've got the tooltip to show up when I mouse over and fade out when I'm not but once it's hidden it will not reappear until I mouse over an npc or another character. Any ideas on how I might fix this little issue. (Tiger Lily was my little test icon)

Code:
local function DrawGroup1(container)
  local LilyIcon = AceGUI:Create("Icon")
  LilyIcon:SetText("Tiger Lily")
  LilyIcon:SetImage("interface\\icons\\inv_misc_herb_tigerlily")
  LilyIcon:SetImageSize(30,30)
  container:AddChild(LilyIcon)
  LilyIcon:SetCallback("OnEnter", function(widget) GameTooltip:SetHyperlink("\\124cffffffff\\124Hitem:36904:0:0:0:0:0:0:0:0\\124h[Tiger Lily]\\124h\\124r")end)
  LilyIcon:SetCallback("OnLeave", function(widget) GameTooltip:FadeOut() end)
I may be doing this completely wrong as it was just a trial and error kind of thing.
  Reply With Quote
08-09-10, 11:03 AM   #2
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Try
Code:
  LilyIcon:SetCallback("OnEnter", function(widget) GameTooltip:SetHyperlink("\\124cffffffff\\124Hitem:36904:0:0:0:0:0:0:0:0\\124h[Tiger Lily]\\124h\\124r") GameTooltip:Show() end)
  Reply With Quote
08-09-10, 11:48 AM   #3
krissie182
A Defias Bandit
Join Date: Aug 2010
Posts: 2
For some reason after adding that, the tooltip wouldn't show at all. Even after removing the added code the tooltip still isn't working. Tooltips are getting very frustrating -_-
  Reply With Quote
08-09-10, 02:14 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by mrruben5 View Post
Try
Code:
  LilyIcon:SetCallback("OnEnter", function(widget) GameTooltip:SetHyperlink("\\124cffffffff\\124Hitem:36904:0:0:0:0:0:0:0:0\\124h[Tiger Lily]\\124h\\124r") GameTooltip:Show() end)
Originally Posted by krissie182 View Post
For some reason after adding that, the tooltip wouldn't show at all. Even after removing the added code the tooltip still isn't working. Tooltips are getting very frustrating -_-
The code is escaping the backslashes and not the decimal code for the pipe character. Also, the pipe character doesn't need to be encoded with the decimal code when not entered through /run.

Try this instead.
lua Code:
  1. LilyIcon:SetCallback("OnEnter", function(widget)
  2.     GameTooltip:SetHyperlink("|cffffffff|Hitem:36904:0:0:0:0:0:0:0:0|h[Tiger Lily]|h|r");
  3.     GameTooltip:Show();
  4. end);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help calling game tooltips


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off