Aura filtering problems
Good Morning,
I am trying to create an aura filter for my oUF layout and I am a bit struggling because it doesn't really work like I want it - and I have no idea why. Especially the target is the one who bothers me. Here's my filter code, which I am adding to my layout per Lua Code:
I've commented inside the code, what I am trying to do ... but yeah, it doesn't work out exactly. Lua Code:
Hopefully someone can help me with that. And sorry, if this is the wrong forum, I thought it would fit because it affects my oUF layout. :) |
What isn't working? How is what it's doing different than what you expect it to be doing?
Try adding print statements in there so you can see exactly what's happening; I would not recommend doing this while in a group or at a training dummy, however, unless you can read at superhuman speed. |
I coded while raiding, so couldn't spam my chat with print messages last night. That's where I found out, what was wrong.
The problem I have is that somehow in raid, it shows me *all* debuffs and ignores my filters, when I have line 31-32 in my filter. But when I delete them I don't have NPC buffs/debuffs on my target inside normal 5-man dungeons (like the alchemists in UBRS). Oh, also I added in the OP that I also use this filter on my target buffs, not only debuffs: Lua Code:
|
Well, all else aside, calling IsInInstance() in your aura filtering function, which is called once per active aura per UNIT_AURA event -- so, potentially thousands of times per second in a raid -- is rather wasteful. Much better to keep track of that outside the function (create a separate frame if you need to) and refer to a variable inside.
As for the problem at hand, the caster unit can be -- and often is -- nil for auras applied by NPCs. Try changing this: Code:
and not UnitPlayerControlled(caster) then Code:
and not (caster and UnitPlayerControlled(caster)) then |
Theoretically I don't need the IsInInstance anymore after that change, right? I mean I had it in my code just because I am sure I am in an instance or group - but if it works also out of a dungeon it's okay. Aslong buffs/debuffs from mobs are shown.
|
The problem is as I described -- buffs cast by players who are not currently in your group will also have a nil caster. If you don't care about that (mainly an issue in town) then no, you don't need to check that you're in an instance.
Also: 1. You may want to show all debuffs on yourself, even if you can't dispel them. 2. You can combine the first and third of these checks: Code:
-- show when debuff and by me |
Quote:
Quote:
Quote:
|
Quote:
|
Quote:
Thanks again, Phanx! :) |
Quote:
Code:
lib.AurasCustomFilter = { Code:
local instanceType |
That simple. Sometimes I can't see shit around me ... thanks again. I'll test it when I am home from work.
|
All times are GMT -6. The time now is 07:42 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI