View Single Post
11-28-09, 04:13 AM   #8
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by haste View Post
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.
I was doing it similar to this:

Code:
local preAuraSetPosition = function(self, buffs, max)
	local visBuffs = 0
	for i=1, #buffs do
		if( buffs[i].timeLeft == nil ) then
			buffs[i].timeLeft = 0
		end
		if( buffs[i]:IsShown() ) then
			visBuffs = visBuffs + 1
		end
	end
	
	if(visBuffs == 0 ) then
		buffs:SetHeight(0)
	else
		buffs:SetHeight(math.ceil((visBuffs/10)) * 26 )
	end
	
	table.sort(buffs, function(a,b) return a.timeLeft > b.timeLeft end)
end
note:
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.


*In some strange cases, the auras (which are divided into those that expire and don't, aka auras and buffs) will jump around with blank spaces between them. I have no idea why. Adding an aura (like a hunter aspect) makes it stop.

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.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote