Thread Tools Display Modes
06-16-10, 04:42 AM   #1
mankeluvsit
An Onyxian Warder
 
mankeluvsit's Avatar
Join Date: Sep 2008
Posts: 354
Lightbulb 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.
-- 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
  Reply With Quote
06-16-10, 05:00 AM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
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.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » hiding own buffs if targeting yourself


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off