chat: add option to disable playerlinks

This commit is contained in:
shagu
2018-09-13 08:19:07 +02:00
parent cdd2857c30
commit 8f8773ace4
3 changed files with 15 additions and 11 deletions
+1
View File
@@ -682,6 +682,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("chat", "text", "tintunknown", "1")
pfUI:UpdateConfig("chat", "text", "unknowncolor", ".7,.7,.7,1")
pfUI:UpdateConfig("chat", "text", "channelnumonly", "1")
pfUI:UpdateConfig("chat", "text", "playerlinks", "1")
pfUI:UpdateConfig("chat", "text", "detecturl", "1")
pfUI:UpdateConfig("chat", "text", "classcolor", "1")
pfUI:UpdateConfig("chat", "left", "width", "380")
+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)
+1
View File
@@ -1191,6 +1191,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, this, T["Timestamp Brackets"], C.chat.text, "timebracket", nil, nil, nil, nil, "STRING")
CreateConfig(nil, this, T["Timestamp Color"], C.chat.text, "timecolor", "color")
CreateConfig(nil, this, T["Hide Channel Names"], C.chat.text, "channelnumonly", "checkbox")
CreateConfig(nil, this, T["Generate Playerlinks"], C.chat.text, "playerlinks", "checkbox")
CreateConfig(nil, this, T["Enable URL Detection"], C.chat.text, "detecturl", "checkbox")
CreateConfig(nil, this, T["Enable Class Colors"], C.chat.text, "classcolor", "checkbox")
CreateConfig(nil, this, T["Colorize Unknown Classes"], C.chat.text, "tintunknown", "checkbox")