-
-
Notifications
You must be signed in to change notification settings - Fork 319
Aura Activation and Deactivation
WeakAura displays activate (show) and deactivate (hide) on screen based on the status of the Triggers of the display.
Single trigger displays are the easiest, as there is only one trigger The overall display activates and deactivates as the single trigger activates and deactivates (Remember that for a Custom Trigger, the trigger function must return false, followed by the untrigger function returning true!)
For multi-trigger displays, there are three options for how to treat the separate triggers: Any, All, and Custom. In all three cases, the triggers are re-evaluated anytime one of the triggers activates or deactivates, to re-check the status of whether the display should be hidden or shown.
The Any option will show the display if one or more of the triggers is in an active state. If multiple triggers are active, and one deactivates, the display will remain showing so long as the other triggers stay active. Once all triggers have moved to an inactive state, the display is hidden.
The All option will show the display only if EVERY trigger on the display is in an active state. As soon as a single trigger deactivates, the display is hidden until they are all active again.
The Custom option allows the author to provide a Lua function that will be executed to determine whether or not the display should be shown. The Lua function is called every time a trigger activates or deactivates. WeakAuras will pass an array of boolean values to the function, representing the current state of the triggers and the function should return true
if the display should be shown and false
if the display should be hidden.
Custom trigger logic function arguments:
-
arg1 - values: An array containing the same number of booleans as there are triggers in the Aura.
values[1]
would correspond to Trigger 1,values[2]
to Trigger 2, and so on.
Custom trigger logic function return:
- return1 - showDisplay: A boolean true or false representing whether the display should be shown or hidden, respectively.
Example - this example function would show the Aura if trigger 1 is active and at least one of triggers 2 or 3 is also active.
function(trigger)
return trigger[1] and (trigger[2] or trigger[3]);
end
- Home
- API Documentation
- Getting Involved
- Setting up a Lua Dev Environment
- Deprecations
- Useful Snippets
- Aura Types
- Trigger Types
- Triggers and Untriggers
- Aura Activation
- Dynamic Information
- Text Replacements