About
oUF_AuraBars is a plugin for oUF which displayed buffs/debuffs as status bars. This addon was inspired by ClassTimers.
Options
Code:
--[[
oUF Element: .AuraBars
Options regarding visual layout:
- <element>.auraBarHeight
Sets the height of the statusbars and icons.
- <element>.auraBarWidth
Sets the width of the statusbars (excluding icon). Will use the
framewidth of <element> by default.
- <element>.auraBarTexture
Sets the statusbar texture.
- <element>.fgalpha
Foreground alpha.
- <element>.bgalpha
Background alpha.
- <element>.spellTimeObject, <element>.spellNameObject
Objects passed by CreateFontObject(). These will ignore the
following options:
<element>.spellTimeFont, <element>.spellTimeSize
<element>.spellNameFont, <element>.spellNameSize
- <element>.spellTimeFont, <element>.spellTimeSize,
<element>.spellNameFont, <element>.spellNameSize
Options to control the texts on the statusbars.
- <element>.gap
Will add space between the statusbars and icons by amount of .gap
in pixels.
- <element>.spacing
Will add space between statusbars by amount of .spacing in pixels.
Options regarding functionality:
- <element>.down
Will let the aurabars grow downwards.
- <element>.filter(name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable)
Use this to filter out specific casts.
- <element>.sort
Will enable sorting if set to true or 1 (or whatever). See
functions for info on how to override the sort function.
- <element>.scaleTime
Will add time-scaling (bar widths according to the total duration
of the aura assigned to it). Will use the minimum of
<element>.scaleTime and the total aura duration to determine the
width in percent.
Functions that can be overridden from within a layout:
- <element>.PostCreateBar(bar)
To do stuff to a bar once it has been created, such as set a
backdrop, etc, use this function. Use bar:GetParent() to get the
<element> object.
- <element>.sort(a, b)
Custom compare function to sort aura's before the bars are being
updated. Is being called every UNIT_AURA for the <element>'s unit.
--]]
Example Usage
Code:
-- Setup anchor frame, bars will grow up or down from this frame.
self.AuraBars = CreateFrame("Frame", nil, self)
self.AuraBars:SetHeight(1)
self.AuraBars:SetPoint'LEFT'
self.AuraBars:SetPoint'RIGHT'
-- Options
self.AuraBars.someoption = value
Filters
The default filter can be replaced by using the .filter attribute. The filter should be in the form of a function which has the following signature.
Code:
function(name, rank, icon, count, debuffType, duration,
expirationTime, unitCaster, isStealable)
The following is the default filter
Code:
function(name, rank, icon, count, debuffType, duration,
expirationTime, unitCaster, isStealable)
if(unitCaster == "player") then
return true
end
end
An example of a custom filter which hides the "Stealth" buff
Code:
function(name, rank, icon, count, debuffType, duration,
expirationTime, unitCaster, isStealable)
if(not (name == "Stealth")) then
return true
end
end
Note
I primarily wrote this plugin for my own oUF layout and as such am unlikely to add many further features/configurations to it other than those currently available.