social-colors: use correct chat hook for module

This commit is contained in:
shagu
2021-08-24 17:44:51 +02:00
parent a2b6b01d4c
commit d1ab3b7488
+3 -3
View File
@@ -17,8 +17,8 @@ local module = ShaguTweaks:register({
module.enable = function(self)
do -- add class colors to chat
for i=1,NUM_CHAT_WINDOWS do
if not _G["ChatFrame"..i].HookAddMessage then
_G["ChatFrame"..i].HookAddMessage = _G["ChatFrame"..i].AddMessage
if not _G["ChatFrame"..i].HookAddMessageColor then
_G["ChatFrame"..i].HookAddMessageColor = _G["ChatFrame"..i].AddMessage
_G["ChatFrame"..i].AddMessage = function(frame, text, a1, a2, a3, a4, a5)
for name in gfind(text, "|Hplayer:(.-)|h") do
local real, _ = strsplit(":", name)
@@ -33,7 +33,7 @@ module.enable = function(self)
"|r["..color.."|Hplayer:"..name.."|h" .. color .. real .. "|h|r".."]|r".."%1")
end
_G["ChatFrame"..i].HookAddMessage(frame, text, a1, a2, a3, a4, a5)
_G["ChatFrame"..i].HookAddMessageColor(frame, text, a1, a2, a3, a4, a5)
end
end
end