-
-
Notifications
You must be signed in to change notification settings - Fork 319
aura_env
nullKomplex edited this page Sep 30, 2019
·
12 revisions
aura_env
is a built-in local table at the top of each aura declaration. Variables declared in this table will have their scope limited to the containing aura. aura_env
can be accessed as global variables by functions within the current aura while remaining invisible to other auras.
To use aura_env
for your own variables, simply assign it as a prefix to your variable name. An example of its use would be:
--Custom Trigger Function
function()
-- Select the icon for either Moonkin form or Bear form.
aura_env.icon = select(2, WA_GetUnitBuff("player", "Moonkin Form")) or select(2, WA_GetUnitBuff("player", "Bear form"))
return aura_env.icon -- If an icon is present, this will return true.
end
-- Custom Icon Function
function()
-- Return the Icon we found. (Moonkin, Bear, or None)
return aura_env.icon
end
aura_env
currently has 5 values id
, cloneId
, region
, state
and states
.
-
id
simply outputs the name of the current aura. -
cloneId
is used with "Trigger State Updater" where it will return unique ID for each state. -
region
is the region of the aura. See here for more. -
state
is a table that stores information about the current state. The current state is the one that the aura is pulling dynamic information from. All of the values you can use for text replacements in the tooltip for text in the display tab are state values.-
%percenthealth
would beaura_env.state.percenthealth
-
-
states
is a table that stores the state information of every trigger, similar tostate
-
aura_env.states[2]
would access the state of the second trigger.
-
The values contained within the state depend on the type of aura being used (icon, progress bar, texture, etc.) Some potentially useful ones are:
aura_env.state.stacks
aura_env.state.duration
aura_env.state.expirationTime
aura_env.state.icon
aura_env.state.spellId
Be especially careful to catch nil
values from these variables before using them in things like custom animation functions.
- 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