WoWInterface SVN ItemLinkRecolor

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

MoP/ItemLinkRecolor.toc
1,8 → 1,8
## 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
MoP/ItemLinkRecolor.lua
1,5 → 1,11
--[[
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
169,7 → 175,7
--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",
}
--
 
221,9 → 227,6
--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
231,13 → 234,13
--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
 
311,27 → 314,6
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