/
## Interface: 40300 |
## Title: * |cFF33CC66Item Link Recolor|r |
## Author: |cff993366Silvanas |
## Version: 3.0.1 |
## Notes: |cff999999Adds more info in the item chatlinks |n|cffffffffVersion: (|cFF9900003|cFFFFFFFF.|cFF9900000|cFFFFFFFF.|cFF9900001|cFFFFFFFF)|n|cFFFFFFFFAuthor: |cFF993366Silvanas|r |
## Version: 3.0.2 |
## Notes: |cff999999Adds more info in the item chatlinks |n|cffffffffVersion: (|cFF9900003|cFFFFFFFF.|cFF9900000|cFFFFFFFF.|cFF9900002|cFFFFFFFF)|n|cFFFFFFFFAuthor: |cFF993366Silvanas|r |
## eMail: westhof99@zonnet.nl |
## URL: http://www.google.com |
## License: None |
--[[ |
Changelog: |
Version 3.0.2 |
Tested on MoP |
Make two hooks secure |
Removed itemlink show hook as it nolonger seems needed |
Removed /it command as it was non functioning leftover from debugging |
Version 3.0.1 |
Now the money colorling of ..K as 1000g should work |
TOC version updated to 4.3 |
--main global var |
ItemLinkRecolor = { |
["NAME"] = "|TInterface\\Icons\\Spell_unused:0|t |cFF33CC66Item Link Recolor|r", |
["VERSION"] = "(|cFF9900003|cFFFFFFFF.|cFF9900000|cFFFFFFFF.|cFF9900001|cFFFFFFFF)|r", |
["VERSION"] = "(|cFF9900003|cFFFFFFFF.|cFF9900000|cFFFFFFFF.|cFF9900002|cFFFFFFFF)|r", |
} |
-- |
--basic chatframe event hook |
ILR_ChatFrame_MessageEventHandler_Hook = ChatFrame_MessageEventHandler |
ChatFrame_MessageEventHandler = ItemLinkRecolor_ChatFrame_MessageEventHandler |
--basic chatframe hyper link hook |
ILR_ChatFrame_OnHyperlinkShow_Hook = ChatFrame_OnHyperlinkShow |
ChatFrame_OnHyperlinkShow = ItemLinkRecolor_ChatFrame_OnHyperlinkShow |
--hook event for mouse over hyperlinks |
local i,cframe |
--for each chat window |
for i=1,NUM_CHAT_WINDOWS do |
--get the chatframe |
cframe = getglobal("ChatFrame".. i) |
cframe = _G["ChatFrame".. i] |
--if the chat frame exists |
if cframe then |
--overwrite general xml chat hooks |
cframe:SetScript("OnHyperlinkEnter",function(self,var1,var2,...) ItemLinkRecolor_ChatFrame_OnHyperlinkEnter(self,var1,var2,...); end) |
cframe:SetScript("OnHyperlinkLeave",function(self,...) ItemLinkRecolor_ChatFrame_OnHyperlinkLeave(self,...); end) |
cframe:HookScript("OnHyperlinkEnter",ItemLinkRecolor_ChatFrame_OnHyperlinkEnter) |
cframe:HookScript("OnHyperlinkLeave",ItemLinkRecolor_ChatFrame_OnHyperlinkLeave) |
end |
end |
ILR_ChatFrame_MessageEventHandler_Hook(frame,event,msg,...) |
end |
--not realy hooked just called between the click and the normal function |
function ItemLinkRecolor_ChatFrame_OnHyperlinkShow(frame,link,text,button,...) |
--ILR format = |Hitem:itemlink|h ..bracket color ..[|r.. levelcolor ..(level)|r.. itemcolor .. text ..|r.. bracketcolor ..]|r|h |
--normal format = qaulitycolor .. |Hitem:itemlink|htext|h|r |
--first see if its an itemlinkfrom ILR |
if (string.sub(link,1,4) == "item") then |
--get the normal item link |
local itemlink |
--parse the normallink off the itemidlink |
x,itemlink = GetItemInfo(link) |
if itemlink then |
--give the normal style link |
text = itemlink |
end |
end |
--call the hook |
ILR_ChatFrame_OnHyperlinkShow_Hook(frame,link,text,button,...) |
end |
function ItemLinkRecolor_ChatFrame_OnHyperlinkEnter(self,link) |
--if we got mouseover hyperlinks enabled |
if ItemLinkRecolorSavedVars["MOUSEOVERLINK"] then |