diff --git a/README.md b/README.md index a04b9af1..4b7dc386 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,6 @@ Please make sure to have the latest version installed and check for conflicting **Can I use Clique with pfUI?** A pfUI compatible version of Clique can be found [Here](https://gitlab.com/shagu/Clique/releases). If you want to keep your current version of Clique, you'll have to apply this [Patch](https://gitlab.com/shagu/Clique/commit/a5ee56c3f803afbdda07bae9cd330e0d4a75d75a). -**Why do I see player names instead of linked items?** -That's a conflict with prat. You'll have to either disable Prat's class colors by typing `/prat playernames toggle` or disable pfUI's class colors within the settings dialog. The entry can found in the chat section: `Enable Class Colors`. - **How do I show the Damage- and Threatmeter Dock?** If you enabled the "dock"-feature for your external (third-party) meters such as DPSMate or KTM, then you'll be able to toggle between them and the Right Chat by clicking on the ">" symbol on the bottom-right panel. diff --git a/api/config.lua b/api/config.lua index 21ef931c..1bdecf32 100644 --- a/api/config.lua +++ b/api/config.lua @@ -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", "unknowncolor", ".7,.7,.7,1") pfUI:UpdateConfig("chat", "text", "channelnumonly", "1") pfUI:UpdateConfig("chat", "text", "detecturl", "1") pfUI:UpdateConfig("chat", "text", "classcolor", "1") diff --git a/modules/chat.lua b/modules/chat.lua index a9c62237..3a3b39c3 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -814,6 +814,9 @@ pfUI:RegisterModule("chat", function () local r,g,b,a = strsplit(",", C.chat.text.timecolor) local timecolorhex = string.format("%02x%02x%02x%02x", a*255, r*255, g*255, b*255) + local r,g,b,a = strsplit(",", C.chat.text.unknowncolor) + local unknowncolorhex = string.format("%02x%02x%02x%02x", a*255, r*255, g*255, b*255) + for i=1,NUM_CHAT_WINDOWS do if not _G["ChatFrame"..i].HookAddMessage then _G["ChatFrame"..i].HookAddMessage = _G["ChatFrame"..i].AddMessage @@ -839,18 +842,26 @@ pfUI:RegisterModule("chat", function () -- display class colors if already indexed if C.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 Class ~= UNKNOWN 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" + + for name in string.gfind(text, "|Hplayer:(.-)|h") do + local cname + + -- search player in database + if pfUI_playerDB[name] and pfUI_playerDB[name].class ~= nil then + local class = pfUI_playerDB[name].class + if class ~= UNKNOWN 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) + cname = left .. "|cff" .. color .. name .. "|r" .. right + end + else + cname = left .. "|c" .. unknowncolorhex .. name .. "|r" .. right end + + text = string.gsub(text, "|Hplayer:"..name.."|h%["..name.."%]|h(.-:-)", "|Hplayer:"..name.."|h"..cname.."|h%1") end - text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "|r" .. left .. "|Hplayer:%1|h" .. Name .. "|h|r" .. right .. "%2") end -- reduce channel name to number diff --git a/modules/gui.lua b/modules/gui.lua index bae98394..515410d4 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -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["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") CreateConfig(nil, this, T["Right Chat Width"], C.chat.right, "width") diff --git a/pfUI.toc b/pfUI.toc index 187757fa..2998febb 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -2,7 +2,7 @@ ## Title: |cff33ffccpf|cffffffffUI ## Author: Shagu ## Notes: A complete user interface replacement. -## Version: 3.14.1 +## Version: 3.14.2 ## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB