Thread Tools Display Modes
03-25-11, 06:10 AM   #1
Dessembrae
A Fallenroot Satyr
 
Dessembrae's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 29
Question Adding Boss Frames, how difficult is it?

As the title says.

How difficult is it to add bossframes to a 'messy' layout code.
It's still the same one as the one with the raid icons issue (which was my own stupid mistake)

http://www.wowinterface.com/downloads/info18846 or for ease http://www.pastie.org/1713020

I know, I know

Already a few told me to take a clean coded layout and transfer all the functions and looks, but I rather keep this as long as it works (lazy, lack of time and knowledge and all the other regular excuses, at least I admit it ).

Thing is I can look at other layouts (I often do to get a general idea of how something works), but this one is a bit of a special case, since it still declares it's local units in a list (and as far as I can see nearly all layouts don't do that anymore, and those that do don't have what I was looking for regardin boss frames). All the present units in the layout have only single frames. Tankframes have unit 1 and 2, Bossframes have unit 1 trough 4 (not talking about arena frames which have 1 trough 5 plus their targets too).

If I want to keep using this layout, would I have to declare ouF_Boss[1] trough oUF_Boss[4] separately or will oUF_Boss[i] do the trick? (which I don't expect since it's a variable) And would this also work for tanks, arena frames etc. I'm talking about this list of local units.
Code:
local units = {
	[1] = "oUF_Player",
	[2] = "oUF_Target",
	[3] = "oUF_Focus",
	[4] = "oUF_TargetTarget",
	[5] = "oUF_Pet",
	[6] = "oUF_PetTarget",
}
Another question I have is the last part I added to get rid of blizzard raidframes (since I use grid for that). It was working for quite a time, but currently the outside frame (let's say the placeholder frame) is back in display even with this at the end of the layout.
The frames that show up are:
CompactRaidFrameManager and CompactRaidFrameManagerContainerResizeFrame. There's no content inside, just the outline frames.
Code:
oUF:DisableBlizzard('party')
CompactRaidFrameManager:UnregisterAllEvents()
CompactRaidFrameManager:Hide()
CompactRaidFrameContainer:UnregisterAllEvents()
CompactRaidFrameContainer:Hide()
Is there a line missing in this part, or is something else wrong?
For now I've hidden them with FluidFrames (a addon I use anyways), but I thought the above code would've been sufficient enough.

Thanks for your time.
Regards, Dessembrae.
__________________
Dessembrae knows the sorrows in our souls.
He walks at the side of each mortal,
a vessel of regret on the fires of vengeance.
Dessembrae knows the sorrows,
and would now share them with us all.
  Reply With Quote
03-25-11, 09:45 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I don't really have time to read your code and give you a straight forward reply, but this[1] is how I implemented boss frames in oUF Lily. You might be able to adapt this to your own layout.

[1] https://github.com/haste/oUF_Lily/co...3d7c2794b478f6
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-25-11, 12:34 PM   #3
Dessembrae
A Fallenroot Satyr
 
Dessembrae's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 29
Originally Posted by haste View Post
I don't really have time to read your code and give you a straight forward reply, but this[1] is how I implemented boss frames in oUF Lily. You might be able to adapt this to your own layout.

[1] https://github.com/haste/oUF_Lily/co...3d7c2794b478f6
Better not that you have a look at it Haste, since you would probably end up with a heartattack or stroke due to the sloppy code.
I remember some time ago I popped up here for the first time with the oUF_Ten layout that your first comment was something along the lines to trash it and start all new. All those if statements were killing you

I will have a look tonight, maybe I can use or adapt it
__________________
Dessembrae knows the sorrows in our souls.
He walks at the side of each mortal,
a vessel of regret on the fires of vengeance.
Dessembrae knows the sorrows,
and would now share them with us all.
  Reply With Quote
03-25-11, 03:05 PM   #4
Sniffles
A Black Drake
 
Sniffles's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 86
I use this code for my Boss and Arena Frames:

Code:
if (unit and unit:find("arena%d")) or (unit and unit:find("boss%d")) then
-- do some stuff ~~
end

local arena = {}
	for i = 1, 5 do
		arena[i] = oUF:Spawn("arena"..i, "SnifflesArena"..i)
		if i == 1 then
			arena[i]:SetPoint("RIGHT", UIParent, -45, -30)
		else
			arena[i]:SetPoint("BOTTOM", arena[i-1], "TOP", 0, 50)
		end
			arena[i]:SetSize(230, 26)
	end

for i = 1,MAX_BOSS_FRAMES do
	local t_boss = _G["Boss"..i.."TargetFrame"]
	t_boss:UnregisterAllEvents()
	t_boss.Show = F.dummy
	t_boss:Hide()
	_G["Boss"..i.."TargetFrame".."HealthBar"]:UnregisterAllEvents()
	_G["Boss"..i.."TargetFrame".."ManaBar"]:UnregisterAllEvents()
end

local boss = {}
for i = 1, MAX_BOSS_FRAMES do
	boss[i] = oUF:Spawn("boss"..i, "SnifflesBoss"..i)
		if i == 1 then
			boss[i]:SetPoint("RIGHT", UIParent, -45, 30)
		else
			boss[i]:SetPoint('BOTTOM', boss[i-1], 'TOP', 0, 50)             
		end
	boss[i]:SetSize(230, 26)
end
All credits to Tukz
  Reply With Quote
03-25-11, 03:19 PM   #5
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Sniffles View Post
Code:
for i = 1,MAX_BOSS_FRAMES do
	local t_boss = _G["Boss"..i.."TargetFrame"]
	t_boss:UnregisterAllEvents()
	t_boss.Show = F.dummy
	t_boss:Hide()
	_G["Boss"..i.."TargetFrame".."HealthBar"]:UnregisterAllEvents()
	_G["Boss"..i.."TargetFrame".."ManaBar"]:UnregisterAllEvents()
end
oUF does this for you, and it does a better job at it.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-25-11, 03:35 PM   #6
Sniffles
A Black Drake
 
Sniffles's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 86
Originally Posted by haste View Post
oUF does this for you, and it does a better job at it.
Oh ok. Thank you
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Adding Boss Frames, how difficult is it?


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