Thread Tools Display Modes
06-06-09, 04:19 AM   #1
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Aura Icons: CustomFilters

I'm trying to use Aura Icon Filters within my layout, but anyform of testing wether an aura name exists in a table only causes the entire set of aura icons to be hidden.

Code:
local whitelist = {
	 ["Renew"] = true,
	 ["Power Word: Fortitude"] = true,
	 ["Prayer of Fortitude"] = true, 
	 ["Shadow Protection"] = true,
	 ["Prayer of Shadow Protection"] = true,
	 ["Divine Spirit"] = true,
	 ["Prayer of Spirit"] = true,
}

local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	icon.duration = duration
	icon.timeLeft = timeLeft
	icon.owner = caster

	return name and whitelist[name]
end
...

inside the style function :

Code:
self.CustomAuraFilter = customFilter
Variations of :

Code:
	if(name and whitelist[name])then
		return true
	end
don't seem to work either
  Reply With Quote
06-06-09, 04:46 AM   #2
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Code:
local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	icon.duration, icon.timeLeft,icon.owner = duration,timeLeft,caster

	print(name, whitelist[name])

	if(name == "Renew")then
		return name
	end

end
the print command there returns the name, and true for spell names that are in the table mentioned above.
  Reply With Quote
06-06-09, 05:45 AM   #3
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
There's nothing wrong with the code, at least I can't see anything.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
06-06-09, 06:13 AM   #4
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
what I don't understand right now is that when i do this :
Code:
local whitelist = {
	 ["Renew"] = true,
	 ["Power Word: Fortitude"] = true,
	 ["Prayer of Fortitude"] = true, 
	 ["Shadow Protection"] = true,
	 ["Prayer of Shadow Protection"] = true,
	 ["Divine Spirit"] = true,
	 ["Prayer of Spirit"] = true,
}

local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
 print(name,whitelist[name])
 return name
end
Then all the icons show (so no filtering occuring).

For testing : function prints the name of the aura and true if its in the table or nil if it's not.

Sometimes name == nil.

yet when I try to return false or nil based on a strings existance in the table as a key or wether simeple name == "Renew"...none of the icons end up showing regardless of matches

Last edited by jadakren : 06-06-09 at 06:16 AM.
  Reply With Quote
06-06-09, 07:02 AM   #5
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Code:
local whitelist = {
	 ["Renew"] = true,
	 ["Power Word: Fortitude"] = true,
	 ["Prayer of Fortitude"] = true, 
	 ["Shadow Protection"] = true,
	 ["Prayer of Shadow Protection"] = true,
	 ["Divine Spirit"] = true,
	 ["Prayer of Spirit"] = true,
}

local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	icon.duration, icon.timeLeft,icon.owner = duration,timeLeft,caster
	if(whitelist[name])then
		print(name, whitelist[name])	
		return true
	end
end
Nothing gets printed....
unless :

Code:
local whitelist = {
	 ["Renew"] = true,
	 ["Power Word: Fortitude"] = true,
	 ["Prayer of Fortitude"] = true, 
	 ["Shadow Protection"] = true,
	 ["Prayer of Shadow Protection"] = true,
	 ["Divine Spirit"] = true,
	 ["Prayer of Spirit"] = true,
	 ["Heroic Presence"] = true,
}
If i try to hide the first buff ("Heroic Presence") then none of them will show.
  Reply With Quote
06-06-09, 08:08 AM   #6
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Code:
local whitelist = {
	 ["Renew"] = true,
	 ["Power Word: Fortitude"] = true,
	 ["Prayer of Fortitude"] = true, 
	 ["Shadow Protection"] = true,
	 ["Prayer of Shadow Protection"] = true,
	 ["Divine Spirit"] = true,
	 ["Prayer of Spirit"] = true,
--	 ["Heroic Presence"] = true,
	 ["Weakened Soul"] = true,
}

local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	print(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	return whitelist[name] or nil
end
Not targeting anyone, /console reloadui and chatframe contains :
Code:
23:37:14table: 1BC95F38 player table: 18A49B40 Heroic Presence Racial Passive Interface\Icons\INV_Helmet_21 0 nil 0 0 player
23:37:14table: 1BC95F10 player table: 18A49D98 nil nil nil nil nil nil nil nil
  Reply With Quote
06-06-09, 08:23 AM   #7
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
I tested your first code blocks (opening post) with both "Buffs" & "Auras" (not Debuffs) and it worked as intended which I thought it would. The rest you've posted also looks correct.

The proof: http://img191.imageshack.us/img191/849/proofv.jpg

I think you'd be better off if you posted your layout/style.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 06-06-09 at 08:42 AM.
  Reply With Quote
06-06-09, 09:00 AM   #8
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Originally Posted by Yourstruly View Post
I think you'd be better off if you posted your layout/style.
http://github.com/airtonix/oufsmee2/...e.lua#L218-234
  Reply With Quote
06-06-09, 04:15 PM   #9
ProperMethodz
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 13
Hey Smee:

http://www.wowinterface.com/forums/s...ad.php?t=24424
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Aura Icons: CustomFilters


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