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?