Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-17-24, 10:55 AM   #1
A Flamescale Wyrmkin
Hubb777's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2024
Posts: 134
Tooltip when hovering over an item.

Lua Code:
  1. local addonName, addon = ...
  2. -- Define localization table for German language
  3. local L = {
  4.     [210714] = {
  5.         ["name"] = "Abgesplitterter tödlicher Saphir", -- Translate item name
  6.     },
  7. }
  9. -- Hooking into the default GameTooltip to add our custom text
  10. local function AddTooltipInfo(tooltip)
  11.     local _, itemLink = tooltip:GetItem()
  12.     if itemLink then
  13.         local itemId = tonumber(itemLink:match("item:(%d+)"))
  14.         if itemId then
  15.             -- Check if the item ID is in our localization table
  16.             local localizedItem = L[itemId]
  17.             if localizedItem then
  18.                 tooltip:AddLine(localizedItem["name"])
  19.             end
  20.         end
  21.     end
  22.     tooltip:Show()
  23. end
  25. -- Hooking the GameTooltip's SetHyperlink method to update our tooltip
  26. hooksecurefunc(GameTooltip, "SetHyperlink", AddTooltipInfo)

Hi all. I need your help again.

Description of the problem: There is an item in the bag "Chipped Deadly Sapphire" (ID 210714). It is necessary that when you hover the mouse over it or on the object itself, an inscription appears. Or the inscription appeared in the tooltip above the item.

As it is now: The tooltip appears only if the item is “Linked” into the chat.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Tooltip when hovering over an item.

Thread Tools
Display Modes

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