Download
(5Kb)
Download
Updated: 07-23-11 06:09 PM
Pictures
File Info
Updated:07-23-11 06:09 PM
Created:10-23-10 01:08 AM
Downloads:5,652
Favorites:29
MD5:

bBuffBars  Popular! (More than 5000 hits)

Version: 1.7
by: Blt [More]

A set of basic buff bars using SecureAuraHeaderTemplates, so it is possible to click off buffs.

This, is something I coded for my own personally use and as such, there are only some very basic configuration options in the lua file. However, most users with very basic lua skills (or who are willing to experiment) should be able to configure this how they please without any issues.

Unfortunately, as Blizzard has been dragging their feet finalizing the template there are a few bugs that are out of my hands. Both sorting, and temporary enchants are buggy. Until Blizzard fixes their typos, and adds better support this is unfortunately what you get.

This includes support for poisons on throwing weapons. Looking through blizzard's code they specifically work with the first two slots, but not the third. So if anyone can find actual proof that it's possible using the SecureTemplate, and that they can be clicked off in combat feel free to pass that along to me.

**As of v1.2 I have added a variable named "updateFrequency" to the options at the top of the lua file which defaults to 0.1. Lowering the value will make the bar empty more smoothly if you are really bothered by the default. Alternatively, you can also raise the value to lower CPU usage at the cost of the bar emptying in chunks if you (like me) don't mind that.**

**v1.6 will throw off the positioning values from previous versions . To be able to use your old values you can type "/script print(GetCVar("uiScale"))" into your chat box and then multiply your old value of barScale by the number outputted by the script. This will make it look exactly like it did before.**

Thanks to sigg for his post. I was being lazy and delaying my dig into Blizzard's code until they had fixed all the bugs, but his post did all the hard work for me in that regard so I decided to update.
Oh and Shadowed, for which I first based my buff bars on a very long time ago.

v1.7
-Added workaround to fix odd behavior with temporary weapon enchants.
-Fixed tool tip for offhand weapon.
-Slight cleanup of code.

Turns out UNIT_AURA acts very strangle when it comes to temporary weapon enchants. The event is fired under 95% of circumstances with shaman, and never for rogues.

v1.6
-Added code to turn off separation of buffs. However, looking at Blizzard's code it still looks broken, and doesn't work for me.
-Rewrote weapon enchant code. Should now support throwing weapon buff as soon as blizzard adds support for it.
-Fixed bars not hiding when alt+z is hit.
-Minor optimizations and restructuring for possible future features.

Blizzard has half fixed being able to click of weapon buffs! You can now click off your mainhand buff. Unfortunately trying to click the offhand buff removes the mainhand buff, and there still isn't any support for throwing weapon buffs.

Still haven't found the time to look into the possibility to abuse consolidated buffs to move buffs with a 0 duration.

v1.5
-Thanks to Ailae for pointing out a super embarrassing error. Performance won't suck in a party or raid now.

v1.4
-Fixed really stupid error caused by the rewrite where I wasn't passing the filter type properly so debuffs were receiving buff timers.

v1.3
-Rewrote how the auras are updated resulting in a 30-50% performance improvement, and 0 CPU usage with no buffs that require animation.

v1.2
-Fixed ghost timers that could ocassionally appear on buffs with no duration
-Fixed counter issue causing performance issue and optimized a bit. New option "updateFrequency" added. Defaulted to 0.1, lower the number for smoother animation, raise it to lower CPU time at the cost of choppy animation.

v1.1
-Added additional variables to let people anchor debuffs to buffs if they want to.
-Fixed texture path from internal location and added border texture to archive.
-Fixed really, really dumb anchoring issue.
Optional Files (0)


Post A Reply Comment Options
Unread 01-25-11, 08:08 PM  
Dhaern
A Kobold Labourer

