Thread Tools Display Modes
02-05-10, 06:43 AM   #1
alimjocox
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 96
unitsuffix help.

So I'm trying to learn oUF. and dont know much about programming. I see hwo others use
self:GetAttribute("unitsuffix") == "pet" to make things work. just wondering how it works for party pets.

Code:
local party = oUF:Spawn("header", "oUF_Party")
party:SetPoint("LEFT", UIParent, "LEFT", cfg.partyX, cfg.partyY)
party:SetAttribute("showParty", true)
party:SetAttribute("yOffset", -27.5)

local pets = {} 
pets[1] = oUF:Spawn('partypet1', 'oUF_PartyPet1') 
pets[1]:SetPoint('TOPLEFT', party, 'TOPLEFT', 0, -180) 
for i =2, 4 do 
  pets[i] = oUF:Spawn('partypet'..i, 'oUF_PartyPet'..i) 
  pets[i]:SetPoint('TOP', pets[i-1], 'BOTTOM', 0, -8)
here is what I THINK is the necessary code that will help to an answer. if i am wrong pls do tell
  Reply With Quote
02-05-10, 01:15 PM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
For what you're trying to do, I'd suggest looking at oUF_Noob and the xml template in there. I borrowed my template from there and it made life easy and straightforward.
  Reply With Quote
02-07-10, 04:53 PM   #3
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
I use raid frames in party as well, and use the SecureGroupPetHeaderTemplate for pets. This means I don't need to define my own XML template.

you can see how I do this here: http://github.com/Evilpaul/oUF_EPRaid
  Reply With Quote
02-07-10, 05:47 PM   #4
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
The major difference between the two is the SecureGroupPetHeaderTemplate will group all of the pets together, while using a custom one will allow you to place pets in a specific location in relation to their owner.
  Reply With Quote
10-18-10, 10:31 PM   #5
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Sorry for the topic digging... but I was searching for topics related to SecureGroupPetHeaderTemplate.

I used to spawn my layout Party Pets using a XML, that is commonly used.

But I wanted to try to spawn them in the lua instead of XML, the reason is to make it easier to disable them if wanted.

Anyway, I'm spawning them with this:

Code:
if cfg.show_Party_Pets then
			self:SetActiveStyle('lumen - Group')
			---local pets = oUF:SpawnHeader('oUF_PartyPets', 'SecureGroupPetHeaderTemplate', "custom  [group:party,nogroup:raid][@raid6,noexists,group:raid] show;hide",
			local pets = oUF:SpawnHeader('oUF_PartyPets', 'SecureGroupPetHeaderTemplate', "solo", "showSolo", true,  -- debug
			"showParty", cfg.show_Party,
			"xoffset", 7,
			"columnSpacing", 7,
			"point", "LEFT",
			"oUF-initialConfigFunction", ([[
			self:SetWidth(%d)
			self:SetHeight(%d)
			self:SetScale(%d)
			]]):format(cfg.party_pets_width, cfg.party_pets_height, cfg.scale))
			pets:SetPoint("TOPLEFT", "oUF_Party", "BOTTOMLEFT", 0, -6)
   		end
Working great. The only problem is they are inheriting all the styling from the Party style.

How can I target the Pet Frames to style them? Since I'm not using the xml and not setting an suffix atribute I can't target them that way.

Any way to do this?
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
10-19-10, 02:42 AM   #6
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
have you tried with :

self:GetParent():GetName():match'pet' or sthg like this ?
  Reply With Quote
10-19-10, 04:21 AM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
oUF currently doesn't handle the group pet header that well.. like.. it doesn't handle it at all. It's one of the things that will get fixed soon.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
10-19-10, 08:20 AM   #8
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Ok, thanks for the answers. :]
__________________
My oUF Layout: oUF Lumen
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » unitsuffix help.


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