Thread Tools Display Modes
07-23-09, 12:28 PM   #1
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Multiple elements for the same unit in one style - Possible?

Without using multiple styles is it possible to, for example, create two buff elements for the same unit, one filtered with a white list and one filtered with a black list (in essence moving certain buffs)? I've been trying to figure out how to get this to work for my layout but I can't figure out how it might be possible without making multiple styles. If I do that I run into the issue of having to spawn an invisible unit -- at least I think I do! That just doesn't sound ideal to me.
  Reply With Quote
07-25-09, 09:25 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Sojik View Post
Without using multiple styles is it possible to, for example, create two buff elements for the same unit, one filtered with a white list and one filtered with a black list (in essence moving certain buffs)? I've been trying to figure out how to get this to work for my layout but I can't figure out how it might be possible without making multiple styles. If I do that I run into the issue of having to spawn an invisible unit -- at least I think I do! That just doesn't sound ideal to me.
Use one buff and one aura (with numDebuffs set to zero)
  Reply With Quote
07-25-09, 09:34 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
I used to use Elkhano Buff Bars before finding nUI and that enabled multiple blocks of auras that could be filtered. I used to use a special one just for Krosh Firehand to watch for his buff so I could steal it.
__________________
  Reply With Quote
07-25-09, 09:36 AM   #4
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
I approach this by passing a configuration table into a function that creates the aura frame based on the data found in the table.

What i currently have is two hardcoded tables for buffs and debuffs, which i pass both into the aura frame creator.

However, taking your idea i would have to group these tables under a common table.

Code:
frameName = {
 ... settings--blah ...
 auras = {
   buffs = {
     ... settings--blah ...
   },
   debuffs = { 
     ... settings--blah ...
   },
   whitelist = { 
     ... settings--blah ...
   },
 }
}
then I would only need to step through the aura frames in the config table passing each one to the aura frame creator function

Code:
for auraFrameName,auraFrameData in pairs(addon.db.frameName.auras)do
 addon:CreateAuraFrame(self, auraFrameName, auraFrameData)
end

Code:
function addon:CreateAuraFrame(unitFrame,auraFrameName,auraFrameData)
 if not auraFrameName or not auraFrameData then return end
 local auraFrame = CreateFrame
 ..blah blah..process data..blah blah..
 frame[auraFrameName] = auraFrame
end
  Reply With Quote
07-25-09, 09:37 AM   #5
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Originally Posted by Xrystal View Post
I used to use Elkhano Buff Bars before finding nUI and that enabled multiple blocks of auras that could be filtered. I used to use a special one just for Krosh Firehand to watch for his buff so I could steal it.
This is a forum for oUF and customising it through creating layouts for it.

not about nUI, nor about using other standalone addons.
  Reply With Quote
07-26-09, 04:33 PM   #6
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Originally Posted by jadakren View Post
I approach this by passing a configuration table into a function that creates the aura frame based on the data found in the table.

What i currently have is two hardcoded tables for buffs and debuffs, which i pass both into the aura frame creator.

However, taking your idea i would have to group these tables under a common table.

Code:
frameName = {
 ... settings--blah ...
 auras = {
   buffs = {
     ... settings--blah ...
   },
   debuffs = { 
     ... settings--blah ...
   },
   whitelist = { 
     ... settings--blah ...
   },
 }
}
then I would only need to step through the aura frames in the config table passing each one to the aura frame creator function

Code:
for auraFrameName,auraFrameData in pairs(addon.db.frameName.auras)do
 addon:CreateAuraFrame(self, auraFrameName, auraFrameData)
end
Code:
function addon:CreateAuraFrame(unitFrame,auraFrameName,auraFrameData)
 if not auraFrameName or not auraFrameData then return end
 local auraFrame = CreateFrame
 ..blah blah..process data..blah blah..
 frame[auraFrameName] = auraFrame
end
I'm going to figure this out.
  Reply With Quote
07-26-09, 04:53 PM   #7
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Is there anyway to have CustomAuraFilter only apply to self.debuff so that I can make a different CustomAuraFilter for self.aura?
  Reply With Quote
07-27-09, 02:37 AM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I think what p3lim posted should fit your needs. One function for default buffs, one for default debuffs and one for player-specific debuffs or buffs.

Something like this
Code:
  --buff func
  local function d3o2_createBuffs(self,unit)
    self.Buffs = CreateFrame("Frame", nil, self)
    self.Buffs.size = 20
    self.Buffs.num = 40
    self.Buffs:SetHeight((self.Buffs.size+5)*3)
    self.Buffs:SetWidth(self:GetWidth())
    self.Buffs:SetPoint("BOTTOMLEFT", self, "TOPRIGHT", 20, 15)
    self.Buffs.initialAnchor = "BOTTOMLEFT"
    self.Buffs["growth-x"] = "RIGHT"
    self.Buffs["growth-y"] = "UP"
    self.Buffs.spacing = 5
  end
  
  --debuff func
  local function d3o2_createDebuffs(self,unit)
    self.Debuffs = CreateFrame("Frame", nil, self)
    self.Debuffs.size = 20
    self.Debuffs.num = 40
    self.Debuffs:SetHeight((self.Debuffs.size+5)*3)
    self.Debuffs:SetWidth(self:GetWidth())
    self.Debuffs:SetPoint("TOPLEFT", self, "BOTTOMRIGHT", 20, -15)
    self.Debuffs.initialAnchor = "TOPLEFT"
    self.Debuffs["growth-x"] = "RIGHT"
    self.Debuffs["growth-y"] = "DOWN"
    self.Debuffs.spacing = 5
    self.Debuffs.onlyShowPlayer = false
    self.Debuffs.showDebuffType = false
  end
  
  --aura func
  local function d3o2_createAura(self,unit)
    self.Aura = CreateFrame("Frame", nil, self)
    self.Aura.size = 30
    self.Aura.numBuffs = 0
    self.Aura.numDebuffs = 5
    self.Aura.spacing = 5
    self.Aura:SetHeight(self.Aura.size)
    self.Aura:SetWidth((self.Aura.size+self.Aura.spacing)*self.Aura.numDebuffs)
    self.Aura:SetPoint("TOPLEFT", self, "BOTTOMRIGHT", 20, -55)
    self.Aura.initialAnchor = "TOPLEFT"
    self.Aura["growth-x"] = "RIGHT"
    self.Aura["growth-y"] = "DOWN"
    self.Aura.onlyShowPlayer = true
    self.Aura.showDebuffType = false
  end
You need to place them somewhere else though.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 07-27-09 at 02:41 AM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Multiple elements for the same unit in one style - Possible?

Thread Tools
Display Modes

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