mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-02 11:40:01 +00:00
chat: add option to disable whisper modification
This commit is contained in:
+10
-5
@@ -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)"
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user