WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Adding Boss Frames, how difficult is it? (https://www.wowinterface.com/forums/showthread.php?t=39407)

Dessembrae 03-25-11 06:10 AM

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 :D).

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.

haste 03-25-11 09:45 AM

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

Dessembrae 03-25-11 12:34 PM

Quote:

Originally Posted by haste (Post 232866)
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 :D

I will have a look tonight, maybe I can use or adapt it ;)

Sniffles 03-25-11 03:05 PM

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 :)

haste 03-25-11 03:19 PM

Quote:

Originally Posted by Sniffles (Post 232905)
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.

Sniffles 03-25-11 03:35 PM

Quote:

Originally Posted by haste (Post 232906)
oUF does this for you, and it does a better job at it.

Oh ok. Thank you :o


All times are GMT -6. The time now is 01:39 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI