mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +00:00
chat: add option to disable player class color
This commit is contained in:
+13
-10
@@ -594,18 +594,21 @@ pfUI:RegisterModule("chat", function ()
|
||||
end
|
||||
getglobal("ChatFrame"..i).AddMessage = function (frame, text, ...)
|
||||
if text then
|
||||
local Name = string.gsub(text, ".*|Hplayer:(.-)|h.*", "%1")
|
||||
if pfUI_playerDB[Name] and pfUI_playerDB[Name].class ~= nil then
|
||||
local Class = pfUI_playerDB[Name].class
|
||||
if RAID_CLASS_COLORS[Class] ~= nil then
|
||||
local Color = string.format("%02x%02x%02x",
|
||||
RAID_CLASS_COLORS[Class].r * 255,
|
||||
RAID_CLASS_COLORS[Class].g * 255,
|
||||
RAID_CLASS_COLORS[Class].b * 255)
|
||||
Name = "|cff" .. Color .. Name .. "|r"
|
||||
|
||||
if pfUI_config.chat.text.classcolor == "1" then
|
||||
local Name = string.gsub(text, ".*|Hplayer:(.-)|h.*", "%1")
|
||||
if pfUI_playerDB[Name] and pfUI_playerDB[Name].class ~= nil then
|
||||
local Class = pfUI_playerDB[Name].class
|
||||
if RAID_CLASS_COLORS[Class] ~= nil then
|
||||
local Color = string.format("%02x%02x%02x",
|
||||
RAID_CLASS_COLORS[Class].r * 255,
|
||||
RAID_CLASS_COLORS[Class].g * 255,
|
||||
RAID_CLASS_COLORS[Class].b * 255)
|
||||
Name = "|cff" .. Color .. Name .. "|r"
|
||||
end
|
||||
end
|
||||
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
|
||||
end
|
||||
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
|
||||
|
||||
if pfUI_config.chat.global.whispermod == "1" then
|
||||
-- patch incoming whisper string to match the colors
|
||||
|
||||
@@ -143,6 +143,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("chat", "text", "timeformat", "%H:%M:%S")
|
||||
pfUI:UpdateConfig("chat", "text", "timebracket", "[]")
|
||||
pfUI:UpdateConfig("chat", "text", "timecolor", ".8,.8,.8,1")
|
||||
pfUI:UpdateConfig("chat", "text", "classcolor", "1")
|
||||
pfUI:UpdateConfig("chat", "left", "width", "380")
|
||||
pfUI:UpdateConfig("chat", "left", "height", "180")
|
||||
pfUI:UpdateConfig("chat", "right", "enable", "0")
|
||||
|
||||
@@ -987,6 +987,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Timestamp format:", pfUI_config.chat.text, "timeformat")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Timestamp brackets:", pfUI_config.chat.text, "timebracket")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Timestamp color:", pfUI_config.chat.text, "timecolor", "color")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Use class colors for known players:", pfUI_config.chat.text, "classcolor", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Left chat width:", pfUI_config.chat.left, "width")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Left chat height:", pfUI_config.chat.left, "height")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Right chat width:", pfUI_config.chat.right, "width")
|
||||
|
||||
Reference in New Issue
Block a user