View Single Post
04-15-13, 12:27 PM   #37
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by SDPhantom View Post
You should stick with events that are related to the data you're using. If you're using map data, you should trigger from WORLD_MAP_UPDATE or another related event (there's probably a PvP-related update event more specific to base capping) instead of using chat events. Using the wrong events is likely to cause problems for your code at random since the of events firing and data updates won't always be the same. The entire reason for some events is relevant data is guaranteed to have been updated by that time.

For reference, the code that handles the entire Battleground UI (status at the top of the screen and the scoreboard) is WorldStateFrame.lua.
I mainly use "WORLD_MAP_UPDATE" with IDs (There is no any other event to check capping), since i don't want to translate the ".CHAT_MSG_" events to 12 different laguages.
But sometimes you have to use the chat events, since there is no other way to trigger then event, unless you want to reverse engineer thousad of lines of blizzard code, like when someone drops the flag in WSG or TP.

Last edited by Resike : 04-15-13 at 12:32 PM.
  Reply With Quote