WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   hiding own buffs if targeting yourself (https://www.wowinterface.com/forums/showthread.php?t=33213)

mankeluvsit 06-16-10 04:42 AM

hiding own buffs if targeting yourself
 
okay, i dont know if this is possible, to what i think, if i just if unit=="player" while targeting myself, it would deleted that "targets" buffs. but its only hiding my actual buffs. i know its not necessary to do this, but i really want to make it this way.

so how do i go along if i target myself, it wont show my buffs.
Quote:

-- TARGET

if unit=="target" then
-- TARGET DEBUFF

self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 22
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 11)
self.Debuffs:SetPoint("TOPLEFT", self, "TOPLEFT", -1,28)
self.Debuffs.initialAnchor = "TOPLEFT"
self.Debuffs["growth-y"] = "UP"
self.Debuffs["growth-x"] = "RIGHT"
self.Debuffs.cols = 1
self.Debuffs.num = 20
self.Debuffs.spacing = 1

-- TARGET BUFF


self.Auras = CreateFrame("Frame", nil, self)
self.Auras.size = 22
self.Auras:SetHeight(self.Auras.size)
self.Auras:SetWidth(self.Auras.size * 11)
self.Auras:SetPoint("TOPLEFT", self.Debuffs, "TOPLEFT", -1,28)
self.Auras.initialAnchor = "TOPLEFT"
self.Auras["growth-y"] = "UP"
self.Auras["growth-x"] = "RIGHT"
self.Auras.cols = 1
self.Auras.num = 20
self.Auras.spacing = 1

else

if unit=="player" then

self.Auras:Hide()

end

end

v6o 06-16-10 05:00 AM

Auras shows (by default) both buffs and debuffs in it's container while Buffs and Debuffs show their.. err.. respective auras.

If you're planning on keeping them separated then I suggest you use Buffs and Debuffs and not Auras

Open up oUF/elements/aura.lua and you'll see the options you can use.

I don't know if the indenting was lost when you posted but it's a lot easier to read the code with it.

When you're targeting yourself the unit of the frame is still target.
What you need to do is hook a function (again, look at aura.lua) or insert an element on the target unitframe that will hide the buffs whenever UnitGUID("target") == UnitGUID("player") or something similar.


All times are GMT -6. The time now is 03:31 PM.

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