diff --git a/modules/chat.lua b/modules/chat.lua index c26e7410..3fbff17a 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -535,9 +535,12 @@ pfUI:RegisterModule("chat", function () local cr, cg, cb, ca = pfUI.api.strsplit(",", pfUI_config.chat.global.whisper) cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) local wcol = string.format("%02x%02x%02x",cr * 255,cg * 255, cb * 255) - CHAT_WHISPER_GET = '|cff' .. wcol .. '[W]' .. default - CHAT_WHISPER_INFORM_GET = '[W]' .. default + if pfUI_config.chat.global.whispermod == "1" then + CHAT_WHISPER_GET = '|cff' .. wcol .. '[W]' .. default + CHAT_WHISPER_INFORM_GET = '[W]' .. default + end + CHAT_YELL_GET = '[Y]' .. default for i=1,NUM_CHAT_WINDOWS do @@ -559,9 +562,11 @@ pfUI:RegisterModule("chat", function () end text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2") - -- make incoming whispers lighter than outgoing - if string.find(text, '|cff'..wcol, 1) == 1 then - text = string.gsub(text, "|r", "|cff" .. wcol) + if pfUI_config.chat.global.whispermod == "1" then + -- patch incoming whisper string to match the colors + if string.find(text, '|cff'..wcol, 1) == 1 then + text = string.gsub(text, "|r", "|cff" .. wcol) + end end local pattern = "%]%s+(.*|Hplayer)" diff --git a/modules/config.lua b/modules/config.lua index c9749e4b..f009e07c 100644 --- a/modules/config.lua +++ b/modules/config.lua @@ -143,6 +143,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("chat", "right", "height", "180") pfUI:UpdateConfig("chat", "global", "custombg", "0") pfUI:UpdateConfig("chat", "global", "background", ".2,.2,.2,.5") + pfUI:UpdateConfig("chat", "global", "whispermod", "1") pfUI:UpdateConfig("chat", "global", "whisper", "1,.6,1,1") pfUI:UpdateConfig("chat", "global", "fadetime", "86400") diff --git a/modules/gui.lua b/modules/gui.lua index d43204c9..88d2adb8 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -987,6 +987,7 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.chat, "Right chat height:", pfUI_config.chat.right, "height") pfUI.gui:CreateConfig(pfUI.gui.chat, "Use custom background:", pfUI_config.chat.global, "custombg", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.chat, "Background color:", pfUI_config.chat.global, "background", "color") + pfUI.gui:CreateConfig(pfUI.gui.chat, "Change layout of incoming whispers:", pfUI_config.chat.global, "whispermod", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.chat, "Color of incoming whispers:", pfUI_config.chat.global, "whisper", "color") pfUI.gui:CreateConfig(pfUI.gui.chat, "Time in seconds until the chat gets faded:", pfUI_config.chat.global, "fadetime")