Skip to main content

Overview

WeakAuras is built as a modular framework for World of Warcraft that provides a powerful system for creating custom interface displays. Understanding its architecture will help you create more effective and efficient auras.

Core Components

The WeakAuras framework consists of several key components that work together:

Displays

Visual elements that appear on screen (icons, bars, text, etc.)

Triggers

Conditions that determine when displays should show or update

Conditions

Dynamic property changes based on game state

Animations

Visual effects and transitions for displays

How WeakAuras Works

1

Event Registration

WeakAuras registers for game events based on your aura configurations. This efficient system only listens for events that your auras actually need.
-- From WeakAuras.lua
WeakAuras:RegisterEvent("PLAYER_ENTERING_WORLD")
WeakAuras:RegisterEvent("PLAYER_LOGIN")
2

Trigger Evaluation

When events fire, WeakAuras evaluates your trigger conditions to determine if auras should show, hide, or update.
WeakAuras uses an optimized scanning system to minimize CPU usage even with many active auras.
3

Display Updates

If trigger conditions are met, WeakAuras updates the corresponding displays with new data (texture, text, progress, etc.).
4

Condition Application

Dynamic conditions are applied to modify display properties in real-time based on additional criteria.
5

Animation Execution

Show/hide animations and transitions play according to your configuration.

Data Flow

Module Structure

WeakAuras is organized into several key modules:

Core Module

The main WeakAuras module handles:
  • Initialization and addon loading
  • Event registration and dispatching
  • Display lifecycle management
  • Data persistence (SavedVariables)
-- Internal version tracking
local internalVersion = 87

Region Types

Each display type has its own region implementation:
  • Icon - Single texture with cooldown overlays
  • AuraBar - Progress bar with text labels
  • Text - Dynamic text displays
  • Texture - Custom textures and progress textures
  • Group - Container for multiple displays
  • DynamicGroup - Auto-arranging display groups
  • Model - 3D model displays
  • StopMotion - Animated texture sequences

Trigger Systems

Multiple trigger types provide flexibility:
  • BuffTrigger2 - Optimized aura/buff/debuff detection
  • GenericTrigger - Handles combat events, status checks, and custom logic
  • BossMods - Integration with DBM and BigWigs

Supporting Systems

Profiling

Performance monitoring and CPU usage tracking

Modernize

Automatic updates for old aura formats

Transmission

Import/export and sharing functionality

Performance Optimization

WeakAuras includes several performance optimizations:

Conditional Loading

Auras can be configured to load only when needed:
-- Load conditions examples
load = {
  use_class = true,
  class = { ["WARRIOR"] = true },
  use_spec = true,
  spec = { [1] = true },  -- Only in spec 1
  use_zone = true,
  zone = "Icecrown Citadel"
}

Event Filtering

The framework only registers for events that are actually used by active auras.

Pooling System

Display frames are recycled rather than constantly created and destroyed:
-- From Pools.lua
local regionPools = {}
Use load conditions to prevent unnecessary auras from running in irrelevant content.

Extension Points

WeakAuras provides several extension points for advanced users:

Custom Triggers

Write Lua code for complex trigger logic:
function()
  -- Custom trigger code
  return true  -- Show aura
end

Custom Code

Add init, trigger, and animation code:
  • Init - Runs once when aura loads
  • Trigger - Custom trigger evaluation
  • Actions - Custom behavior on show/hide/update

Region Type Registration

Developers can create custom region types:
WeakAuras.RegisterRegionType(regionType, constructor, default, properties)

Data Storage

WeakAuras stores configuration in SavedVariables:
WeakAurasSaved = {
  displays = {},
  history = {},
  login_squelch_time = 10
}
Always back up your WeakAurasSaved file before major changes!

Next Steps

Learn About Displays

Deep dive into display types and configuration

Understanding Triggers

Master the trigger system for precise control

Groups & Organization

Organize multiple displays efficiently

Customization Options

Add animations, conditions, and custom code

Build docs developers (and LLMs) love