Forum posts: 0
File comments: 63
Uploads: 0
Hii, do you planned update soon this addon? Weapon enchants don't work correctly, thrown enchant don't show and weapon enchant names dissapear and only show timer. Thx
Report comment to moderator  
Reply With Quote
Unread 01-09-11, 05:30 PM  
talchas
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
You can sorta do something like #1 if a pair of buff lists next to eachother (one for infinite-duration auras, one for other buffs) or something similar to that is good enough. You would do this by having two SecureAuraHeaderTemplate frames, one which does SetAlpha(0) in updateBar if duration==0, and one which does it if it isn't 0. You can then do similar things in OnEnter around the GameTooltip code to make them not show up for tooltips either, and call RegisterForClicks("RightButtonUp")/RegisterForClicks(nil) to disable right-clicking them as well (which surprisingly works in combat too).

You can get them to be sorted how you probably want by having the duration-0-only one be sorted TIME+ and the no-duration-0 one be sorted TIME-.

None of this will let you position the duration-0 ones properly above the normal buffs though. And as Blt found, the consolidated buffs code doesn't seem to do what the published FrameXML says it should - I couldn't get it to pay any attention to the duration options at all.


EDIT: oh wait, even that doesn't work very well, because they screwed up and it always groups your own buffs (0 is a true value blizzard....).
Last edited by talchas : 01-09-11 at 08:18 PM.
Report comment to moderator  
Reply With Quote
Unread 12-15-10, 03:14 PM  
Blt
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 24
Uploads: 1
Right now because of the way Blizzard has done the sorting it's not possible to do #1 unfortunately. This is actually how I would prefer the buff frames too. I had toyed with the idea of a workaround involving consolidating everything either with or without a timer and separating them so they could be anchored separated, but in the amount of time I spent working on it I couldn't get Blizzard's implementation of consolidated buffs to work properly. It's possible I was just doing it wrong, but I was getting some results; they were just horribly broken. Since there were so many other broken things, I decided I'd wait until Blizzard fixed those before I spent too much time worrying about trying to fix what also might just be broken.

Issue #2 would be just simply re-anchoring differently if I could get #1 working.

#3 Isn't possible to move individual buffs if you want to ability to click anything off. It is possible to recolor buffs though. If you really need to separate a buff writing an addon that just displays the same information in a non-interactive form for a buff or two is extremely easy. If you can't find something that does it for you, depending on how lazy I am might clean up and upload an example of it for people.

To recolor specific buffs:

Change line 293 from
Code:
      if( auraType == "HARMFUL" ) then
         color = DebuffTypeColor[debuffType] or DebuffTypeColor.none
      else
         color = defaultColor
      end
to something like
Code:
      if name == "Lightning Shield" or name == "Water Shield" then
         color = {r = 0.01, g = 0.01, b = 0.01}
      elseif( auraType == "HARMFUL" ) then
         color = DebuffTypeColor[debuffType] or DebuffTypeColor.none
      else
         color = defaultColor
      end
You can add as many elseif's as you want to get different colors.
Report comment to moderator  
Reply With Quote
Unread 12-15-10, 08:27 AM  
shane3547
A Kobold Labourer
 
shane3547's Avatar

Forum posts: 0
File comments: 55
Uploads: 0
Buff/Debuff Duration drop off sorting

Thank you for this great mod, looks to be very helpful and very easy to use.

Quick questions though,

1, What do I edit in the .LUA to make the timed buffs drop off the bottom instead of the top or middle if there is a untamed buff current.

For example

Devotion Aura
Righteous Fury
Celestial Steed
Seal of Truth 15:09
Blessing of Kings 45:05

and this is what I want it to look like

Devotion Aura
Righteous Fury
Celestial Steed
Blessing of Kings 45:05
Seal of Truth 15:09


2, How can I make a secondary window for buffs that have no timer?

3, Can I set a specific buff to show as a different color, or in a different location?



Thanks in advance,
Last edited by shane3547 : 12-15-10 at 02:23 PM.
Report comment to moderator  
Reply With Quote
Unread 12-08-10, 07:58 PM  
Blt
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 24
Uploads: 1
Originally posted by Aisenfaire
This looks like a wonderful replacement for Elkano Buff Bars.

Sorry for the noob question, but may I ask how to edit the lua to:
- Make only the buff bars lesser in width (while leaving debuff bars long).
- Hide the buff names (but leave the debuff names and all timers still showing)

