Thread Tools Display Modes
04-01-10, 07:36 PM   #1
Sideshow
A Flamescale Wyrmkin
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 103
Debuff filter OK, now Buff filter ?

Hello

Wondering why this works for the sunder on my target, but not for my own buff when I have a bloodsurge proc ?
I tried with battle shout and nothing works, as soon as I use the filter, no bufs are displayed.
Any help?

Code:
local filter = {
	[GetSpellInfo(47467)] = true, -- sunder armor(highest rank)
	[GetSpellInfo(46916)] = true, -- slam! (bloodsurge)
}

local function customFilter(icons, unit, icon, name, rank, texture, count, dtype, duration, expiration, caster)
	if(filter[name]) then
		return true
	end 
end
Code:
	-- Buffs on player
	if(unit == 'player') then
		self.Buffs = CreateFrame("Frame", nil, self)
		self.Buffs:SetPoint("RIGHT", self, "LEFT")
		self.Buffs:SetHeight(30)
		self.Buffs:SetWidth(30)
		self.Buffs.initialAnchor = "RIGHT"
		self.Buffs.size = 30
		self.Buffs["growth-x"] = "LEFT"
		self.Buffs.num = 1
	end
	
	-- Debuffs on target
	if(unit == 'target') then
		self.Debuffs = CreateFrame("Frame", nil, self)
		self.Debuffs:SetPoint("TOP", self, "BOTTOM")
		self.Debuffs:SetHeight(30)
		self.Debuffs:SetWidth(width)
		self.Debuffs.initialAnchor = "TOPLEFT"
		self.Debuffs.size = 30
		--self.Debuffs.showDebuffType = true
		--self.Debuffs.num = math.floor(width / self.Debuffs.size + .5)
		self.Debuffs["growth-x"] = "RIGHT"
		self.Debuffs["growth-y"] = "DOWN"
		self.PostCreateAuraIcon = auraIcon
	end
	
	self.CustomAuraFilter = customFilter

Last edited by Sideshow : 04-01-10 at 07:40 PM.
  Reply With Quote
04-02-10, 01:39 AM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
It can be that it is the wrong ID for the buff/debuff. If you have time you can use this macro to get the information about a buff you currently have your mouse over.

Code:
/script local f=GetMouseFocus(); print( UnitAura( f:GetParent():GetParent().unit , f:GetID() , f.filter ) )
__________________
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
04-02-10, 05:27 AM   #3
Sideshow
A Flamescale Wyrmkin
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 103
Thanks

I checked the combat events with Devtools and I'm 100% sure the id is right
  Reply With Quote
04-02-10, 05:35 AM   #4
Sideshow
A Flamescale Wyrmkin
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 103
I did a simple test a put "print(name)" as the first line in "function customfilter"

For some reason, it does not trigger on buffs at all ...
  Reply With Quote
04-02-10, 11:36 AM   #5
Sideshow
A Flamescale Wyrmkin
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 103
After some more tests, I can say that sometimes my buff is shown, sometimes not ....

I tested with battle shout again when I was fighting a testdummy. The buff appeared 4 seconds or so after I casted it ... but sometimes, it does not appear at all ...

Same with bloodsurge - it procced like 10 times in a couple of minutes, but it was only shown once!


*edit: 1 more test: just when doing nothing, casting bloodrage and battle shout ... the buff appears seemingly not completely random 10 seconds afterwards... since bloodrage is 10 seconds

Last edited by Sideshow : 04-02-10 at 11:48 AM.
  Reply With Quote
04-02-10, 11:51 AM   #6
Sideshow
A Flamescale Wyrmkin
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 103
SOLVED

It seems that self.Buffs.num = 1 does not ONLY take into account the shown buffs, but just all

;-)
  Reply With Quote
04-03-10, 04:00 PM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Sideshow View Post
SOLVED

It seems that self.Buffs.num = 1 does not ONLY take into account the shown buffs, but just all

;-)
.num only indicates how far oUF should iterate. Which you've kinda discovered by now, but your wording seemed confused. If you only want to display a single icon based on a filter list, then it's kinda easier to just write your own element to do that.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Debuff filter OK, now Buff filter ?


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