Thread Tools Display Modes
09-04-12, 07:05 AM   #1
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Show 5-man raid as party

When in a raid group which has five raid members or less, I want the raid frames to be hidden and party frames to be shown, because in my UI's dps layout, the raid frames are to the side while the party frames are closer to the center, making it easier to keep track of people in arenas (where the group is considered a raid group).

This is what I use now for my party/raid frames and what most people seem to use to accomplish this:

Code:
	local party = self:SpawnHeader(nil, nil, "custom [@raid6,exists] hide; show",
		'showParty', true,
		'showPlayer', true and FreeUIConfig.layout == 2 or false,
		'showSolo', false,
		'yoffset', -3,
		'maxColumns', 5,
		'unitsperColumn', 1,
		'columnSpacing', 3,
		'columnAnchorPoint', "RIGHT",
		'oUF-initialConfigFunction', ([[
			self:SetHeight(%d)
			self:SetWidth(%d)
		]]):format(party_height, party_width)
	)

	party:SetPoint(unpack(partyPos))

	local raid = self:SpawnHeader(nil, nil, "custom [@raid6,exists] show; hide",
		'showPlayer', true,
		'showParty', false,
		'showRaid', true,
		'xoffset', 5,
		'yOffset', -4,
		'point', "TOP",
		'groupFilter', '1,2,3,4,5,6,7,8',
		'groupingOrder', '1,2,3,4,5,6,7,8',
		'groupBy', 'GROUP',
		'maxColumns', 8,
		'unitsPerColumn', 5,
		'columnSpacing', 5,
		'columnAnchorPoint', "RIGHT",
		'oUF-initialConfigFunction', ([[
			self:SetHeight(%d)
			self:SetWidth(%d)
		]]):format(party_height, party_width)
	)
The problem with the [@raid6,exists] conditional is that when there is a gap in your raid group, and there is no-one in the 6th slot, the raid frames will still be hidden and you will only see your party.

I've also tried something like this:

Code:
	local raidToParty = CreateFrame("Frame")
	raidToParty:RegisterEvent("PLAYER_ENTERING_WORLD")
	raidToParty:RegisterEvent("GROUP_ROSTER_UPDATE")
	raidToParty:SetScript("OnEvent", function()
		if GetNumGroupMembers() > 5 then
			party:SetAttribute("showRaid", false)
			raid:SetAttribute("showRaid", true)
		else
			party:SetAttribute("showRaid", true)
			raid:SetAttribute("showRaid", false)
		end
	end)
This only worked when I changed the third argument of the party header to "party,raid", but that caused it to show the party as well as the raid frames while in a raid group > 5 members, regardless of the attribute being changed.

Does anyone know a proper way of doing this?
  Reply With Quote
09-04-12, 07:27 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Couldn't you just disable showParty, showSolo and showPlayer aswell?
That should remove the party display when you are in a raid that meets the requirements.

Lua Code:
  1. local raidToParty = CreateFrame("Frame")
  2.   raidToParty:RegisterEvent("PLAYER_ENTERING_WORLD")
  3.   raidToParty:RegisterEvent("GROUP_ROSTER_UPDATE")
  4.   raidToParty:SetScript("OnEvent", function()
  5.     if GetNumGroupMembers() > 5 then
  6.       party:SetAttribute("showSolo", false)
  7.       party:SetAttribute("showPlayer", false)
  8.       party:SetAttribute("showParty", false)
  9.       party:SetAttribute("showRaid", false)
  10.       raid:SetAttribute("showSolo", false)
  11.       raid:SetAttribute("showPlayer", false)
  12.       raid:SetAttribute("showParty", false)
  13.       raid:SetAttribute("showRaid", true)
  14.     else
  15.       party:SetAttribute("showSolo", false) -- show player when solo
  16.       party:SetAttribute("showPlayer", true) --show player unit in 5man group
  17.       party:SetAttribute("showParty", true)
  18.       party:SetAttribute("showRaid", true)
  19.       raid:SetAttribute("showSolo", false)
  20.       raid:SetAttribute("showPlayer", false)
  21.       raid:SetAttribute("showParty", false)
  22.       raid:SetAttribute("showRaid", false)
  23.     end
  24.   end)

The macro conditions have its boundaries.
__________________
| 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 : 09-04-12 at 07:30 AM.
  Reply With Quote
09-04-12, 08:55 AM   #3
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
That seems to work. I was thinking that 'showParty' meant 'show in party' and not 'show party members'.

Thank you!
  Reply With Quote
09-06-12, 03:45 AM   #4
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
On a late note, this does appear to cause taint, so anyone wanting to use the same method will probably have to add a combat check as well prior to setting attributes.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Show 5-man raid as party


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