View Single Post
09-22-05, 08:46 AM   #1
gix
A Deviate Faerie Dragon
 
gix's Avatar
Join Date: Sep 2005
Posts: 13
Problem: ChatFrame_OnEvent is called twice

Hello,

one of my addons hooks ChatFrame_OnEvent to catch specific messages (at the moment CHAT_MSG_RAID and CHAT_MSG_WHISPER), do things depending on the sent message and then to eventually call the original ChatFrame_OnEvent (so I can prevent printing the message to the ChatFrame).

Now with 1700 I noticed that my addon's processing is done twice and first I thought it may be an hooking error so I call it twice myself.

Then I disabled all addons in the AddOns.txt file, added Blizzard's FrameXML\ChatFrame.xml and FrameXML\ChatFrame.lua to my Interface directory and changed ChatFrame_OnEvent to something like this:

Code:
function ChatFrame_OnEvent(event)
    ChatFrame1:AddMessage("ChatFrame_OnEvent called: ".. event .." ".. arg1)
(Note: I used arg1 to 10 but that does not matter here.)

Then I restarted the game and whenever I type something, for example "/say test", I get this:

Code:
ChatFrame_OnEvent called: CHAT_MSG_SAY test
[Me] says: test
ChatFrame_OnEvent called: CHAT_MSG_SAY test
The arguments 1 to 10 seem to be the same both of the time.

Do I miss something signifcant here and it is my own fault or did Blizzard change something? My addon addressed at the beginning worked fine before 1700.

Regards
  Reply With Quote