Reply
Thread Tools Display Modes
Unread 08-30-14, 08:39 AM   #1
Sp_i_ke
A Murloc Raider
Join Date: Apr 2009
Posts: 4
Party frame order

Hey guys,

How do I set the order of the party unit frames (e.g. alphabetical). How do I show pets in the party frames? Using oUF Fail layout, don't know if that matters.

Thanx sPˊ!ˋKe

Last edited by Sp_i_ke : 08-30-14 at 08:45 AM. Reason: Added pet question
Sp_i_ke is offline   Reply With Quote
Unread 08-30-14, 06:59 PM   #2
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,387
Assuming the layout uses :SpawnHeader to create the party frames, just change the value of the "sortOrder" attribute from "INDEX" to "NAME" or add it with that value if it doesn't exist, eg.

Code:
local party = oUF:SpawnHeader("MyLayoutPartyHeader", nil, "party", "sortOrder", "NAME")
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 08-31-14, 05:41 AM   #3
Sp_i_ke
A Murloc Raider
Join Date: Apr 2009
Posts: 4
I'm kind of a noob when it comes to LUA, so need a little help. oUF Fail uses Spawnheader, it appears multiple times in the core.lua. What I tried is adding the line under a similar line in the party frames part of core.lua, see below. Upon starting WoW I got the standard blizzard party frames, so I assume I did something wrong.

-- Party Frames
if cfg.ShowParty then
self:SetActiveStyle('failGroup')
local party = oUF:SpawnHeader('oUF_Party', nil, 'custom [grouparty,nogroup:raid][@raid6,noexists,group:raid] show;hide',
local party = oUF:SpawnHeader("MyLayoutPartyHeader", nil, "party", "sortOrder", "NAME"),
--local party = oUF:SpawnHeader('oUF_Party', nil, "solo", "showSolo", true, -- debug
"showParty", cfg.ShowParty,
"showPlayer", true,
"yoffset", -20,
"groupingOrder", "1,2,3,4,5,6,7,8",
"oUF-initialConfigFunction", ([[
self:SetWidth(%d)
self:SetHeight(%d)
]]):format(128, 25))
party:SetScale(cfg.partyScale)
party:SetPoint('BOTTOM', UIParent, 'CENTER', cfg.PartyX, cfg.PartyY)
end
Can you also tell me how I can ad pets to the partyframes, if it's possible in oUF that is.

Thanks sPˊ!ˋKe

Last edited by Sp_i_ke : 08-31-14 at 05:43 AM.
Sp_i_ke is offline   Reply With Quote
Unread 09-01-14, 12:08 AM   #4
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,387
I assume the original code read:

Code:
local party = oUF:SpawnHeader('oUF_Party', nil, 'custom [grouparty,nogroup:raid][@raid6,noexists,group:raid] show;hide',
--local party = oUF:SpawnHeader('oUF_Party', nil, "solo", "showSolo", true, -- debug
"showParty", cfg.ShowParty,
"showPlayer", true,
"yoffset", -20,
"groupingOrder", "1,2,3,4,5,6,7,8",
"oUF-initialConfigFunction", ([[
self:SetWidth(%d)
self:SetHeight(%d)
]]):format(128, 25))
In which case you just need to add the attribute and value in the list of attributes and values that already exists, not add a new SpawnHeader call in the middle of the list:

Code:
local party = oUF:SpawnHeader('oUF_Party', nil, 'custom [grouparty,nogroup:raid][@raid6,noexists,group:raid] show;hide',
--local party = oUF:SpawnHeader('oUF_Party', nil, "solo", "showSolo", true, -- debug
"showParty", cfg.ShowParty,
"showPlayer", true,
"yoffset", -20,
"groupingOrder", "1,2,3,4,5,6,7,8",
"sortMethod", "NAME",
"oUF-initialConfigFunction", ([[
self:SetWidth(%d)
self:SetHeight(%d)
]]):format(128, 25))
As for adding pet frames, that's much more complicated, as many parts of the code would need to be modified to support those units, and new parts would need to be added, and I just don't have any interest in rewriting someone else's addon for you, sorry.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 09-02-14, 01:50 PM   #5
Sp_i_ke
A Murloc Raider
Join Date: Apr 2009
Posts: 4
Thanx Phanx, works like a charm. What other sorting options are there?
Wouldn't even want you to rewrite someone else's addon, though it might be an option that just had to be enabled.

Greetz sPˊ!ˋKe
Sp_i_ke is offline   Reply With Quote
Unread 09-02-14, 05:04 PM   #6
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,387
You can see a complete list of group header attributes in the Blizzard UI code:
https://github.com/tekkub/wow-ui-sou...eaders.lua#L24

However, not all of them may be applicable to oUF party frames, and not all of them may interact with each other as expected, or be supported by the particular oUF layout you're working with. Proceed with caution.

Re: options, most oUF layouts don't have any. They're so easy to write that most people just write what works for them, and maybe throw in a few basic options like font or bar texture selections, and that's it. It's generally expected that if you want something different, you either write your own or at least make your own changes, or you just use a more configurable addon like PitBull, Stuf, ShadowedUF, etc.

That said, writing oUF layouts is very easy; if you want to learn how to start from the beginning, I'd recommend looking at one of Haste's example layouts (oUF Lily and oUF Classic) as his code is straightforward and easy to follow, unlike the code in some other layouts that are advertised as examples (eg. oUF Simple isn't badly written, but it's really convoluted and way more complicated than I'd ever give to anyone as an example of how to write an oUF layout or a WoW addon in general).

If you just want to learn how to make changes to what you've already got, adding support for additional units requires editing every part of the layout that includes any unit-related conditional checks, so it's not really something I'd recommend as your first project. Try some simpler things first, like moving a font string, resizing a texture, etc. until you're more comfortable with the Lua syntax and basic WoW API functions.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Reply

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Party frame order

Thread Tools
Display Modes

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