chat: add option to disable player class color

This commit is contained in:
shagu
2017-02-02 19:42:12 +01:00
parent 7912090ac3
commit bbdeeb5217
3 changed files with 15 additions and 10 deletions
+13 -10
View File
@@ -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
+1
View File
@@ -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")
+1
View File
@@ -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")