Skip to content

Aura Activation and Deactivation

Leon Solis III edited this page Dec 27, 2016 · 4 revisions

WeakAura displays activate (display) and deactivate (hide) on screen based on the status of the Triggers of the display.

Single Trigger Displays

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!)


Multi-Trigger Displays

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.

Any

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.

All

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.

Custom

The Custom option allows the aura 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: A boolean array containing the same number of booleans as their are triggers on the aura. values[1] would correspond to Trigger 1, values[2] to Trigger 2, etc.

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 display 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