My monitor isn't very wide so I'd love to compress the buffs a bit more.
Sorry for the long response time. Both of those will take additional lua editing beyond the simple config:

To hide buff names you can change line 287 from
Code:
if count > 0 then
to
Code:
if count > 0 and auraType == "HARMFUL" then
and line 289 from
Code:
else
to
Code:
elseif auraType == "HARMFUL" then


The way the code is set up right now having different sized bars is harder:

Change line 270 from
Code:
if not button.icon then createBar(button) end
to
Code:
if not button.icon then createBar(button, auraType) end
Line 218 from
Code:
local function createBar(button)
to
Code:
local function createBar(button, auraType)
Finally replaced line 230
Code:
   button.bar:SetWidth(barWidth-barHeight)
with
Code:
if auraType == "HARMFUL" then
   button.bar:SetWidth(barWidth-barHeight)
else
  button.bar:SetWidth(<width>-barHeight)
end
Replacing <width> with the size of the buff bar you want
Report comment to moderator  
Reply With Quote
Unread 12-02-10, 08:18 AM  
Aisenfaire
A Murloc Raider

Forum posts: 6
File comments: 394
Uploads: 0
This looks like a wonderful replacement for Elkano Buff Bars.

Sorry for the noob question, but may I ask how to edit the lua to:
- Make only the buff bars lesser in width (while leaving debuff bars long).
- Hide the buff names (but leave the debuff names and all timers still showing)

My monitor isn't very wide so I'd love to compress the buffs a bit more.
Last edited by Aisenfaire : 12-02-10 at 08:32 AM.
Report comment to moderator  
Reply With Quote
Unread 11-03-10, 10:41 PM  
rach3l
A Kobold Labourer

Forum posts: 1
File comments: 11
Uploads: 0
Take your time, I appreciate that you're looking into it!

I mean it, yours is the only buff mod that currently does exactly what I want and need it to do (display buffs as bars with text and time remaining, right-clickable in combat). I'm not going to complain about a few mildly inconvenient tweaks.
Report comment to moderator  
Reply With Quote
Unread 11-03-10, 08:41 PM  
Blt
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 24
Uploads: 1
I actually prefer the buffs the same way, but unfortunately for now there isn't really anything I can do about it. The sorting is bound by what blizzard supplies me, so I can't do anything to move the timer-less buffs around. If they add the ability to do that, you can be sure i'll update it right away.

The reason the buffs don't get sorted properly is because it currently separates self buffs from buffs given by other players. Unfortunately again, until Blizzard fixes things not much I can do.

However I will upload another version in the next little while that will fix a few things and get code in place to add support for that, even if it won't work for now.

Edit: Hmm, the buff separation issue might be another issue of Blizzard saying one thing, but the code being something else. I might actually be able to fix that.
Also, thinking about it I might be able to add a really lame workaround to reorder the buffs without timers too. Consolidated buffs aren't meant to be used that way, but it might just work...

Edit2: Ahh, while the problem with the separation is that it tells you to supply a number and it treats it like a boolean, it does actually check to make sure you are supplying it with a number. Making sure it is broken...

As for the timerless buffs, the idea is basically to consolidate all buffs that have more than 0 seconds remaining into a separate frame and anchor appropriately. I haven't really looked into the consolidation code so I don't know how it works, but if it follows the current pattern it might not even be complete. I'm pretty busy over the next few days, so we'll see how quick I dig into that.
Last edited by Blt : 11-03-10 at 10:08 PM.
Report comment to moderator  
Reply With Quote
Unread 11-02-10, 05:29 PM  
Jexx
A Deviate Faerie Dragon

Forum posts: 10
File comments: 118
Uploads: 0
I agree with everything rach3l said, I would love to have my buffs sorted in this exact way, with permanent buffs (timeless buffs) on top, followed by shortest duration at the very bottom.

I've tried playing around with the configuration as well and I can't seem to get it to work this way either.
Report comment to moderator  
Reply With Quote
Unread 11-02-10, 02:51 AM  
rach3l
A Kobold Labourer

