WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Buff Icon on a party members frame (https://www.wowinterface.com/forums/showthread.php?t=30840)

r1pt1de 02-21-10 01:30 PM

Buff Icon on a party members frame
 
I play a resto shaman and would like to add a buff icon to the party frame of the member I cast earth shield on. My goal is to be able to quickly identify whether or not earth shield is still present, and possibly the remaining charges. If this is possible, could you point me in the right direction?

Rostok 02-21-10 02:18 PM

I think you have two easy solutions :

1. Use a custom tag ala Freeb in oUF_Freebgrid
2. Use oUF_AuraWatch

Code:

--Shaman
49284, --Earth Shield
61301, --Riptide
52000, --Earthliving

elseif class == 'SHAMAN' then
        if i==11 then         
                icon:SetPoint('BOTTOMRIGHT',0,0)
                tex:SetVertexColor(140/255,95/255,75/255)
                local count = icon:CreateFontString(nil, 'OVERLAY')
                count:SetFont(db.font, db.fontsize-2, 'OUTLINE')
                count:SetPoint('CENTER', -6, 1)
                icon.count = count
        elseif i==12 then
                icon:SetPoint('TOPLEFT',0,0)
                tex:SetVertexColor(100/255,200/255,200/255)
        elseif i==13 then
                icon:SetPoint('BOTTOMLEFT',0,0)
                tex:SetVertexColor(100/255,200/255,140/255)
        end

Just change the i== with the correct number reference and you're done.

Taroven 02-22-10 08:03 AM

Custom tags are the way to go, and fairly easy to do.

Code:

local myES = select(8,UnitBuff(unit,"Earth Shield")) == 'player'
You'll need to figure out how to use that in a tag. Event to watch is UNIT_AURA. If you need the number of stacks and not just whether or not the buff is there, it's about the same deal with a full list of UnitBuff returns.

r1pt1de 02-22-10 08:55 AM

Thank you both for your replies, gonna try and implement this myself. Searching for help on the tags now. Really new to LUA so not sure if im gonna be able to get it though hahaha. Would you two mind if I asked for more help later on if I cant figure this out?

Rostok 02-22-10 09:34 AM

No problem !

There's the tags I added when I used oUF_Freebgrid :

Code:

oUF.Tags['[rip]'] = function(u)
        local name, _,_,_,_,_,_, fromwho,_ = UnitAura(u, 'Riptide')
        if not (fromwho == 'player') then return end
        if UnitAura(u, 'Riptide') then return '|cff00FEBFM|r' end end
oUF.TagEvents['[rip]'] = 'UNIT_AURA'

oUF.Tags['[ripTime]'] = function(u)
        local name, _,_,_,_,_, expirationTime, fromwho,_ = UnitAura(u, 'Riptide')
        if not (fromwho == 'player') then return end
        local spellTimer = '|cffffff00'..format('%.0f',-1*(GetTime()-expirationTime))..'|r'
        return spellTimer end
oUF.TagEvents['[ripTime]'] = 'UNIT_AURA'

oUF.earthCount = {'i','h','g','f','p','q','Z','Y'}
oUF.Tags['[earth]'] = function(u) local c = select(4, UnitAura(u, 'Earth Shield')) if c then return '|cffFFCF7F'..oUF.earthCount[c]..'|r' end end
oUF.TagEvents['[earth]'] = 'UNIT_AURA'

with the font you can found in oUF_Freebgrid, you can add a tag in your layout :

Code:

local myES = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
myES:SetFont(symbolfont, fontsize)    --  the symbol font
myES:SetShadowColor(0,0,0)
myES:SetShadowOffset(1.25,-1.25)
myES:SetPoint('CENTER', self.Health, 'BOTTOMRIGHT', 0, 0)
self:Tag(myES, '[earth]')

Do the same thing if you want the riptide and the riptime tags.


All times are GMT -6. The time now is 07:21 AM.

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