7c7869494e8a34376e2f42c9bdaff9b9f0471faa
Add methods to the states/allstates table that helps with creating,
updating or remove states in an optimized way
## Advantage of using this function instead of doing a states[key] = {
... }
- If already created, update existing state, and return true if any
value was changed, this can help reduce amount of resources an aura use
- Automatically `return true` when using these functions and any change
was made
## Examples
```Lua
function(states, event, ...)
if event == "PLAYER_TARGET_CHANGED" then
if UnitExists("target") then
-- if state exists it's updated, not replaced
-- show & changed fields can be skipped
states:Update("", {
name = UnitName("target"),
duration = 5,
expirationTime = GetTime() + 5,
progressType = "timed",
autoHide = true
})
else
-- wipe
states:RemoveAll()
end
end
-- no need to return true
end
```
with clones
```Lua
function(states, event, ...)
local currentEssence = UnitPower("player", Enum.PowerType.Essence)
local maxEssence = UnitPowerMax("player", Enum.PowerType.Essence)
for i = 1, 6 do
if i > maxEssence then
states:Remove(i) -- wipe allstates[6]
else
local value = currentEssence >= i and 1 or 0
local newState = {
progressType = "static",
value = value,
total = 1
}
states:Update(i, newState)
end
end
-- no need to return true
end
```
WeakAuras is a powerful and flexible framework that allows the display of highly customizable graphics on World of Warcraft's user interface to indicate buffs, debuffs, and other relevant information. This addon was created to be a lightweight replacement for Power Auras but has since introduced more functionalities while remaining efficient and easy to use.
Features
- An intuitive and powerful configuration interface
- Custom textures including all textures from Power Auras and Blizzard's spell alerts
- Progress bars and textures that show the exact duration of auras
- Displays based on auras, health, power (mana, rage, soul shards, holy power, etc.), cooldowns, combat events, runes, totems, items, and many other triggers
- Preset and user-defined animations
- Custom side-effects such as chat announcements or sounds
- Grouping, which allows multiple displays to be positioned and configured at the same time
- CPU optimizations such as conditional loading/unloading of displays, modularity, and prevention of full aura scanning
- Powerful customization options, such as animation paths, on-show/on-hide code, and custom triggers, for Lua-savvy users
Quick Start
To open the options window, type /wa or /weakauras into your chat and hit enter or use the minimap icon.
Extensions
- WeakAuras Companion: This application adds the missing link between Wago.io and the World of Warcraft addon, enabling you to update your auras in a convenient fashion. (Folder Structure:
World of Warcraft/_retail_/Wow.exeand backup WTF) - WeakAuras_StopMotion: This addon adds a new region type to WeakAuras that allows for stop motion animations. Stop Motion textures contain each frame of the animation as a separate image. The addon ships with a number of animations and it supports custom textures.
- SharedMedia for more bar textures.
- SharedMediaAdditionalFonts for more fonts.
- ColorPickerPlus for a better version of the WoW color picker that includes class color templates and a copy and paste function.
Documentation
For in-depth documentation, see the wiki page.
Examples
For some examples of what WeakAuras can do, take a look at wago.io where tons of people upload their creations and even feature complete interfaces utilizing WeakAuras!
Problems
- Please see the wiki page.
- If you've discovered something that's clearly wrong, or if you get an error, please create a ticket.
- You're a programmer yourself and want to contribute? Check out our contributing guidelines to get started!
- Feel free to join our Discord Community to talk, get help and discuss everything WeakAuras!
Releases
2
5.22.0-coa.2
Latest
Languages
Lua
99.6%
Scheme
0.4%
