WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF Perfect - Adding Other Debuff Types (https://www.wowinterface.com/forums/showthread.php?t=18733)

blackpandemic 10-18-08 04:52 PM

oUF Perfect - Adding Other Debuff Types
 
Hey modders!

Let me start by saying thanks to anyone who develops mods and updated so quickly with the 3.0 change!

My question is, I've started using oUF as it's the best unit frame mod on the market IMO and I've started using p3lim's template as well as his oUF_Perfect (http://www.wowinterface.com/download...UFPerfect.html).

Included are small text overlays which tell when the raid/party member is poisoned/cursed (as p3lim plays a druid) but I would also like to add magic debuffs (and perhaps stuns).

The lines of code where these are located is:
oUF.Tags['[inner]'] = function(u) return UnitAura(u, 'Innervate') and '|cff00ff33Inn|r' or '' end
oUF.Tags['[afk]'] = function(u) return UnitIsAFK(u) and '<AFK>' or '' end

local function HasDType(unit, t)
for i=1,40 do
local name,_,_,_,dtype = UnitDebuff(unit, i)
if(name and dtype == t) then return true end
return false
end
end

oUF.Tags['[curse]'] = function(u) return HasDType(u, 'Curse') and '|cff9900ffCu|r ' or '' end
oUF.Tags['[poison]'] = function(u) return HasDType(u, 'Poison') and '|cff009900Po|r ' or '' end

oUF.TagEvents['[smarthp]'] = 'UNIT_HEALTH'
oUF.TagEvents['[smartpp]'] = 'UNIT_POWER UNIT_DISPLAYPOWER'
oUF.TagEvents['[inner]'] = 'UNIT_AURA'
oUF.TagEvents['[afk]'] = 'PLAYER_FLAGS_CHANGED'

oUF.TagEvents['[curse]'] = 'UNIT_AURA'
oUF.TagEvents['[poison]'] = 'UNIT_AURA'

My question is do I just add lines that say:
oUF.Tags['[magic]'] = function(u) return HasDType(u, 'Magic') and '<color> ' or '' end
oUF.TagEvents['[magic]'] = 'UNIT_AURA'


Last time I tried to edit LUA like this (beyond positioning, text, and textures) I broke the addon, so just wanted to run this idea by the people who actually know what to do before breaking anything else :)

p3lim 10-18-08 05:02 PM

It should work, but test before asking :)

blackpandemic 10-18-08 05:32 PM

Haven't found a willing soul to group with me to test, but as a more general LUA question, what will prevent it from showing my Mg tag when people are buffed, as aren't those magic?

Is there something in that code that will limit it to magic debuffs?

EDIT: Restarted my coding, will edit again when I can get a magic debuff.

p3lim 10-19-08 06:41 AM

Quote:

Originally Posted by blackpandemic (Post 105284)
Haven't found a willing soul to group with me to test, but as a more general LUA question, what will prevent it from showing my Mg tag when people are buffed, as aren't those magic?

Is there something in that code that will limit it to magic debuffs?

this line perhaps?
Quote:

local name,_,_,_,dtype = UnitDebuff(unit, i)


All times are GMT -6. The time now is 01:03 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI