Thread Tools Display Modes
07-03-10, 07:31 AM   #1
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Need some help on Aura filtering...

Hey guys,
I think I need some advise here...

I'm currently rewriting my oUF-layout to 1.4 and it's nearly done. The last thing ****ing it up are the auras.

I had it set up (pre 1.4) like this:
Every toon has it's own SavedVars file, which contains an array (table) with spellIDs. If there is an aura with a spellID from the table, the aura is shown, if not, it's not displayed (simpe whitelisting).

Now (1.4) the filter stuff is just not working and I can't figure out why. I set up a custom filter in my layout with self.Buffs.CustomFilter = core.FilterBuffs.

This is the filter-function (basically the start of the filter-process, since I'm generalizing the functions to provide white- and blacklisting.
settings.options.friendsBuffs and settings.options.friendsDebuffs are the loaded SavedVars-tables described above.
Code:
	--[[ Filter buffs
		BOOL FilterBuffs(..., INT spellID)
	]]
	core.FilterBuffs = function(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID)
		if ( UnitIsFriend(unit, 'player') ) then
			return lib.FilterGeneric(spellID, settings.options.friendsBuffs)
		else
			return lib.FilterGeneric(spellID, settings.options.enemyBuffs)
		end
	end
This is the generic filter function which makes the distinction between black- and whitelisting.
Code:
	--[[ Generic filter-function (distinction between blacklist and whitelist)
		BOOL FilterGeneric(INT spellID, TABLE filterSRC)
	]]
	lib.FilterGeneric = function(spellID, filterSRC)
		if (mode == 'blacklist') then
			return lib.FilterBlacklist(spellID, filterSRC)
		else
			return lib.FilterWhitelist(spellID, filterSRC)
		end
	end
This is the blacklisting-function. Whitelisting is similar, BOOLs switched, obviously. lib.in_array() is working correctly, too. It's a very slim table lookup.
Code:
	lib.FilterBlacklist = function(spellID, list)
		if ( #list ~= 0 ) then
			if ( lib.in_array(spellID, list) ) then
				return false
			end
		end
		return true
	end
So, my problem is: Every of this function is working correctly, as far as I can tell from debugging. in oUFs aura.lua my CustomFilter-function is called (in updateIcon() ) and after the functions are processed, it returns true or false.
In updateIcon() everything seems to work correctly, since it jumps to the correct parts, depending on show. But my buffs/debuffs won't show up.

If I deactivate my CustomFilter, the auras show up in the right placed, obviously without any filtering.

Can someone pls have a look on this... I'm clueless.
  Reply With Quote
07-03-10, 10:25 AM   #2
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
There is a bug in oUF 1.4 at the moment, but Haste will not be able to fix it until August.


See here: http://www.wowinterface.com/portal.p...bug&bugid=6664
  Reply With Quote
07-03-10, 01:50 PM   #3
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Thank you for pointing me in the right direction, yj589794.

In fact, it is a weakness in oUF aura.lua.

I found a nasty hack, which is working for me, but sorry, I can't really say, if it has any side-effects on your layouts. Anyway, and of course, it may help Haste, here's the fix:

In the (original) function filterIcons(), "unneeded" icons are hidden. I estimate, this is done, to hide those short auras, which have expired.
But since the icons are not ordered in the icons-table, you can not simply hide them by their index.

My fix works like this: I hide all icons, before the function updateIcon() is called, because inside of updateIcon(), there are calls to hide/show the icon anyway.

This may have some performance issues, I'm sure Haste can provide a better solution, but till august it'll do the trick.

Simply replace the WHOLE filterIcons() with this one:

Code:
local filterIcons = function(unit, icons, filter, limit, isDebuff, offset, dontHide)
	if(not dontHide) then		-- FIX
		for i = 1, #icons do	-- FIX
			icons[i]:Hide()		-- FIX
		end						-- FIX
	end							-- FIX
	if(not offset) then offset = 0 end
	local index = 1
	local visible = 0
	while(visible < limit) do
		local result = updateIcon(unit, icons, index, offset, filter, isDebuff)
		if(not result) then
			break
		elseif(result == VISIBLE) then
			visible = visible + 1
		end
		index = index + 1
	end
	-- if(not dontHide) then
		-- for i = offset + visible + 1, #icons do
			-- icons[i]:Hide()
		-- end
	-- end
	return visible
end
  Reply With Quote
07-08-10, 05:53 AM   #4
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
The problem with that "fix" is, that it doesn't work for auras. It works for the debuff part of them, but entirely removes the buffs.

It kinda works if you only use debuffs and/or buffs, though.
__________________
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
07-10-10, 05:56 AM   #5
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Quite funny, I'm just messing around with it today...
The fix was put together, when I don't use auras, but buffs and debuffs.

I will look into it again, perhaps I can find something working for all three possibilities.

k, this sucks...
Problem with my so called "fix" is, that everytime the update()-function is called, all icons are hidden. Then there is a conflict in SetPosition() and the icons are NOT set into position. Damn.

As you already mentioned, it works quite well, if you work with self.Buffs and self.Debuffs, but not with self.Auras. I think I'll stick for the moment with my fix for my UF and will delay my other project until August.

Last edited by Mischback : 07-10-10 at 06:34 AM.
  Reply With Quote
07-10-10, 08:57 AM   #6
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Nevermind, it's just very unlucky that haste is gone for so long, shortly after pushing 1.4 out to the public.
__________________
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
07-10-10, 09:23 AM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I'll point someone to this thread. There are a couple of people I've asked to do minor bug fixes while I'm on vacation. One of them might have some time to spend on this.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
07-10-10, 09:54 AM   #8
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
That would be awesome, thank you very much haste!
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Need some help on Aura filtering...


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off