WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Party targets (https://www.wowinterface.com/forums/showthread.php?t=22594)

Dawn 04-20-09 04:36 PM

Party targets
 
I'm trying to get party targets to spawn and it's really driving me crazy, I can't find out what's wrong.

I already have party pets working fine like that:

Code:

        if(unit and unit:find('partypet%d')) then
...
blah
...
end

and to spawn them:
Code:

local partypet = {}
partypet[1] = oUF:Spawn('partypet1', 'oUF_PartyPet1')
partypet[1]:SetPoint('TOPRIGHT', party, 'TOPRIGHT', 160, -45)
partypet[1]:SetScale(0.8)
for i =2, 4 do
        partypet[i] = oUF:Spawn('partypet'..i, 'oUF_PartyPet'..i)
        partypet[i]:SetPoint('TOP', partypet[i-1], 'BOTTOM', 0, 125)
        partypet[i]:SetScale(0.8)
end


I'm trying it the same way for party targets:
Code:

        if(unit and unit:find('partytarget%d')) then
...
blah
...
end

and to spawn them:
Code:

local partytarget = {}
partytarget[1] = oUF:Spawn('partytarget1', 'oUF_PartyTarget1')
partytarget[1]:SetPoint('TOPRIGHT', party, 'TOPRIGHT', 180, 30)
--partytarget[1]:SetScale(0.8)
for i =2, 4 do
        partytarget[i] = oUF:Spawn('partytarget'..i, 'oUF_PartyTarget'..i)
        partytarget[i]:SetPoint('TOP', partytarget[i-1], 'BOTTOM', 0, 125)
        partytarget[i]:SetScale(0.8)
end


I still don't see party targets in game, but only party pets? What am I doing wrong? There is NO lua error, it's just not working. Help! :)



PS: I also use this in my layout which might be an issue?
Code:

        if(self:GetParent():GetName():match"oUF_Party") then
                self:SetAttribute('initial-height', 18)
                self:SetAttribute('initial-width', 200)
        else
                self:SetAttribute('initial-height', height)
                self:SetAttribute('initial-width', width)
        end


Dawn 04-20-09 06:11 PM

Just to point it out. I'm not using an XML to spawn the pets. And I'm asking myself if it's possible to spawn the targets without it, too. Otherwise I have to recreate parts of the layout. :)

haste 04-21-09 01:57 AM

It's party1target, not partytarget1. oUF supports spawning of all valid units, so if something doesn't work then you most likely don't try to spawn something that can work with the WoW API.

Dawn 04-21-09 12:37 PM

Thanks haste.

It works with this
Code:

        if(unit and unit:find('party%dtarget')) then
and this
Code:

local partytarget = {}
for i = 1, 5 do
        partytarget[i] = oUF:Spawn('party'..i..'target', 'oUF_Party'..i..'Target')
        if i == 1 then
                partytarget[i]:SetPoint('BOTTOMRIGHT', party, 'TOPRIGHT', 200, 0)
        partytarget[i]:SetScale(ScaleP)               
        else
                partytarget[i]:SetPoint('TOP', partytarget[i-1], 'TOP', 0, 110)
        partytarget[i]:SetScale(ScaleP)               
        end
end

now :)


All times are GMT -6. The time now is 08:37 PM.

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