Sorting of auras
This might be a stupid question (because im really new to oUF), but is it possible to sort buffs?
|
Quote:
|
It's damn tricky and I don't know if anyone got a working way that doesn't bug out now and then.
Edit: haste beat me to it... however, it's surely possible, just not sure if anyone (besides haste) is clever enough to code it. :D |
Depends on how you want to sort really. But what issues did you run into and with what sort function?
|
I managed to sort it by time left, but from time to time some buffs disappeared from the buff list.
Like BUFFICON 1, BUFFICON 2, BUFFICON 3 becomes BUFFICON 1, BUFFICON 3 while BUFF 2 is still there, just the icon got "overridden" ... strange thing. :) |
That doesn't show any code tho' :P. Anyway, a quick and dirty example on how to do aura sorting can found on this post.
|
wow, it is actually kinda easy to sort buffs. thanks.
my code: Code:
local prePosition = function(self, a, n) |
Quote:
Code:
local preAuraSetPosition = function(self, buffs, max) This is taken from oUF_Banthis, since I don't have the exact piece of code I used, still around. However, that code above is having the same issues of "disappearing" buff icons, with still active buffs. Quote:
The thing with the code you linked in that post is that it still crits me for over NIIIINEEEETHOOOOOUSAAAND. And I didn't find the time to play around with it, until now. Seems like I have to take enough time to look into it. :banana: |
There's a couple of things you want to think of when you want to sort auras using table.sort:
1. Auras that aren't shown also have outdated information. 2. Auras with no duration are represented as 0 in duration. The following should handle both those cases: Lua Code:
|
Quote:
|
I got no error, but no sort effect, either. Crazy stuff. :cool:
|
Using math.huge is a really good idea. Depending on your personal preferences though on how to sort auras, I'd suggest setting auras (timeleft = nil) to either math.huge or 0, and if the aura isn't shown, set it to -1. Using -1 ensures it's always outside the normal range and might take care of the blank space issue.
|
Quote:
|
You know the spacing issue, that no-one wanted to report? Here's a fix for it. Below is also revised aura sorting without any extra cruft.
lua Code:
I'll try to push out 1.3.22 soonish, just need to level a DK and figure out how death runes work so I can fix the runebar bug people are complaining about. |
Heh, I just always assumed the gaps were caused by something I was doing wrong, not a problem in oUF. Thanks for the fix, though.
|
It's better that people report possible errors than ignoring them, as the last won't make them get fixed until I notice them myself.
|
We're just assuming that we are wrong, since you can't! ;)
|
Double post inc..
Just for the record: Why not add aura sorting to oUF core? I mean it's a really good thing in general. |
I don't really see why it should be needed. You can already do it quite easily. Depending on what/how you want to sort ofc :).
|
I get the following error (several times) with that github version you posted above. :)
Code:
22.26 oUF: Error: Handler for event [UNIT_COMBAT] on unit [unknown] does not exist. |
All times are GMT -6. The time now is 11:41 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI