View Single Post
11-30-22, 08:54 AM   #14
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Is there still a way to do a pre-hook on what used to be OnTooltipSetItem?

I want to operate on the tooltip of items before any other addons added their lines to it.
Before 10.0.2 I executed this code (a few seconds after login, to make sure that all other addons have already registered):

Lua Code:
  1. local OtherScripts = GameTooltip:GetScript("OnTooltipSetItem")
  2. local function RunOtherScripts(self, ...)
  3.   if OtherScripts then
  4.     return OtherScripts(self, ...)
  5.   else
  6.     return
  7.   end
  8. end
  9.  
  10. GameTooltip:SetScript("OnTooltipSetItem", function(self, ...)
  11.  
  12.   -- Do my stuff with the untouched tooltip.
  13.  
  14.   -- Then let the other addons append their lines.
  15.   return RunOtherScripts(self, ...)
  16. end)


How could the same effect be achieved with the new TooltipDataProcessor?
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote