Thread Tools Display Modes
10-25-13, 03:40 AM   #1
Panacia
A Murloc Raider
Join Date: Mar 2012
Posts: 5
Bosstarget frames

I am using oUF Skaarj and I am trying to get bosstarget frames to show the way I want. I can get them to spawn, but whatever I do they only seem to want to use the layout of the boss frames. Is it not possible to give them a unique layout or am I just overlooking something?
  Reply With Quote
10-26-13, 06:02 PM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Of course you can do that. Do you have a unit that looks exactly how your boss target frames should look? If yes you could add this before you spawn the boss targets:
Lua Code:
  1. oUF:SetActiveStyle("MyStyleFunction")
Just replace MyStyleFunction with the template that you want to copy. If there is no template that you can copy you need to create one first.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
10-27-13, 06:04 AM   #3
Panacia
A Murloc Raider
Join Date: Mar 2012
Posts: 5
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
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Bosstarget frames


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