public
Description: WoW Addon - Adds notes to item tooltips
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/engravings.git
Click here to lend your support to: engravings and make a donation at www.pledgie.com !
engravings / Engravings.lua
100644 24 lines (16 sloc) 0.659 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Engravings = {}
local sources = Engravings
local origs = {}
local R, G, B = 1, 136/255, 0
 
 
local function OnTooltipSetItem(frame, ...)
  local name, link = frame:GetItem()
  if link then
    local id = tonumber(link:match("item:(%d+):"))
    for title,data in pairs(sources) do if data[id] then frame:AddDoubleLine(type(title) == "string" and title or "", data[id], R, G, B, R, G, B) end end
  end
  if origs[frame] then return origs[frame](frame, ...) end
end
 
 
for _,frame in pairs{GameTooltip, ItemRefTooltip, ShoppingTooltip1, ShoppingTooltip2} do
  origs[frame] = frame:GetScript("OnTooltipSetItem")
  frame:SetScript("OnTooltipSetItem", OnTooltipSetItem)
end