Thank you for your answer, it made me look at it again today. The reason I was confused was that I had made a layout for bosstarget, but it just disregarded it, I guess because they are actually named boss1target etc. I had supposed that the frames would not spawn if that was the problem, but they did.
I think I figured it out now, through some trial and error. I found the code for arenatarget frames and copied that, and it seems to work, but I haven't tested in a raid yet.
This is how I tried to spawn them before:
Code:
if cfg.uf.bosstarget then
for i = 1, MAX_BOSS_FRAMES do
spawnHelper(self, 'boss'.. i ..'target', 'LEFT', cfg.unit_positions.Bosstarget.a, 'RIGHT', cfg.unit_positions.Bosstarget.x, cfg.unit_positions.Bosstarget.y - (52 * i))
end
end
or
Code:
spawnHelper(self, 'boss1target', 'LEFT', cfg.unit_positions.Bosstarget.a, 'RIGHT', cfg.unit_positions.Bosstarget.x, cfg.unit_positions.Bosstarget.y-52)
I guess this code chooses the layout:
Code:
local spawnHelper = function(self, unit, ...)
if(UnitSpecific[unit]) then
self:SetActiveStyle('Skaarj - ' .. unit:gsub('^%l', string.upper))
elseif(UnitSpecific[unit:match('[^%d]+')]) then
self:SetActiveStyle('Skaarj - ' .. unit:match('[^%d]+'):gsub('^%l', string.upper))
else
self:SetActiveStyle'Skaarj'
end
local object = self:Spawn(unit)
object:SetPoint(...)
return object
end
Now I do this:
Code:
local bosstarget = {}
self:SetActiveStyle'Skaarj - Pet'
for i = 1, MAX_BOSS_FRAMES do
bosstarget[i] = self:Spawn('boss'..i..'target', 'oUF_Boss'..i..'target')
bosstarget[i]:SetPoint('LEFT', cfg.unit_positions.Bosstarget.a, 'RIGHT', cfg.unit_positions.Bosstarget.x, cfg.unit_positions.Bosstarget.y - (52 * i))
end