Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(4 Kb)
Download
Updated: 03-28-10 06:31 AM
Pictures
File Info
Updated:03-28-10 06:31 AM
Created:01-30-10 11:31 AM
Downloads:3,085
Favorites:11
MD5:

oUF AuraBars

Version: 30300.26
by: kingamajick [More]

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.

Newer changes can be found on SVN.

== 1.0.0-beta5
Imported to wowinterface SVN, updating statusbars should no longer happen too slow.

== 1.0.0-beta4
Further fix to the memory issue, hopefully sorted now :P

Adjusted the throtte again to smooth the bars some what, this may require a revisit!

== 1.0.0-beta3
Memory usage issue should be fixed.

Update throttle is now a sensible value.

The following changes have been made to attribute names:
  • nameFont -> spellNameFont
  • nameSize -> spellNameSize
  • spellFont -> spellTimeFont
  • spellSize -> spellTimeSize
Currently the old attribute names are supported (giving a warning to the user to update).

== 1.0.0-beta2
Added ability to filter the buffs/debuffs displayed.

== 1.0.0-beta1
Initial Release.
Optional Files (0)


Archived Files (6)
File Name
Version
Size
Author
Date
30300.24
4kB
kingamajick
03-27-10 11:22 AM
1.0.0-beta5
3kB
kingamajick
03-24-10 04:20 PM
1.0.0-beta4
3kB
kingamajick
03-02-10 03:50 PM
1.0.0-beta3
3kB
kingamajick
02-09-10 03:22 PM
1.0.0-beta2
3kB
kingamajick
01-31-10 08:50 AM
1.0.0-beta1
3kB
kingamajick
01-30-10 11:31 AM


Post A Reply Comment Options
Unread 01-31-10, 02:39 AM  
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view AddOns

Forum posts: 643
File comments: 265
Uploads: 23
Finally! Thank you!
__________________
All I see is strobe lights blinding me in my hindsight.
Wimpface is offline Report comment to moderator  
Reply With Quote
Unread 01-31-10, 06:59 AM  
swiffy
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
I was waiting for an addon like this. Thanks, much appreciated!

However, I'm having difficulty getting the addon to work. Do I need to add any specific code to my oUF layout? I'm using oUF_viv.
swiffy is offline Report comment to moderator  
Reply With Quote
Unread 01-31-10, 07:30 AM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Originally posted by swiffy
I was waiting for an addon like this. Thanks, much appreciated!

However, I'm having difficulty getting the addon to work. Do I need to add any specific code to my oUF layout? I'm using oUF_viv.
Yea, you would need to add specific code to oUF_viv, it would be something along the lines of the following somewhere suitable in the layout function

Code:
if(unit == "target") then
	local auraAnchor = CreateFrame("Frame", nil, oUF)
	auraAnchor:SetHeight(1)
	auraAnchor:SetWidth(1)
	auraAnchor:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0 , 0)
	
	auraAnchor.auraBarHeight = 200
	auraAnchor.auraBarWidth = 12
	auraAnchor.auraBarTexture = CBtex
	auraAnchor.fgalpha = 0.8
	auraAnchor.bgalpha = 0.5
	auraAnchor.nameFont = NameFont
	auraAnchor.nameSize = 14
	auraAnchor.spellFont = NumbFont
	auraAnchor.spellSize = 14
	self.auraAnchor = auraAnchor
end
That should work, although as I don't use oUF_viv myself I couldn't say for certain. You will prob want to alter the config and positioning.

Hope that helps
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 01-31-10, 08:15 AM  
thatguyzp
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 15
Uploads: 4
The memory use from oUF_AuraBars seems to skyrocket for me while in combat, I have a feeling it's from buffs that constantly refresh themselves (ex Herkuml War Totem proc)

edit: Screenshot here

It went up to around 1mb of memory usage in around 2 minutes of testing it out on combat dummies, from its initial 6kb or so, shortly after leaving combat it will return to its startup memory usage.

Not a huge deal, but just thought you should know.


Also, was wondering if we could get something like an .onlyShow option, to only show specific Buffs/Debuffs.
Last edited by thatguyzp : 01-31-10 at 08:18 AM.
thatguyzp is offline Report comment to moderator  
Reply With Quote
Unread 01-31-10, 08:55 AM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Originally posted by thatguyzp
The memory use from oUF_AuraBars seems to skyrocket for me while in combat, I have a feeling it's from buffs that constantly refresh themselves (ex Herkuml War Totem proc)