Forum posts: 1
File comments: 11
Uploads: 0
I believe that this is THE ONLY fully functional buff mod right now. It allows right clicking of buffs, even in combat; it functions right out of the box. You are amazing, thank you for releasing this. Such well-formed code too, no obfuscation. I've never edited lua for an addon before but your code makes it so easy to do! (obviously a config menu would be optimal but this does well enough for our purposes)

That said, I do have one question. I changed my buffs to sort by time descending; no problems there. And my buffs sort just fine when I only have my own buffs on myself. However, any time someone else casts a buff on me, it isn't sorted properly. I screenshotted the issue:



I'm a priest and you can see the arcane intellect buff cast on me by a mage isn't being sorted properly, but all the rest of my buffs are. The only thing I changed was changing the two plus signs to minuses in these functions:

Code:
buffHeader:SetAttribute("sortDirection","-")
debuffHeader:SetAttribute("sortDirection","-")
Is there something else I need to change, or is it not possible to properly filter buffs cast on us by friendly players?

Additionally I'd like it if the timeless buffs (like Essence of Wintergrasp) could go at the very top instead of the very bottom... any tips are MUCH appreciated. Or if what I want isn't possible, that's OK too. I'd just like to know for sure either way so that when I recommend your mod to guildmates, I'll be literate in what is and isn't mutable.
Report comment to moderator  
Reply With Quote
Unread 10-26-10, 07:44 PM  
Blt
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 24
Uploads: 1
Originally posted by Ailae
Yeah, I noticed too that it wasn't so trivial to fix as I would have hoped. It's not that big of a deal, but I get the auras to appear but like you say they don't update stack-counts properly (namely the Defense-skill). There's a difference between /dumps of UnitAura("player", "Defend") and UnitAura("vehicle", "Defend"). I want it to behave like the standard buffs does, when you hop into a vehicle you basically only see the buffs of the vehicle. I'm not sure if this is possible with the SecureHeader, but gonna play around with it some more.
Sorry, I've had a really busy day and even though I've had an answer this is the first chance I've had to reply. As far as I know, unless Blizzard added something I don't know about yet, it's not.

I can supply you with code that works as long as you don't try to enter/exit a vehicle in combat if you want. The problem is you need to change the header's unit attribute for it to work, and that's something that's protected.
Not sure what you could even do as a work around either, since Hide() and Show() are also protected. I suppose you could have a second set of frames on a different part of the screen, but that kind of defeats the purpose of it all.

10 second after edit: The reason why it acts buggy is because the vehicle event is fired before the player one, so if you just try to update the player frame based on the vehicle event you get mismatched info. The vehicle event is for the vehicle bar, the player event the player bar they don't actually share any info.
Last edited by Blt : 10-26-10 at 07:47 PM.
Report comment to moderator  
Reply With Quote
Unread 10-26-10, 07:10 AM  
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view AddOns

Forum posts: 318
File comments: 75
Uploads: 9
Originally posted by Blt
For some reason I assumed it would automatically convert, don't know why in hindsight. Since it will be a little while until I can test this myself to be certain: I assume, like in the past, you also need to watch UNIT_ENTERED_VEHICLE and such to update the unit attribute on the header too?

Edit: Okay, I snuck away to test, and you actually don't need to do that. However, it does seem to be buggy as hell.
If I hop on an argent mount and cast shield, it fires the vehicle update event, but nothing happens or I get a duplicate (and broken) existing buff. Cast it again and the display fixes and it updates to say I have one stack (I actually have two). Cast it a third time and it updates to say I have three.
Letting the time run out on the buff doesn't remove it.

Each cast of shield calls one vehicle, one pet, and two player UNIT_AURA updates. I'll look into this more, but you might also need to add pet to the list too...

