chat: option to disable color of unknown classes

This commit is contained in:
shagu
2018-09-07 23:03:27 +02:00
parent 454f1806a0
commit ca02c51b92
3 changed files with 8 additions and 3 deletions
+1
View File
@@ -657,6 +657,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", "tintunknown", "1")
pfUI:UpdateConfig("chat", "text", "unknowncolor", ".7,.7,.7,1")
pfUI:UpdateConfig("chat", "text", "channelnumonly", "1")
pfUI:UpdateConfig("chat", "text", "detecturl", "1")
+6 -3
View File
@@ -845,7 +845,7 @@ pfUI:RegisterModule("chat", function ()
for name in string.gfind(text, "|Hplayer:(.-)|h") do
local color = unknowncolorhex
local match = false
-- search player in database
if pfUI_playerDB[name] and pfUI_playerDB[name].class ~= nil then
local class = pfUI_playerDB[name].class
@@ -854,11 +854,14 @@ pfUI:RegisterModule("chat", function ()
RAID_CLASS_COLORS[class].r * 255,
RAID_CLASS_COLORS[class].g * 255,
RAID_CLASS_COLORS[class].b * 255)
match = true
end
end
text = string.gsub(text, "|Hplayer:"..name.."|h%["..name.."%]|h(.-:-)",
left.."|cff"..color.."|Hplayer:"..name.."|h" .. name .. "|h|r"..right.."%1")
if C.chat.text.tintunknown == "1" or match then
text = string.gsub(text, "|Hplayer:"..name.."|h%["..name.."%]|h(.-:-)",
left.."|cff"..color.."|Hplayer:"..name.."|h" .. name .. "|h|r"..right.."%1")
end
end
end
+1
View File
@@ -1159,6 +1159,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, this, T["Hide Channel Names"], C.chat.text, "channelnumonly", "checkbox")
CreateConfig(nil, this, T["Enable URL Detection"], C.chat.text, "detecturl", "checkbox")
CreateConfig(nil, this, T["Enable Class Colors"], C.chat.text, "classcolor", "checkbox")
CreateConfig(nil, this, T["Colorize Unknown Classes"], C.chat.text, "tintunknown", "checkbox")
CreateConfig(nil, this, T["Unknown Class Color"], C.chat.text, "unknowncolor", "color")
CreateConfig(nil, this, T["Left Chat Width"], C.chat.left, "width")
CreateConfig(nil, this, T["Left Chat Height"], C.chat.left, "height")