Thread Tools Display Modes
05-05-09, 04:44 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Raid indicators with tag events

Is it only possible to use the tag system for font strings or can we even use it for textures?

I finally got my heal druid to 80 and had some problems tracking my hots in raids.

p3lim posted a nice idea for tracking mark of the wild on another thread that got me thinking. What I finally want is 4 indicators in the 4 edges of my raidframe, indicating each druid hot. Regrowth, Rejuventation, Lifebloom and Wildgrowth.

What I am asking myself: Is it possible to apply tag-events to textures or frames aswell, or is it fontstring only? Fontstring only I guess.

Idea with using fontstring
Code:
oUF.Tags["[checkreju]"] = function(unit) 
  if UnitAura(unit, "Rejuvenation", "HELPFUL|PLAYER") then
    return "r"
  else
    return ""
  end
end
oUF.TagEvents["[checkreju]"] = "UNIT_AURA"

local RejuIndicator = SetFontString(self.Health, d3font, 16, "THINOUTLINE")
RejuIndicator:SetPoint("TOPLEFT",3,-3)
self:Tag(RejuIndicator, "[checkreju]")
I dont know if this condition does work though:
Code:
if UnitAura(unit, "Rejuvenation", "HELPFUL|PLAYER") then
I mean when I try adding a filter.

Whats kind of disturbing is that the documentation says that http://www.wowwiki.com/API_UnitAura needs a unit and the "index" of the buff/debuff. But is does seem to work by using the spellname aswell.

What I am kind of afraid is the sheer number of UNIT_AURA events in raids.

The problem with this is, that if I have 4 different indicators with 4 different events I think its 4x the load as if I would anchor the UNIT_AURA event to self myself and create a custom function that tries to find the buffs on the player.

I don't know whats faster: UnitAura(unit, "Rejuvenation", "HELPFUL|PLAYER") or going through 1,40 buffs each UNIT_AURA checking for the 4 possible buffs.
__________________
| 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 : 05-05-09 at 05:02 AM.
  Reply With Quote
05-05-09, 08:10 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
I use the following to check if the unit has Gift/Mark of the Wild on them in my raid layout (oUF Mini)

Code:
local gift, mark = GetSpellInfo(21849), GetSpellInfo(1126)

oUF.Tags['[misswild]'] = function(u) return (not UnitAura(u, gift) and not UnitAura(u, mark)) and '|cffff33ff!|r' end
oUF.TagEvents['[misswild]'] = 'UNIT_AURA'
and dont return an empty string, it messes up the tag system

Last edited by p3lim : 05-05-09 at 08:13 AM.
  Reply With Quote
05-05-09, 09:09 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Yes, I know how you implemented Mark of the wild, but does this work when trying to add filters aswell? That's the question I had!

Code:
local spell = GetSpellInfo(spellid)
local filter = "HELPFUL|player"
if UnitAura(u, spell, filter) then
 ...
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)
  Reply With Quote
05-05-09, 09:19 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by zork View Post
Yes, I know how you implemented Mark of the wild, but does this work when trying to add filters aswell? That's the question I had!

Code:
local spell = GetSpellInfo(spellid)
local filter = "HELPFUL|player"
if UnitAura(u, spell, filter) then
 ...
end
Try it? (too short)
  Reply With Quote
05-05-09, 11:23 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
local reju, regrowth, lifebloom, wildgrowth = GetSpellInfo(48440), GetSpellInfo(48443), GetSpellInfo(48450), GetSpellInfo(53249)

Doesn't work for me:
Code:
  oUF.Tags['[checkreju]'] = function(u) 
    local filter = "HELPFUL|PLAYER"
    if UnitAura(u, reju, filter) then
      return "#"
    else
      return "~"
    end
  end
  oUF.TagEvents['[checkreju]'] = 'UNIT_AURA'
Works:
Code:
  oUF.Tags['[checkreju]'] = function(u) 
    local filter = "HELPFUL|PLAYER"
    if UnitAura(u, reju) then
      return "#"
    else
      return "~"
    end
  end
  oUF.TagEvents['[checkreju]'] = 'UNIT_AURA'
So either I am using the filter wrong or filtering just does not work in combination with the name. Tried any combination of the filter. None does work.
__________________
| 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
05-05-09, 12:30 PM   #6
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
from wowwiki
This parameter can be any of "HELPFUL", "HARMFUL", "PLAYER", "RAID", "CANCELABLE", "NOT_CANCELABLE". You can also specify several filters separated by a | or space character to chain multiple filters together (e.g. "HELPFUL|RAID" or "HELPFUL RAID" == helpful buffs that you can cast on your raid). By default UnitAura has "HELPFUL" as an implicit filter - you cannot get back BOTH helpful and harmful at the same time. Neither "HELPFUL" or "HARMFUL" have meaning for UnitBuff/UnitDebuff, and will be ignored.
Use 'PLAYER', not 'HELPFUL|PLAYER'
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Raid indicators with tag events


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