Thread Tools Display Modes
12-28-08, 03:10 PM   #381
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Originally Posted by p3lim View Post
Ill work out an example for you when I get the time.
Kool Thank you P3lim ur the greatest
__________________
 
12-28-08, 04:12 PM   #382
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
One of the "hidden" features of oUF 1.2 was recursive calling of the style function on objects spawned from a header. This made it deadly simple to spawn paryt(pet|target)s.

The following is a slightly modified version of what's in oUF.xml. You'll still have to modify it to your needs.
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/../FrameXML/UI.xsd">
	<Button name="oUF_RenameMeSomethingUnique" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true">
		<Frames>
			<Button name="$parentTarget" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent"/>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="target"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="target"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
		</Frames>
	</Button>
</Ui>
In your layout all you have to do is:
Code:
header:SetAttribute("template", "oUF_RenameMeSomethingUnique")
 
12-28-08, 05:46 PM   #383
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Originally Posted by haste View Post
One of the "hidden" features of oUF 1.2 was recursive calling of the style function on objects spawned from a header. This made it deadly simple to spawn paryt(pet|target)s.

The following is a slightly modified version of what's in oUF.xml. You'll still have to modify it to your needs.
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/../FrameXML/UI.xsd">
	<Button name="oUF_RenameMeSomethingUnique" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true">
		<Frames>
			<Button name="$parentTarget" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent"/>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="target"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="target"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
		</Frames>
	</Button>
</Ui>
In your layout all you have to do is:
Code:
header:SetAttribute("template", "oUF_RenameMeSomethingUnique")

So ur sayin if i add header:SetAttribute("template", "oUF_RenameMeSomethingUnique") somewhere in the code heh not sure where yet that will help with spawning party/target frames for me. as i have it now they spawn just cant get them to where i need them under the party frames..
__________________
 
12-28-08, 05:55 PM   #384
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You have to create a XML file and put the content of the first code block in that one (and add it to the TOC).

The second code block you have to add where the party is spawned. It will make each party frame spawn a pet/target frame also, which is correctly positioned.
 
12-28-08, 06:04 PM   #385
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Originally Posted by haste View Post
You have to create a XML file and put the content of the first code block in that one (and add it to the TOC).

The second code block you have to add where the party is spawned. It will make each party frame spawn a pet/target frame also, which is correctly positioned.
AHHHH ok thank you haste very very much
__________________
 
12-29-08, 04:39 AM   #386
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Does anyone know a working layout that has partypets included? I am asking this because of "The Occulus" where every player sits on a dragon which seems to be the partypet.

Is there a difference of spawning partypets in 1.2.1 and 1.3.1 since I am still using 1.2.1.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
12-29-08, 05:32 AM   #387
Voorije
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 59
Originally Posted by zork View Post
Does anyone know a working layout that has partypets included? I am asking this because of "The Occulus" where every player sits on a dragon which seems to be the partypet.

Is there a difference of spawning partypets in 1.2.1 and 1.3.1 since I am still using 1.2.1.
oUF_Brun seems to work fine for me.
 
12-29-08, 09:35 AM   #388
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Originally Posted by zork View Post
Does anyone know a working layout that has partypets included? I am asking this because of "The Occulus" where every player sits on a dragon which seems to be the partypet.

Is there a difference of spawning partypets in 1.2.1 and 1.3.1 since I am still using 1.2.1.

http://www.wowinterface.com/download..._Caellian.html
__________________
 
12-29-08, 09:58 AM   #389
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Anyone know where i can find a working example of a custom templet so i can take a look at the workings?
__________________
 
12-29-08, 10:15 AM   #390
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by haste View Post
You have to create a XML file and put the content of the first code block in that one (and add it to the TOC).

The second code block you have to add where the party is spawned. It will make each party frame spawn a pet/target frame also, which is correctly positioned.
Doesnt the 3rd argument of :Spawn() do templates?
 
12-29-08, 04:22 PM   #391
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by p3lim View Post
Doesnt the 3rd argument of :Spawn() do templates?
On the header which it returns.
 
12-29-08, 06:06 PM   #392
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by haste View Post
On the header which it returns.
Yeah, if you just spawn 1 header from that specific layout, you could use Spawn's 3rd argument instead.

Though 1 question remains, how do I gain access to the template within the style function?
Can get to the player frame by doing 'if(unit == 'player') then'
 
12-29-08, 07:44 PM   #393
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by p3lim View Post
Yeah, if you just spawn 1 header from that specific layout, you could use Spawn's 3rd argument instead.

Though 1 question remains, how do I gain access to the template within the style function?
Can get to the player frame by doing 'if(unit == 'player') then'
1. No, that's just plain wrong. Unless your begging for unintended behavior.
2. If you by template mean sub-object (ie. party (pet|target) frame)): Parent, Name, Attributes. You have exactly the same information as before.
 
12-29-08, 08:02 PM   #394
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by haste View Post
1. No, that's just plain wrong. Unless your begging for unintended behavior.
2. If you by template mean sub-object (ie. party (pet|target) frame)): Parent, Name, Attributes. You have exactly the same information as before.
Why is the 3rd argument there then?

you mean something like 'if(unit:match('pet')) then' ?
 
12-30-08, 12:08 AM   #395
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by p3lim View Post
Why is the 3rd argument there then?

you mean something like 'if(unit:match('pet')) then' ?
1. For custom headers.
2. No, that will give you an error as unit will be nil at that point. If you just want to know if it is a pet, then just check the suffix attribute on the frame.
 
12-30-08, 07:43 AM   #396
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Originally Posted by wcshadow View Post
Ive been using oUF for quite a while with Roth's UI, and after updating to 1.3.1 today, my bars seem to be all a mess, while selecting myself i doesnt show my name and same with mobs arent displaying correctly, is there a line of code that can restore these names and proper working ?

dont know if this error code would help or not but i keep getting

oUF-1.3.1\ouf.lua:94: attempt to call field '?' (a nil value)
Maybe it has something to do with:
http://ixo.no/git/oUF.git/commit/?id...326df48a04b9de
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 12-30-08 at 07:47 AM.
 
12-30-08, 08:33 AM   #397
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by zork View Post
No, that's completely unrelated. The error happens when you register an event, and don't add a handler to it.
 
01-01-09, 09:02 AM   #398
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
Are there any layouts I could stea... I mean borrow from, that use a vertical health/power bar layout? I've been kicking my teeth in trying to come up with something that works.

I've trying to work with --self.Power:SetOrientation("VERTICAL")-- , but I'm having no luck. I'm sure my problem is "borrowing" most of the code for the layout from a 'normal' oUF layout (oUF_AI). I like their texts and colors.

Thanks in advance (and please don't send me to Pitfull),
~Yhor
 
01-01-09, 09:10 AM   #399
grimman
A Fallenroot Satyr
 
grimman's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 28
Originally Posted by Yhor View Post
Are there any layouts I could stea... I mean borrow from, that use a vertical health/power bar layout? I've been kicking my teeth in trying to come up with something that works.

I've trying to work with --self.Power:SetOrientation("VERTICAL")-- , but I'm having no luck. I'm sure my problem is "borrowing" most of the code for the layout from a 'normal' oUF layout (oUF_AI). I like their texts and colors.

Thanks in advance (and please don't send me to Pitfull),
~Yhor
Works absolutely fine (just tested on my own layout), but you need to remember that this does not rotate the bar, it only tells the game how to fill/deplete the bar contents.
 
01-01-09, 12:31 PM   #400
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Question how would i go about adding Healcomm support to my layout?
__________________
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion


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