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 !
tekkub (author)
Sat Aug 30 17:05:58 -0700 2008
commit  55b21852ee7b28167c2474810c65c070cfdd6a3d
tree    3ba942177a323c32e17efa87dac3780de7586e69
parent  bae03134cbe10c98be3caa81fef1733a7e45dff5
engravings / CustomEngravings.lua
100644 28 lines (22 sloc) 0.792 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
25
26
27
28
local db
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(frame, event, addon)
  if addon ~= "Engravings" then return end
 
  EngravingsDB = EngravingsDB or {}
  if EngravingsDB.profiles then EngravingsDB = EngravingsDB.profiles.global or {} end
  db = EngravingsDB
 
  Engravings["Engraving:"] = db
 
  f:UnregisterEvent("ADDON_LOADED")
  f:SetScript("OnEvent", nil)
end)
 
SLASH_ENGRAVINGS1 = "/engrave"
SlashCmdList.ENGRAVINGS = function(msg)
  local itemid, note = msg:match("^%s*|c.+|Hitem:(%d+):.+|h|r(.*)$")
  if not itemid then ChatFrame1:AddMessage("Usage: '/engrave [item link] note' - Engraves an item, blank note erases saved engraving")
  else
    note = string.trim(note)
    if note == "" then note = nil end
    db[tonumber(itemid)] = note
  end
end