About
Have you ever been distracted by your family while in a raid, then look back only to notice you've got Burning adrenaline and you are 2 seconds from wiping the whole raid? Have you been known to pull aggro off the tanks but not noticed until it's too late? Are you a tank who loses aggro? Do you not keep a close eye on your hearth or mana bar? If the answer to any of these is "yes" you surely need this addon. If the answer is no, you'll probly want it anyway.
What Emergency does is it gives you a list of things you'd like to be notified about, and flashes the screen in the color and type of flash that you choose for that important event. The above is just an example of some of the things it can notify you of. The list includes (all of which are optional) Low health, Low Mana, Losing aggro, Gaining aggro, You are burning (Burning adrenaline for Vael fight in BWL), Tranquilizing Shot for hunters on tranq duty, and pet has low health. You can enable or disable any of these, set the flash type (smooth, quick, flash, double), choose a custom color, and even a class-based defaults reset button to restore the original color, flash type and on/off state of all the events.
This mod employs dynamic event registration so it only watches events that you have enabled. This improves speed and reduces processing time for your UI. It also uses a robust queueing system with true animation.
Things for the future
I'll be adding in any user submitted event warnings and flash types. I'm open to suggestions so keep them coming. Thanks!
Flash Types
If you'd like to add a flash type, you'll need to know what I'm expecting. The various flashes are all based off of graphs (math equations.) Yep, this is where geometry and trigonometry come into your gaming life. The flash sees the line of a graph which exists in 0-1x and 0-1y. Y is the intensity of the flash and X is time passed. There are some are real simple ones like (y = -4 * x + 2 ) but some are more complicated like ( y = ( 0.5 * sin( 4 * pi * x - pi/2 ) ) + 0.5 ). If you are still interested in making one, please post it on the Orgrimmar.org forum or send it to me directly via email or PM.
Enabling your addon to generate Emergency flashes
Emergency has been written to be very friendly to queueing flashes. It's easy to add the flashing functionality into your addon too. There are 2 ways to Queue a flash for immediate display. One excepts a single object/table for more complex uses, while the other accepts simple strings. The 2 functions are Emergency_QueueFlash() and Emergency_QueueFlashFromString(). Accessing it via the string method is more forgiving and allows for most of the variables to be optional, making it probly the preferred way unless you are sure you want the EventObject way.
The functions intake 4 elements.
color -- Required: this is a small table with the red green and blue colors of the flash.
text -- Optional: The text you want to display in the middle of the screen.
type -- Optional: An integer indicating which flash you want. There are 1-5 as of this writing.
increment -- Optional: a number indicating how often in seconds the flash should update. Standard is 0.05, and unless you really want to change it, don't bother sending this value.
Here's some examples:
Emergency_QueueFlashFromString({r=0.5,g=1,b=1},"OMG A FLASH",2); -- This flash has almost everything specified, including a double flash and some text to display
Emergency_QueueFlashFromString({r=0.5,g=1,b=1}) -- This flash has a color but no text and the default flash type
Emergency_QueueFlash(EventObject) -- An event object consists of basically all the above elements, but they are sent as keys with values == whatever you want them to be. This function is more strict than the FromString function. All but the the increment are required.
When adding this function to your addon, please include it inside an "if" statement which checks to see if Emergency is actually loaded, unless it's a required dependancy in your TOC file. This will help prevent errors in case a user has disabled Emergency. Thanks