Thread Tools Display Modes
11-30-11, 06:26 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Raid Aura Icons

I'm currently thinking about a new aura function for my raidframes. I want to display all aura icons being part of a boss encounter or spellid-whitelist.

The customfilter is searching for "boss" in the caster variable. If that is not found it tries to match the spellid.
Not sure if caster is actually filled with "boss" in boss encounters.

*edit* I just found out about "isBossDebuff". Nice.

*edit2*
This is what I'm currently using. Cannot test raid fights atm:
lua Code:
  1. --whitelist
  2.   local whitelist = {}
  3.   if cfg.units.raid.auras.whitelist then
  4.     for _,spellid in pairs(cfg.units.raid.auras.whitelist) do
  5.       local spell = GetSpellInfo(spellid)
  6.       if spell then whitelist[spellid] = true end
  7.     end
  8.   end
  9.  
  10.   --blacklist
  11.   local blacklist = {}
  12.   if cfg.units.raid.auras.blacklist then
  13.     for _,spellid in pairs(cfg.units.raid.auras.blacklist) do
  14.       local spell = GetSpellInfo(spellid)
  15.       if spell then blacklist[spellid] = true end
  16.     end
  17.   end
  18.  
  19.   --custom aura filter
  20.   local customFilter = function(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff)
  21.     local ret = false
  22.     if(blacklist[spellID]) then
  23.       ret = false
  24.     elseif(whitelist[spellID]) then
  25.       ret = true
  26.     elseif isBossDebuff then
  27.       ret = true
  28.     elseif caster and caster:match("(boss)%d?$") == "boss" then
  29.       ret = true
  30.     end
  31.     return ret
  32.   end
  33.  
  34.   --create aura func
  35.   local createAuras = function(self)
  36.     local f = CreateFrame("Frame", nil, self)
  37.     local cfg = self.cfg.auras
  38.     f.size = cfg.size or 26
  39.     f.num = cfg.num or 5
  40.     f.spacing = cfg.spacing or 5
  41.     f.initialAnchor = cfg.initialAnchor or "TOPLEFT"
  42.     f["growth-x"] = cfg.growthX or "RIGHT"
  43.     f["growth-y"] = cfg.growthY or "DOWN"
  44.     f.disableCooldown = cfg.disableCooldown or false
  45.     f.showDebuffType = cfg.showDebuffType or false
  46.     f.showBuffType = cfg.showBuffType or false
  47.     if not cfg.doNotUseCustomFilter then
  48.       f.CustomFilter = customFilter
  49.     end
  50.     f:SetHeight(f.size)
  51.     f:SetWidth((f.size+f.spacing)*f.num)
  52.     if cfg.pos then
  53.       f:SetPoint(cfg.pos.a1 or "CENTER", self, cfg.pos.a2 or "CENTER", cfg.pos.x or 0, cfg.pos.y or 0)
  54.     else
  55.       f:SetPoint("CENTER",0,-5)
  56.     end
  57.     self.Auras = f
  58.   end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 11-30-11 at 03:37 PM.
  Reply With Quote
12-04-11, 11:19 AM   #2
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by zork View Post
I'm currently thinking about a new aura function for my raidframes. I want to display all aura icons being part of a boss encounter or spellid-whitelist.

The customfilter is searching for "boss" in the caster variable. If that is not found it tries to match the spellid.
Not sure if caster is actually filled with "boss" in boss encounters.

*edit* I just found out about "isBossDebuff". Nice.

*edit2*
This is what I'm currently using. Cannot test raid fights atm:
lua Code:
  1. --whitelist
  2.   local whitelist = {}
  3.   if cfg.units.raid.auras.whitelist then
  4.     for _,spellid in pairs(cfg.units.raid.auras.whitelist) do
  5.       local spell = GetSpellInfo(spellid)
  6.       if spell then whitelist[spellid] = true end
  7.     end
  8.   end
  9.  
  10.   --blacklist
  11.   local blacklist = {}
  12.   if cfg.units.raid.auras.blacklist then
  13.     for _,spellid in pairs(cfg.units.raid.auras.blacklist) do
  14.       local spell = GetSpellInfo(spellid)
  15.       if spell then blacklist[spellid] = true end
  16.     end
  17.   end
  18.  
  19.   --custom aura filter
  20.   local customFilter = function(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff)
  21.     local ret = false
  22.     if(blacklist[spellID]) then
  23.       ret = false
  24.     elseif(whitelist[spellID]) then
  25.       ret = true
  26.     elseif isBossDebuff then
  27.       ret = true
  28.     elseif caster and caster:match("(boss)%d?$") == "boss" then
  29.       ret = true
  30.     end
  31.     return ret
  32.   end
  33.  
  34.   --create aura func
  35.   local createAuras = function(self)
  36.     local f = CreateFrame("Frame", nil, self)
  37.     local cfg = self.cfg.auras
  38.     f.size = cfg.size or 26
  39.     f.num = cfg.num or 5
  40.     f.spacing = cfg.spacing or 5
  41.     f.initialAnchor = cfg.initialAnchor or "TOPLEFT"
  42.     f["growth-x"] = cfg.growthX or "RIGHT"
  43.     f["growth-y"] = cfg.growthY or "DOWN"
  44.     f.disableCooldown = cfg.disableCooldown or false
  45.     f.showDebuffType = cfg.showDebuffType or false
  46.     f.showBuffType = cfg.showBuffType or false
  47.     if not cfg.doNotUseCustomFilter then
  48.       f.CustomFilter = customFilter
  49.     end
  50.     f:SetHeight(f.size)
  51.     f:SetWidth((f.size+f.spacing)*f.num)
  52.     if cfg.pos then
  53.       f:SetPoint(cfg.pos.a1 or "CENTER", self, cfg.pos.a2 or "CENTER", cfg.pos.x or 0, cfg.pos.y or 0)
  54.     else
  55.       f:SetPoint("CENTER",0,-5)
  56.     end
  57.     self.Auras = f
  58.   end
Chould try this.
  Reply With Quote
12-05-11, 04:53 AM   #3
Lysiander
An Aku'mai Servant
Join Date: Dec 2007
Posts: 37
I'd like to point out that depending on how many auras you are actually showing, you might run into problems with this design as it lacks a priority system. This might lead to more recently applied auras overriding more important, previously applied, ones. It also robs you of the option to display important trash auras since those don't come with the boss tag in the isBossDebuff variable.

It does however open up the option to reverse the logic of traditional raid aura design. Currently, most addons that provide this functionality hide everything by default and only show what is present on a specific table. Your idea could be utilized to whitelist all boss debuffs and then check a blacklist table with stuff to hide. However, this also does not provide priority functionality or the ability to display trash auras, unless an additional check table is implemented. This might end up being much more trouble than the current standart design.

Just thought I'd point out potential problems before you run into them in a life raid like I did. No offense.
  Reply With Quote
12-05-11, 07:54 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Obiously that only works on raid layouts that can display probably more that one aura icon.

Trash)
That is what the whitelist is for. Put any spells in there that do not fall under the boss criteria but that you want to display.
Hide unimportant)
Put all boss aura icons that can hide under the blacklist.
Both tables are already implemented.

What is missing is a superb method that allows adding/removing aura icons to/from black/whitelist on the fly.

Best would be probably by targeting the unit with the specific aura and clicking the aura frame by holding down a special key. (Shift+LeftClick = add to whitelist, Shift+RightClick = remove from whitelist, Alt+LeftClick = add to whitelist, Alt+RightClick = remove from whitelist)

It is actually quite possible by adding a click event to the aura frame.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote

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


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