Quantcast
WoWInterface - View Single Post - Is there a way to order event callbacks (by plugin)?
View Single Post
12-30-14, 06:25 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
1) Chat filters are processed in the order registered. There's no way to tell WoW to load your addon before some other addon (without modifying the other addon to list your addon as an optional dependency). If you really need to run your filters first (though I'm not really sure why; if you have some other addon blocking messages, it's still going to block messages if its filter gets run after yours) then depending on the addon it may be possible to remove and re-add its filter (thus moving it to the end of the list) or you can take the nuclear approach and remove all other filters for the given event(s) and re-add them.

2) Returning true means the filter has blocked the message, and prevents any further processing for that message, including other filters.

3) Returning false or nil means the filter did not block the message, and filters continue to be run in order.

3b) If a filter returns any arguments in addition to false/nil it must return all of the event arguments that were passed into it (note that the first two arguments it receives are not event arguments and should not be returned) but it may modify them, and they replace the original event arguments. Additional filters are called with these new event arguments.

You can see how the default UI does this in FrameXML/ChatFrame.lua.

Finally, I assume you're talking about Trade Chat Cleaner since you just submitted some patches for it (thanks BTW) but I'm not really sure why you'd need it to run before other addons. Like I said, if you have some other addon blocking stuff, that stuff will still be blocked no matter what order the filters are run in.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote