diff --git a/api/config.lua b/api/config.lua index ea8b1957..84fe423f 100644 --- a/api/config.lua +++ b/api/config.lua @@ -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") diff --git a/modules/chat.lua b/modules/chat.lua index fa660073..d4a9fe05 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -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) diff --git a/modules/gui.lua b/modules/gui.lua index 781a8f5f..4a836214 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -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")