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