Thread Tools Display Modes
10-11-11, 04:57 PM   #1
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
Help with displaying boss debuffs on raid frames

I'm trying to get certain debuffs to appear on my raid frames and I'm having some trouble figuring out how to filter them.

Layout code
Code:
	if self.raid then
		if whitelist.RaidDebuffs then
			-- raid debuffs testing----------------------------------------------------
			self.Debuffs = CreateFrame('Frame', nil, self)
			self.Debuffs.spacing = 1
			self.Debuffs.initialAnchor = 'TOPLEFT'
			self.Debuffs['growth-y'] = 'DOWN'
			self.Debuffs['growth-x'] = 'RIGHT'
			-- tiny icons
			self.Debuffs.numDebuffs	= 3
			self.Debuffs.size 		= 8
			self.Debuffs.spacing		= 1

			self.Debuffs:SetWidth(self.sizes.w)
			self.Debuffs:SetHeight(self.sizes.h)

			self.Debuffs:SetPoint('TOPLEFT', self.Health, 0, 0)
			self.Debuffs.CustomFilter	= ok.CustomAuraFilterRaid
		end
Whitelist module
Code:
local whitelist = {
RaidDebuffs = {
[GetSpellInfo(8921)] 	= { color = { 1, 0, 0 }},	--moonfire testing
	},
}
CustomAuraFilter code
Code:
function ok.CustomAuraFilterRaid(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	if caster == 'player' then
		if	type(whitelist[ok.class][name]) == 'table' and
			whitelist[ok.class][name].colour
		then
			icon.colour = whitelist[ok.class][name].colour
			icon.maxc = whitelist[ok.class][name].maxc or nil
			return true
		end
	--end
	else -- added as a test to see if I can get debuff tracking on raid frames
		if	type(whitelist.RaidDebuffs[name]) == 'table' and
			whitelist.RaidDebuffs.colour
		then
			icon.colour = whitelist.RaidDebuffs.colour
			icon.maxc = whitelist.RaidDebuffs.maxc or nil
			return true
		end
	end
end
I'm obviously missing something, because debuffs are not appearing on my raid frames. If I take out the customaurafiltering I can get any debuff to appear on my raid frames.

Any ideas?

EDIT: I'm fairly certain I'm either doing the table wrong or calling the table wrong in the function. Any and all tips would be appreciated.

EDIT #2: I removed all the other sections in the whitelist, it would of been crazy long otherwise.

Last edited by maltese : 10-11-11 at 07:00 PM.
  Reply With Quote
10-11-11, 10:55 PM   #2
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
You're in fact doing your lookup wrong... Look at the structure of your RaidDebuffs-table, there's another key (name of the spell) in it.

Try this:
lua Code:
  1. function ok.CustomAuraFilterRaid(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID)
  2.         if  type(whitelist.RaidDebuffs[name]) == 'table' and
  3.             whitelist.RaidDebuffs.colour
  4.         then
  5.             icon.colour = whitelist.RaidDebuffs[name].colour
  6.             icon.maxc = whitelist.RaidDebuffs.maxc or nil
  7.             return true
  8.         end
  9.     end
  10. end
__________________
  Reply With Quote
10-12-11, 08:14 AM   #3
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
wow... what a silly error indeed. Thanks for the help.

As an update, once I fixed that (as well as removed some unnecessary code), I was having an issue with the debuffs being shown with the buffs as well. Obviously you guys couldnt of helped with that because I didn't post all the code, but I did manage to get that fixed. Thanks again.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Help with displaying boss debuffs on raid frames


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