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,075
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 09-07-10, 11:09 AM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
Sorry for the late reply!

Code:
[11:43:41] Interface\AddOns\Tukui\unitframes\layout.lua:628: attempt to index global 'self' (a nil value)
[C]: ?
Interface\AddOns\Tukui\unitframes\layout.lua:628: in function `PostCreateBar'
Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:161: in function <Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:98>
Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:246: in function `func'
Interface\AddOns\Tukui\libs\oUF\ouf.lua:72: in function <Interface\AddOns\Tukui\libs\oUF\ouf.lua:70>
(tail call): ?
This error is cause by:

Code:
TukuiDB.CreatePanel(aura, 0, cfg.InforBar_height, "CENTER", self.AuraBars, "CENTER" ,0,0)
as you are referencing a local variable (self), which doesn't exist.

The other exception seems to be because <element>.scaleTime is set to a boolean rather than a numeric. I didn't actually implement this function, but from reading the documentation, you need to set this to a numeric value representing the length of the bar in seconds. This means that the bar will show as full until the time remaining is less than that of the scaleTime, at which point it will start depleting.

Hope that helps
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 08-25-10, 03:42 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
PostCreateBar needs to be set to a function, where as here you have set it to the parent frame of the aura frame, which is why you get "attempt to call field 'PostCreateBar' (a table value)", as a frame is a table not a function.

The attribute should be set to a function which takes a single argument, which is a statusbar.

Something like this should work, define this function somewhere in the same file.
Code:
local function PostCreateBarFunc(statusbar) 
    -- Mess with the status bar here, have a look in oUF_AuraBars.lua 
    -- in the CreateAuraBar function for reference.
end
In the layout function:
Code:
self.AuraBars.PostCreateBar = PostCreateBarFunc
That should work
Tried it -.-"
Code:
[11:43:41] Interface\AddOns\Tukui\unitframes\layout.lua:628: attempt to index global 'self' (a nil value)
[C]: ?
Interface\AddOns\Tukui\unitframes\layout.lua:628: in function `PostCreateBar'
Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:161: in function <Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:98>
Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:246: in function `func'
Interface\AddOns\Tukui\libs\oUF\ouf.lua:72: in function <Interface\AddOns\Tukui\libs\oUF\ouf.lua:70>
(tail call): ?
Seems like no matter what i do, it keeps on coming.
The function looks like this:
-- PostCreateBar for oUF_AuraBars
local function PostCreateBarFunc(aura)
TukuiDB.CreatePanel(aura, 0, cfg.InforBar_height, "CENTER", self.AuraBars, "CENTER" ,0,0)
TukuiDB.CreateShadow(aura)
aura:SetPoint("TOPLEFT", TukuiDB.Scale(-2), TukuiDB.Scale(2))
aura:SetPoint("BOTTOMRIGHT", TukuiDB.Scale(2), TukuiDB.Scale(-2))
end
EDIT: Hmm, now i found something strange...

When i change the PostCreate function to:
-- PostCreateBar for oUF_AuraBars
local function PostCreateBarFunc(aura)
TukuiDB.SetTemplate(aura)
TukuiDB.CreateShadow(aura)
end
it generates this error:
Code:
[11:57:32] Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:259: bad argument #1 to 'min' (number expected, got boolean)
[C]: ?
[C]: in function `min'
Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:259: in function `func'
Interface\AddOns\Tukui\libs\oUF\ouf.lua:72: in function <Interface\AddOns\Tukui\libs\oUF\ouf.lua:70>
(tail call): ?
__________________


Livestream | Twitter | Facebook | YouTube


Last edited by Dajova : 08-25-10 at 03:59 AM.
Dajova is offline Report comment to moderator  
Reply With Quote
Unread 08-22-10, 05:01 PM  
kingamajick
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 9
Uploads: 1
PostCreateBar needs to be set to a function, where as here you have set it to the parent frame of the aura frame, which is why you get "attempt to call field 'PostCreateBar' (a table value)", as a frame is a table not a function.

The attribute should be set to a function which takes a single argument, which is a statusbar.

Something like this should work, define this function somewhere in the same file.
Code:
local function PostCreateBarFunc(statusbar) 
    -- Mess with the status bar here, have a look in oUF_AuraBars.lua 
    -- in the CreateAuraBar function for reference.
end
In the layout function:
Code:
self.AuraBars.PostCreateBar = PostCreateBarFunc
That should work
kingamajick is offline Report comment to moderator  
Reply With Quote
Unread 08-21-10, 04:17 PM  
Dajova
A Wyrmkin Dreamwalker
 
Dajova's Avatar
AddOn Author - Click to view AddOns

Forum posts: 58
File comments: 791
Uploads: 13
Hmm, imma need some help with PostCreateBar. As far as i could understand from it, it calls for backdrops and stuff like that after the bars has been created. But i'm havin some issues with it...

