chat: add option to disable whisper modification

This commit is contained in:
shagu
2017-01-06 01:01:20 +01:00
parent d7539e8f4e
commit 562bf1b809
3 changed files with 12 additions and 5 deletions
+10 -5
View File
@@ -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)"
+1
View File
@@ -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")
+1
View File
@@ -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")