Edit2: Okay, for at least the Argent mounts you don't actually need to watch anything other than player and it will work fine. It makes sense when you think of it, and explains the bugginess since I wasn't changing the attribute too. The vehicle event is passed to keep track of a separate list of buffs which display only what is on the vehicle, this information is also passed onto the player frames. So unless you want to display ONLY the vehicle buffs, or there is a case where the vehicle buffs aren't passed to the player ones, you don't need to worry about it. Is there such a case that you found?
Yeah, I noticed too that it wasn't so trivial to fix as I would have hoped. It's not that big of a deal, but I get the auras to appear but like you say they don't update stack-counts properly (namely the Defense-skill). There's a difference between /dumps of UnitAura("player", "Defend") and UnitAura("vehicle", "Defend"). I want it to behave like the standard buffs does, when you hop into a vehicle you basically only see the buffs of the vehicle. I'm not sure if this is possible with the SecureHeader, but gonna play around with it some more.
__________________
Oh, the simulated horror!
Report comment to moderator  
Reply With Quote
Unread 10-25-10, 02:08 PM  
Blt
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 24
Uploads: 1
Originally posted by Ailae
And I just realized today that it would be nice if the buffs worked when I was in a vehicle too.. :P So need to pass through the unit "vehicle" too, which is only the current player-controlled vehicle so shouldn't make much of a difference performance-wise.
For some reason I assumed it would automatically convert, don't know why in hindsight. Since it will be a little while until I can test this myself to be certain: I assume, like in the past, you also need to watch UNIT_ENTERED_VEHICLE and such to update the unit attribute on the header too?

Edit: Okay, I snuck away to test, and you actually don't need to do that. However, it does seem to be buggy as hell.
If I hop on an argent mount and cast shield, it fires the vehicle update event, but nothing happens or I get a duplicate (and broken) existing buff. Cast it again and the display fixes and it updates to say I have one stack (I actually have two). Cast it a third time and it updates to say I have three.
Letting the time run out on the buff doesn't remove it.

Each cast of shield calls one vehicle, one pet, and two player UNIT_AURA updates. I'll look into this more, but you might also need to add pet to the list too...

Edit2: Okay, for at least the Argent mounts you don't actually need to watch anything other than player and it will work fine. It makes sense when you think of it, and explains the bugginess since I wasn't changing the attribute too. The vehicle event is passed to keep track of a separate list of buffs which display only what is on the vehicle, this information is also passed onto the player frames. So unless you want to display ONLY the vehicle buffs, or there is a case where the vehicle buffs aren't passed to the player ones, you don't need to worry about it. Is there such a case that you found?
Last edited by Blt : 10-25-10 at 03:16 PM.
Report comment to moderator  
Reply With Quote
Unread 10-25-10, 01:07 PM  
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view AddOns

Forum posts: 318
File comments: 75
Uploads: 9
Originally posted by Blt
Oh god. See, this is why I am glad people post comments. I get to facepalm myself and bang my head on the desk. I do that in every other one of my addons, and I am 99% sure that I had wrote this at some point, but then somehow got rid of it. If you have any other mind numbing observations I urge you to post them, i'll get this fixed right away. Embarrassing.

As for making your own. Nice to hear, I made this because I like to tinker too. A lot of the reason I released it was to give people an example to look at.
And I just realized today that it would be nice if the buffs worked when I was in a vehicle too.. :P So need to pass through the unit "vehicle" too, which is only the current player-controlled vehicle so shouldn't make much of a difference performance-wise.
__________________
Oh, the simulated horror!
Report comment to moderator  
Reply With Quote
Unread 10-25-10, 10:44 AM  
Tearitup
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Re: Re: Moving the bars?

Originally posted by Blt
Right now all the configuration options are at the top of the bBuffBars.lua file. You can open up the file using Notepad, or any other text editor. Changing the value of "buffScale" changes the scale, and variables such as "buffX" and "debuffY" control where they are. A negitive number in buffX will move it left, a positive will move it right. After you are done changing the values save the file, and type "/console reloadui" into WoW, or relog.

It can take a tiny bit of trial and error, but it's not hard to do! You aren't going to break anything by changing those values.

For more in depth information on moving stuff you can go here.

I guess I should probably put all of this into the description too.
Thanks so much. It worked just as expected. Excellent mod! I hope you continue with the project!
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: