Skip to content

Commit

Permalink
Added additional power types toggles to GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Feb 2, 2024
1 parent 6218964 commit 1ea5bce
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ local defaults = {
showSeparator = false,
showIconCooldownCount = false,
showFloatingIcons = true,
showPowerTypesTank = false,
showPowerTypesDamage = false,
clampIncomingHeal = true,
healthTexture = "Gradient",
powerTexture = "Gradient",
Expand Down Expand Up @@ -1542,6 +1544,14 @@ do
FrameSetJob(frame, config.PowerBarColor, true, "POWERCOLOR", pname, makeUnique())
end
end

-- Aux function for GUI
function Aptechka.FrameUpdateDisplayPowerAndRefresh(frame, unit)
Aptechka.FrameUpdateDisplayPower(frame, unit)
local pnum, ptype = UnitPowerType(unit)
Aptechka.FrameUpdatePower(frame, unit, ptype)
end

function Aptechka.UNIT_DISPLAYPOWER(self, event, unit)
self:ForEachUnitFrame(unit, Aptechka.FrameUpdateDisplayPower)
local pnum, ptype = UnitPowerType(unit)
Expand Down
24 changes: 24 additions & 0 deletions Options/ProfileSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,30 @@ function ns.MakeProfileSettings()
end,
order = 18.2,
},
showPowerTypesTank = {
name = L"Show Tank Power"..newFeatureIcon,
desc = "Display power types of tank, e.g. Rage",
type = "toggle",
width = 1.5,
get = function(info) return Aptechka.db.profile.showPowerTypesTank end,
set = function(info, v)
Aptechka.db.profile.showPowerTypesTank = not Aptechka.db.profile.showPowerTypesTank
Aptechka:ForEachFrame(Aptechka.FrameUpdateDisplayPowerAndRefresh)
end,
order = 18.3,
},
showPowerTypesDamage = {
name = L"Show Damager Power",
desc = "Basically show everything",
type = "toggle",
width = 1.5,
get = function(info) return Aptechka.db.profile.showPowerTypesDamage end,
set = function(info, v)
Aptechka.db.profile.showPowerTypesDamage = not Aptechka.db.profile.showPowerTypesDamage
Aptechka:ForEachFrame(Aptechka.FrameUpdateDisplayPowerAndRefresh)
end,
order = 18.4,
},
maxGroups = {
name = L"Max Groups",
type = "range",
Expand Down

0 comments on commit 1ea5bce

Please sign in to comment.