From b059a8680ca7c3e62a2fa520a76b5ac4ee1c0270 Mon Sep 17 00:00:00 2001 From: Christopher Tse Date: Sat, 30 May 2020 17:30:03 +1000 Subject: [PATCH] Fixed bug where the chat bubble message could not be mapped to a user because TotalRP3 changed the chat message (which doesn't get propogated to the chat bubble) --- BlizzChatIntegration.lua | 15 ++++++++------- TotalRP3.lua | 7 ++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/BlizzChatIntegration.lua b/BlizzChatIntegration.lua index 65bc0e7..154e76e 100644 --- a/BlizzChatIntegration.lua +++ b/BlizzChatIntegration.lua @@ -170,12 +170,13 @@ local function onChatMessage(_, event, message, sender, ...) return false, message, sender, ... end -local function resetChatHandler(self) - for _, channel in pairs(MANAGED_CHANNELS) do - ChatFrame_RemoveMessageEventFilter(channel, onChatMessage) - ChatFrame_AddMessageEventFilter(channel, onChatMessage); - end -end +--This will probably not be needed, but just in case... +--local function resetChatHandler(self) +-- for _, channel in pairs(MANAGED_CHANNELS) do +-- ChatFrame_RemoveMessageEventFilter(channel, onChatMessage) +-- ChatFrame_AddMessageEventFilter(channel, onChatMessage); +-- end +--end local function onStart(self) for _, channel in pairs(MANAGED_CHANNELS) do @@ -186,4 +187,4 @@ end Import.modules.BlizzChatIntegration = {}; Import.modules.BlizzChatIntegration.name = "BlizzChatIntegration"; Import.modules.BlizzChatIntegration.OnStart = onStart; -Import.modules.BlizzChatIntegration.ResetChatHandler = resetChatHandler \ No newline at end of file +--Import.modules.BlizzChatIntegration.ResetChatHandler = resetChatHandler \ No newline at end of file diff --git a/TotalRP3.lua b/TotalRP3.lua index 464d85e..186e4dd 100644 --- a/TotalRP3.lua +++ b/TotalRP3.lua @@ -77,7 +77,12 @@ function TotalRP3_onStart(self) ChatFrame_RemoveMessageEventFilter(channel, makeBubbleForNPCChat); ChatFrame_AddMessageEventFilter(channel, makeBubbleForNPCChat); end - Import.modules.BlizzChatIntegration:ResetChatHandler() + --Don't re-order BCI's chat handler. It's important for BCI's handler to go first before + -- TotalRP3 as TotalRP3's modifications to the chat message (e.g. colouring) + -- are not propagated to the chat bubble, and BlizzChatIntegration.lua relies on + -- using the message as a common key between the chat message and chat bubble + -- to map the chat bubble to a character name. + --Import.modules.BlizzChatIntegration:ResetChatHandler() end end -- 1.7.9.5