Commit 5c52769a authored by Tukz's avatar Tukz
Browse files

Move GetColoredName from Temp to ChatFrame file.

parent d31b450b
......@@ -706,3 +706,42 @@ function TukuiChat:AddHooks()
hooksecurefunc("FCF_SavePositionAndDimensions", TukuiChat.SaveChatFramePositionAndDimensions)
hooksecurefunc("FCFTab_UpdateAlpha", TukuiChat.NoMouseAlpha)
end
function TukuiChat:OverwriteFunctions()
-- Nickname color in chat, because altering RAID_CLASS_COLOR taint, so we overwrite GetColoredName() and use our own table.
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
end
\ No newline at end of file
......@@ -14,6 +14,7 @@ function TukuiChat:Enable()
self:CreateCopyButtons()
self:MoveAudioButtons()
self:AddHooks()
self:OverwriteFunctions()
for i = 1, 10 do
local ChatFrame = _G["ChatFrame"..i]
......
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