View Single Post
02-28-14, 07:32 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by p3lim View Post
I wish you could apply them specifically to a tag instead of applying them globally, but there isn't a way without hacking on the element.
I'm not really sure what you mean by this. Adding events to the SharedEvents table doesn't do anything other than tell oUF to go ahead and process the event anyway if arg1 doesn't match the value of the unit key on the frame:

Code:
if(fontstring:IsVisible() and (unitlessEvents[event] or fontstring.parent.unit == unit)) then
Originally Posted by Pyrates View Post
So I know how to work around it alright, I'm just not happy about that solution.
Well, regardless of how happy or unhappy you are about it, that's the only solution. The PLAYER_* events only fire for the player unit -- your own character. If you want to show Dead/Offline/Ghost on other units' frames, you must use the UNIT_* events. UNIT_HEALTH will tell you when someone becomes dead or alive. UNIT_CONNECTION will tell you when someone goes offline or comes back online. If you want to track Ghost separately from Dead, you'll also need to listen to UNIT_AURA and look for UnitBuff(unit, GHOST) where GHOST is the result of GetSpellInfo(8326) or, if you don't care about non-English players, just UnitBuff(unit, "Ghost").

Your layout is presumably already responding to UNIT_HEALTH and UNIT_AURA to update things like health bars and buff icons, so having it additionally update your Dead/Offline/Ghost text on those events is really not adding any significant overhead.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote