View Single Post
02-23-15, 12:03 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
Originally Posted by Banknorris View Post
This script eliminate the use of #showtooltip:
Lua Code:
  1. hooksecurefunc(GameTooltip,"SetAction",function(self,action)
  2.     local action_type,macro_id = GetActionInfo(action)
  3.     if action_type=="macro" then
  4.         local _,_,spell_id = GetMacroSpell(macro_id)
  5.         if spell_id then
  6.             GameTooltip:SetSpellByID(spell_id)
  7.         else
  8.             local _,link = GetMacroItem(macro_id)
  9.             if link then
  10.                 local item_id = tonumber(link:match("item:(%d+)"))
  11.                 GameTooltip:SetItemByID(item_id)
  12.             end
  13.         end
  14.         GameTooltip:Show()
  15.     end
  16. end)
You should use GameTooltip:SetHyperlink(Link) instead of GameTooltip:SetItemByID(ID). This will include suffixes and the associated stats for items that have them.
__________________
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