Thread Tools Display Modes
04-20-09, 04:36 PM   #1
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
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
  Reply With Quote
04-20-09, 06:11 PM   #2
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
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.
  Reply With Quote
04-21-09, 01:57 AM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
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.
  Reply With Quote
04-21-09, 12:37 PM   #4
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
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
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Party targets


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