chat: add option to disable playerlinks

This commit is contained in:
shagu
2018-09-14 20:42:33 +02:00
parent cdd2857c30
commit 8f8773ace4
3 changed files with 15 additions and 11 deletions
+13 -11
View File
@@ -894,19 +894,21 @@ pfUI:RegisterModule("chat", function ()
end
-- create playerlinks on shift-click
local pfHookSetItemRef = SetItemRef
_G.SetItemRef = function(link, text, button)
if ( strsub(link, 1, 6) == "player" ) then
local name = strsub(link, 8)
if ( name and (strlen(name) > 0) ) then
name = gsub(name, "([^%s]*)%s+([^%s]*)%s+([^%s]*)", "%3");
name = gsub(name, "([^%s]*)%s+([^%s]*)", "%2");
if IsShiftKeyDown() and ChatFrameEditBox:IsVisible() then
ChatFrameEditBox:Insert("|cffffffff|Hplayer:"..name.."|h["..name.."]|h|r")
return
if C.chat.text.playerlinks == "1" then
local pfHookSetItemRef = SetItemRef
_G.SetItemRef = function(link, text, button)
if ( strsub(link, 1, 6) == "player" ) then
local name = strsub(link, 8)
if ( name and (strlen(name) > 0) ) then
name = gsub(name, "([^%s]*)%s+([^%s]*)%s+([^%s]*)", "%3");
name = gsub(name, "([^%s]*)%s+([^%s]*)", "%2");
if IsShiftKeyDown() and ChatFrameEditBox:IsVisible() then
ChatFrameEditBox:Insert("|cffffffff|Hplayer:"..name.."|h["..name.."]|h|r")
return
end
end
end
pfHookSetItemRef(link, text, button)
end
pfHookSetItemRef(link, text, button)
end
end)