View Single Post
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