-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcopy.lua
33 lines (28 loc) · 815 Bytes
/
copy.lua
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
29
30
31
32
33
local _SetItemRef = SetItemRef
local borderManipulation = function(...)
for l = 1, select("#", ...) do
local obj = select(l, ...)
if(obj:GetObjectType() == "FontString" and obj:IsMouseOver()) then
return obj:GetText()
end
end
end
SetItemRef = function(link, text, button, ...)
if(link:sub(1, 5) ~= "oChat") then return _SetItemRef(link, text, button, ...) end
local frame = GetMouseFocus():GetParent()
local text = borderManipulation(frame:GetRegions())
if(text) then
text = text:gsub("|c%x%x%x%x%x%x%x%x(.-)|r", "%1")
text = text:gsub("|H.-|h(.-)|h", "%1")
local eb
if(GetCVar("chatStyle") == 'classic') then
eb = LAST_ACTIVE_CHAT_EDIT_BOX
else
eb = _G['ChatFrame' .. frame:GetID() .. 'EditBox']
end
eb:Insert(text)
eb:Show()
eb:HighlightText()
eb:SetFocus()
end
end