edit: Screenshot here

It went up to around 1mb of memory usage in around 2 minutes of testing it out on combat dummies, from its initial 6kb or so, shortly after leaving combat it will return to its startup memory usage.

Not a huge deal, but just thought you should know.


Also, was wondering if we could get something like an .onlyShow option, to only show specific Buffs/Debuffs.
Ok, I've done a little update (beta2) which makes it possible to add custom filters.

You would use a custom filter as follows (the example used is the default filter)
Code:
oUF.AuraBars.filter = function(name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable)
  if(unitCaster == "player") then
    return true
  end
end
I'll have a look into the memory usage issue. I'll have to dig a little deeper into how lua allocates memory, and see if there any any profiling tools about.

Thanks for the feed back
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 02-05-10, 08:25 AM  
ckeurk
A Murloc Raider
 
ckeurk's Avatar
AddOn Author - Click to view AddOns

Forum posts: 4
File comments: 16
Uploads: 2
hello
I am a French user tukui
it is possible to have an simple example for rogue ?
because I can not put bars
thank you
ckeurk is offline Report comment to moderator  
Reply With Quote
Unread 02-09-10, 03:25 PM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Originally posted by ckeurk
hello
I am a French user tukui
it is possible to have an simple example for rogue ?
because I can not put bars
thank you
Hi, I'm not familiar with that ui package, I'm assuming its based on oUF? If it is, you need to find where in that layout it creates the frame you want to add the aurabars too and then follow the details listed in the main post.
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 02-09-10, 08:40 PM  
Dajova
A Wyrmkin Dreamwalker
 
Dajova's Avatar
AddOn Author - Click to view AddOns

Forum posts: 58
File comments: 791
Uploads: 13
Tried to apply this to oUF_Caellian, but i keep on getting this error :S

Code:
[03:37:53] Interface\AddOns\oUF_Caellian\oUF_cMain.lua:796: attempt to perform arithmetic on a string value
[C]: ?
Interface\AddOns\oUF_Caellian\oUF_cMain.lua:796: in function `styleFunc'
Interface\AddOns\oUF\ouf.lua:415: in function <Interface\AddOns\oUF\ouf.lua:407>
Interface\AddOns\oUF\ouf.lua:486: in function <Interface\AddOns\oUF\ouf.lua:482>
Interface\AddOns\oUF\ouf.lua:537: in function `Spawn'
Interface\AddOns\oUF_Caellian\oUF_cMain.lua:1117: in main chunk
Pastey link
__________________


Livestream | Twitter | Facebook | YouTube


Dajova is offline Report comment to moderator  
Reply With Quote
Unread 02-10-10, 12:57 PM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Originally posted by richerich
Tried to apply this to oUF_Caellian, but i keep on getting this error :S

....
Took a bit, but I've found the problem, there is a comma missing in line 796

self.AuraBars:SetPoint("TOPLEFT", self, "TOPRIGHT", -1, 29)

Also you should be assigning values to the option attributes rather than treating them as function calls, i.e

Code:
self.AuraBars.auraBarTexture = normtexa
rather than
Code:
self.AuraBars.auraBarTexture(normtexa)
I've updated the info page for the addon to make this more verbose. Another thing to keep in mind is the frame you are assigning to AuraBars is only an anchor and therefore the size of this frame has no effect on the size of the bars, you should assign values to auraBarHeight and auraBarWidth for this (defaults are 20 and 200 respectively). If the option down is true the first bar's TOPLEFT will be attached to the anchors BOTTOMLEFT and visa versa if its false (default). In my own layout, I use a frame size 1x1,

Working code:
Code:
 -- Setup anchor frame, bars will grow up or down from this frame. 
