Originally Posted by jadakren
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.