Keep on getting this error when i gain a aura that creates the bar:
[00:16:11] Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:161: attempt to call field 'PostCreateBar' (a table value)
[C]: in function `PostCreateBar'
Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:161: in function <Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:98>
Interface\AddOns\Tukui\libs\oUF_AuraBars\aura.lua:246: in function `func'
Interface\AddOns\Tukui\libs\oUF\ouf.lua:72: in function <Interface\AddOns\Tukui\libs\oUF\ouf.lua:70>
(tail call): ?
Using this code:
Code:
      self.AuraBars = CreateFrame("StatusBar", self:GetName()..'_AuraBar', self) 
      self.AuraBars:SetPoint("BOTTOMLEFT", self.InfoBar, "TOPLEFT", 0, cfg.secondaryframe_height + 4)
      self.AuraBars.auraBarHeight = cfg.InforBar_height 
      self.AuraBars.auraBarWidth = cfg.mainframe_width 
      self.AuraBars.auraBarTexture = fill_texture
      self.AuraBars.fgalpha = 0.8 
      self.AuraBars.bgalpha = 1 
      self.AuraBars.spellNameFont = font
      self.AuraBars.spellNameSize = cfg.fontsize 
      self.AuraBars.spellTimeFont = font
      self.AuraBars.spellTimeSize = cfg.fontsize
      self.AuraBars.spacing = 2
      self.AuraBars.down = false
      self.AuraBars.sort = false
      self.AuraBars.scaleTime = true
      self.AuraBars.filter = function(name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable)
        if(unitCaster == "player") and (duration ~= 0) and (duration < 300) then
          return true end
        end
      local aura = CreateFrame("Frame", "aura", self)
        TukuiDB.CreatePanel(aura, 0, cfg.InforBar_height, "CENTER", self.AuraBars, "CENTER" ,0,0)
        TukuiDB.CreateShadow(aura)
        aura:SetPoint("TOPLEFT", TukuiDB.Scale(-2), TukuiDB.Scale(2))
        aura:SetPoint("BOTTOMRIGHT", TukuiDB.Scale(2), TukuiDB.Scale(-2))
      self.AuraBars.PostCreateBar = aura:GetParent()
__________________


Livestream | Twitter | Facebook | YouTube


Last edited by Dajova : 08-21-10 at 04:19 PM.
Dajova is offline Report comment to moderator  
Reply With Quote
Unread 08-14-10, 05:28 AM  
mrruben5
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Originally posted by Attro
Has anyone gotten these to work with a layout that is using the new ouf:core v1.4?

I had these working fine prior to updating to v1.4, but now I can't seem to get the bars to spawn.
Could you please post your configuration? I have mine working just fine on oUF Lilly.

And that's the same for everyone else having issues, please post your layout somewhere so I can help.
Last edited by : 08-15-10 at 11:26 AM.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 07-11-10, 01:33 PM  
Attro
A Murloc Raider

Forum posts: 6
File comments: 25
Uploads: 0
Has anyone gotten these to work with a layout that is using the new ouf:core v1.4?

I had these working fine prior to updating to v1.4, but now I can't seem to get the bars to spawn.
Attro is offline Report comment to moderator  
Reply With Quote
Unread 07-07-10, 06:37 PM  
mrruben5
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Originally posted by Attro
Do these bars allow you to track the spells that 'you' cast on a target or does it just track the spell is on the target regardless of who cast it?

Thanks.
Yes, if you configure the bars to do so (use the filter).
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 05-21-10, 08:35 AM  
Attro
A Murloc Raider

Forum posts: 6
File comments: 25
Uploads: 0
Do these bars allow you to track the spells that 'you' cast on a target or does it just track the spell is on the target regardless of who cast it?

Thanks.
Attro is offline Report comment to moderator  
Reply With Quote
Unread 03-28-10, 06:26 AM  
mrruben5
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Originally posted by sacrife
Code:
Message: Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:102: attempt to perform arithmetic on field 'gap' (a nil value)
Time: 03/27/10 20:16:01
Count: 2
Stack: Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:102: in function <Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:96>
Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:244: in function <Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:206>
(tail call): ?
Sigh... Stupid parenthesis, fix incoming.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 03-27-10, 01:18 PM  
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view AddOns

Forum posts: 384
File comments: 145
Uploads: 3
Code:
Message: Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:102: attempt to perform arithmetic on field 'gap' (a nil value)
Time: 03/27/10 20:16:01
Count: 2
Stack: Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:102: in function <Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:96>
Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:244: in function <Interface\AddOns\oUF_AuraBars\oUF_AuraBars.lua:206>
(tail call): ?
__________________

sacrife is offline Report comment to moderator  
Reply With Quote
Unread 03-24-10, 05:52 PM  
mrruben5
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Originally posted by sacrife
Define soon, Is it easier just to wait for beta6?
Probably within a few days. Was going to say "when it's done", but figured that would be unpolite.
Updating the statusbars does not have any throttling anymore, so they are no longer choppy.
If you can't wait for more features, then you can offcourse check out the repo using SVN .
Last edited by : 03-26-10 at 05:23 PM.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 03-24-10, 04:52 PM  
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view AddOns

Forum posts: 384
File comments: 145
Uploads: 3
Originally posted by mrruben5
Updated to beta 5 (since I am manager now). Stuff that I have in my local copy will be implemented soon.
Define soon, Is it easier just to wait for beta6?
__________________

sacrife is offline Report comment to moderator  
Reply With Quote
Unread 03-24-10, 04:21 PM  
mrruben5
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Updated to beta 5 (since I am manager now). Stuff that I have in my local copy will be implemented soon.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 03-22-10, 03:36 PM  
mrruben5
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Originally posted by sacrife
If throttle is the only thing you altered it's not going to work. I tried changing the throttle but all that does is make the bar be slower than it's supposed to be and results in it trying to catch up with itself. The visual effect is smoother yes, but it's delayed. I think the whole update function needs to be altered.
Rather then altering the throttle function you should just remove it. I have a local copy with it fixed, I am ging to upload a patch for it soon.

EDIT:
Patch files removed, just download the release
Last edited by : 03-27-10 at 12:15 PM.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 03-02-10, 05:24 PM  
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view AddOns

Forum posts: 384
File comments: 145
Uploads: 3
Originally posted by kingamajick
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!
If throttle is the only thing you altered it's not going to work. I tried changing the throttle but all that does is make the bar be slower than it's supposed to be and results in it trying to catch up with itself. The visual effect is smoother yes, but it's delayed. I think the whole update function needs to be altered.
__________________

sacrife is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: