-
-
Notifications
You must be signed in to change notification settings - Fork 318
Dynamic Information
In WeakAuras, display types and trigger types are treated as separate entities that can be mixed and matched at will. However, triggers don't just determine whether a display is visible or not - they can also pass dynamic information to their display. The most common example of this kind of dynamic information is the duration of an aura. An Aura trigger will cause its display to appear on screen when it detects the presence of the specified aura, but it also sends information about the aura's duration to the display.
There are four distinct types of Dynamic Information in WeakAuras: Duration Info, Icon Info, Name Info, and Stack Info. Not all trigger types provide all four types of information, and not all display types use all four types of information. In fact, the only trigger type that provides all four types of dynamic info is the Aura type, and the only diaply type that shows all four types of dynamic info is the Progress Bar type.
If a display uses multiple triggers, it always gets its Dynamic Information from its Main Trigger.
Duration Info usually refers to two numbers: the Remaining Time and Maximum Duration of a trigger. Some display types, like Timers, only use the Remaining Time number. Others, like Progress Textures, use Remaining Time divided by Maximum Duration to determine a percentage of fullness. Progress Bars do both; they display the Remaining Time as a number, but the percentage of fullness also determines the fullness of the bar.
Some triggers provide Duration Info even though they do not actually have durations. For example, Health triggers will provide a unit's current health as the "Remaining Time" and that unit's maximum health as the "Maximum Duration". Power, Holy Power, Soul Shard, and Combo Point triggers behave similarly. Some triggers, like Item Count, only provide a number for "Remaining Time"; in such cases, the trigger's display will interpret the Duration Info as being always full, as if the maximum duration was infinite. This also occurs for Aura triggers based on auras that do not have a defined duration.
There are two 'modes' for custom duration in WeakAuras. Time Mode
and Value Based
function()
--Time Mode
--Documentaion for UnitBuff: http://wowprogramming.com/docs/api/UnitBuff
local duration = select(6, UnitBuff("player", "Rejuvenation"))
local expirationTime = select(7, UnitBuff("player", Rejuvenation"))
return duration, expirationTime
end
Where duration
is the total duration of the spell you want to track and expirationTime
is the time in the future when the buff will expire. expirationTime is equal to GetTime() + duration
at the time the buff was applied.
function()
--Value Based
local current = UnitHealth("player")
local max = UnitHealthMax("player")
return current, max, true
end
Value Based mode simply takes the current value and compares it against the max value to know how far to progress in the aura.
Icon Info provides an icon that should be associated with the trigger. Triggers that are based on auras, spells, or items almost always provide Icon Info. Displays that show Icon Info always give you the option between using the automatically provided icon, or choosing your own. When using such a display with a trigger that does not provide Icon Info, you will be required to pick your own icon.
Occasionally, the icon provided by a trigger will change while it is in use. For example, if you use an Aura trigger and specify multiple aura names, the trigger will provide Icon Info specifically for the aura it currently sees (if more than one of the specified auras are detected, the first name in the list will take precedence). Similarly, a Death Knight Rune trigger set to show Blood Rune #1 will provide a Blood Rune icon most of the time, but will provide a Death Rune icon if Blood Rune #1 becomes a Death Rune.
It should be noted that WeakAuras searches for auras by name only, WoW often defines more than one spell for any given name, and each spell can have a different icon. Although an aura will provide an icon when it is actually detected, WeakAuras will not always pick the correct icon for the specific aura you want to detect during configuration.
Name Info provides a name that should be associated with the trigger. Progress Bar is the only display type which uses Name Info - it displays it on the left side of the bar. Like Icon Info, you can choose whether you want you use the automatically provided Name Info, or provide your own value. Name Info is almost always provided in the same cases as Icon Info. If a Progress Bar cannot get Name Info from its trigger, it will use its configuration id (the name in the display sidebar).
Stack Info is only provided by Aura triggers, and only used by Progress Bar and Icon display types. It represents the number of stacks an aura has. Auras that do not stack are considered to have 0 stacks. Both Progress Bar and Icon displays will not display anything if they receive 0 for Stack Info.
All of the new Legion-introduced pseudo-charged-based spells like "Gift of the Ox", "Sheilun's Gift", "Atonement" and others can be queried for their current counter with GetSpellCount().
function()
local charges = GetSpellCount("Expel Harm")
return charges
end
Actual charge-based spells can be gotten via GetSpellCharges();
function()
local charges, ... = GetSpellCharges("Roll")
return charges
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