Skip to content

Commit

Permalink
add toggle to hide high raid subgroups
Browse files Browse the repository at this point in the history
  • Loading branch information
gallantron committed Apr 26, 2022
1 parent c1719b5 commit 636282a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
11 changes: 11 additions & 0 deletions PallyPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,17 @@ function PallyPower:UpdateRoster()
local n = select(3, unitid:find("(%d+)"))
tmp.name, tmp.rank, tmp.subgroup = GetRaidRosterInfo(n)
tmp.zone = select(7, GetRaidRosterInfo(n))

if self.opt.hideHighGroups then
local maxPlayerCount = (select(5, GetInstanceInfo()))
if maxPlayerCount and (maxPlayerCount > 5) then
local numVisibleSubgroups = math.ceil(maxPlayerCount/5)
if not (tmp.subgroup <= numVisibleSubgroups) then
tmp.class = nil
end
end
end

local raidtank = select(10, GetRaidRosterInfo(n))
tmp.tank = ((raidtank == "MAINTANK") or (self.opt.mainAssist and (raidtank == "MAINASSIST")))

Expand Down
24 changes: 23 additions & 1 deletion PallyPowerOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,30 @@ PallyPower.options = {
return PallyPower.opt.enabled == false or not isPally
end,
args = {
mainroles = {
visibility = {
order = 1,
name = L["Visibility Settings"],
type = "group",
inline = true,
args = {
hide_high = {
order = 1,
type = "toggle",
name = L["Hide Bench (by Subgroup)"],
desc = L["While you are in a Raid dungeon, hide any players outside of the usual subgroups for that dungeon. For example, if you are in a 10-player dungeon, any players in Group 3 or higher will be hidden."],
width = "full",
get = function()
return PallyPower.opt.hideHighGroups
end,
set = function(info, val)
PallyPower.opt.hideHighGroups = val
PallyPower:UpdateRoster()
end
},
},
},
mainroles = {
order = 2,
name = L["Main Tank / Main Assist Roles"],
type = "group",
inline = true,
Expand Down

0 comments on commit 636282a

Please sign in to comment.