self.AuraBars = CreateFrame("Frame", nil, self.Health) 
--self.AuraBars:SetAllPoints() 
self.AuraBars:SetFrameStrata("BACKGROUND") 
self.AuraBars:SetHeight(14) 
self.AuraBars:SetWidth(290) 
self.AuraBars:SetPoint("TOPLEFT", self, "TOPRIGHT" -1, 29)
self.AuraBars.auraBarTexture = normtexa -- Texture to use for each aura bar 
self.AuraBars.fgalpha = 0.95 -- Foreground Alpha 
self.AuraBars.bgalpha = 0.25 -- Background Alpha 
self.AuraBars.spellNameFont = fontn -- Font to use for the buff's/debuff's name (previously nameFont) 
self.AuraBars.spellNameSize = 14 -- Font size to use for the buff's/debuff's name (previously nameSize) 
self.AuraBars.spellTimeFont = fontn -- Font to use for the buff's/debuff's remaining timer (previously spellFont) 
self.AuraBars.spellTimeSize = 14 -- Font size to use for the buff's/debuff's remaining timer (previously spellSize) 
self.AuraBars.down = false -- Set to true to get the bars to grow down rather than up 
self.AuraBars.filter = function(name, rank, icon, count, debuffType, duration, 
									expirationTime, unitCaster, isStealable) 
							if(unitCaster == "player") then 
								return true 
							 end  
						end
Hope that helps
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 02-10-10, 09:26 PM  
Dajova
A Wyrmkin Dreamwalker
 
Dajova's Avatar
AddOn Author - Click to view AddOns

Forum posts: 58
File comments: 791
Uploads: 13
Originally posted by kingamajick
[b]Took a bit, but I've found the problem
Thx for the answer, got it working now Now i just need to figure out how to filter out any non-duration auras from the timers, like Blood Frenzy.
__________________


Livestream | Twitter | Facebook | YouTube


Dajova is offline Report comment to moderator  
Reply With Quote
Unread 02-11-10, 02:51 PM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Originally posted by richerich
Thx for the answer, got it working now Now i just need to figure out how to filter out any non-duration auras from the timers, like Blood Frenzy.
This would work:
Code:
function(name, rank, icon, count, debuffType, duration, expirationTime,
                      unitCaster, isStealable)
      if(unitCaster == "player") and (duration ~= 0) then
            return true
      end
end
The (duration ~0) clause removes non-duration auras
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 02-15-10, 09:41 AM  
Dajova
A Wyrmkin Dreamwalker
 
Dajova's Avatar
AddOn Author - Click to view AddOns

Forum posts: 58
File comments: 791
Uploads: 13
Originally posted by kingamajick
This would work:
Thanks, works like a charm

Now for the last part (sorry for many questions, but i just cant seem to get it to work), i wanna filter out any long-term buffs, like Molten Armor and Arcane Brilliance, but still wanna see short-term buffs like Missile Barrage and Battle Shout (if u get what i mean).

EDIT: Noticed some memory leak in large raids...

__________________


Livestream | Twitter | Facebook | YouTube


Last edited by Dajova : 02-15-10 at 05:24 PM.
Dajova is offline Report comment to moderator  
Reply With Quote
Unread 02-17-10, 02:46 PM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Originally posted by richerich
[b]Thanks, works like a charm

Now for the last part (sorry for many questions, but i just cant seem to get it to work), i wanna filter out any long-term buffs, like Molten Armor and Arcane Brilliance, but still wanna see short-term buffs like Missile Barrage and Battle Shout (if u get what i mean).
You could do something like
Code:
function(name, rank, icon, count, debuffType, duration, expirationTime,
                      unitCaster, isStealable)
      if(unitCaster == "player") 
                and (duration ~= 0)
                and (duration < 1800) then
            return true
      end
end
The extra statment would filter out buffs which are over 30mins (1800s).

I'll have a look into the memory issue, I've just be leveling since my return to the crack so I haven't had the change to use this in a raid setting as of yet.
Last edited by kingamajick : 02-17-10 at 02:46 PM.
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 02-27-10, 11:50 AM  
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view AddOns

Forum posts: 384
File comments: 145
Uploads: 3
The bar is VERY choppy. Any way to fix this?
__________________

Last edited by sacrife : 02-27-10 at 01:58 PM.
sacrife is offline Report comment to moderator  
Reply With Quote
Unread 03-02-10, 03:52 PM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Originally posted by sacrife
The bar is VERY choppy. Any way to fix this?
I've updated a couple of points of the addon, and one is to try and smooth the bar. I'm trying to work out if there is an optimum value for updating, and whether I approach this from a more time based perspective (i.e short timers would get updated more frequently that long timers)

Anyway, let me know if you find it less choppy now or if you think it still needs to be smoother!
kingamajick is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: