Commit 3ffc326d authored by Tukz's avatar Tukz
Browse files

Nickname color in chat.

parent f013f69e
......@@ -4,7 +4,7 @@
local T, C, L = select(2, ...):unpack()
-- TEMP for bg bugs
-- TEMP for bg popup taint bug
local Battleground = CreateFrame("Frame", nil, UIParent)
Battleground:SetFrameStrata("HIGH")
Battleground:Size(400, 60)
......@@ -60,4 +60,41 @@ local function OnEvent()
end
Battleground:RegisterEvent("UPDATE_BATTLEFIELD_STATUS")
Battleground:SetScript("OnEvent", OnEvent)
\ No newline at end of file
Battleground:SetScript("OnEvent", OnEvent)
-- Temp for nickname color in chat, because altering RAID_CLASS_COLOR taint.
function GetColoredName(event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)
local chatType = strsub(event, 10)
if (strsub(chatType, 1, 7) == "WHISPER") then
chatType = "WHISPER"
end
if (strsub(chatType, 1, 7) == "CHANNEL") then
chatType = "CHANNEL"..arg8
end
local info = ChatTypeInfo[chatType]
if (chatType == "GUILD") then
arg2 = Ambiguate(arg2, "guild")
else
arg2 = Ambiguate(arg2, "none")
end
if (arg12 and info and Chat_ShouldColorChatByClass(info)) then
local localizedClass, englishClass, localizedRace, englishRace, sex = GetPlayerInfoByGUID(arg12)
if (englishClass) then
local R, G, B = unpack(T.Colors.class[englishClass])
if (not R) then
return arg2
end
return string.format("\124cff%.2x%.2x%.2x", R * 255, G * 255, B * 255)..arg2.."\124r"
end
end
return arg2
end
\ No newline at end of file
......@@ -452,12 +452,6 @@ function TukuiChat:SwitchSpokenDialect(button)
end
function TukuiChat:AddMessage(text, ...)
local Faction = UnitFactionGroup("player")
if Faction == "Horde" then
text = text:gsub("|cfff48cba", T.RGBToHex(unpack(T.Colors.class["SHAMAN"])))
end
text = text:gsub("|h%[(%d+)%. .-%]|h", "|h[%1]|h")
return self.DefaultAddMessage(self, text, ...)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment