Skip to content

Commit

Permalink
Option to limit number of groups displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Dec 18, 2020
1 parent 4f956c8 commit 07fb7c8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1969,15 +1969,22 @@ function AptechkaHeader.UpdateVisibility(header)
end

function Aptechka:GetGroupFilterAsString()
local t = {}
for i=1,8 do
local t = {}
if Aptechka:IsGroupEnabled(i) then
table.insert(t, i)
end
return table.concat(t, ",")
end
return table.concat(t, ",")
end

function Aptechka:GetMaxGroupEnabled()
for i=8,1,-1 do
if helpers.CheckBit(self.db.profile.groupFilter, i) then
return i
end
end
end
function Aptechka:IsGroupEnabled(id)
return helpers.CheckBit(self.db.profile.groupFilter, id)
end
Expand Down
14 changes: 14 additions & 0 deletions Options/ProfileSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,20 @@ function ns.MakeProfileSettings()
end,
order = 18,
},
maxGroups = {
name = L"Max Groups",
type = "range",
get = function(info) return Aptechka:GetMaxGroupEnabled() end,
set = function(info, v)
local filters = {1, 3, 7, 15, 31, 63, 127, 255}
Aptechka.db.profile.groupFilter = filters[v] or 255
Aptechka:Reconfigure()
end,
min = 1,
max = 8,
step = 1,
order = 19,
},
}
},

Expand Down

0 comments on commit 07fb7c8

Please sign in to comment.