WoW:UIHANDLER OnTooltipSetItem: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page UIHANDLER OnTooltipSetItem to UIHANDLER OnTooltipSetItem without leaving a redirect)
 
(No difference)

Latest revision as of 04:49, 15 August 2023

Widget handlers < OnTooltipSetItem

Invoked when an item's information is added to a tooltip.

Arguments[edit]

arg1
Tooltip - The Tooltip object to which an item was added.

Example[edit]

-- overload the base function for ItemRefTooltip with a custom routine
ItemRefTooltip:HookScript("OnTooltipSetItem", function(tooltip, ...)
  local name, link = tooltip:GetItem()
  local texture = select(10, GetItemInfo(link))
  --Add the name and path of the item's texture
  tooltip:AddLine(texture)
  --Show the texture graphic on the previous line
  tooltip:AddTexture(texture)
  --Repaint tooltip with newly added lines
  tooltip:Show()
end)


Details[edit]

This function was added in WoW 2.0.3
This gets called twice for Recipes which contain embedded items