mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- added an option to only show the target mana/power bar if the target uses mana (by request)
This commit is contained in:
@ -26,6 +26,7 @@ function IceTargetMana.prototype:GetDefaultSettings()
|
||||
settings["offset"] = 2
|
||||
settings["upperText"] = "[PercentMP:Round]"
|
||||
settings["lowerText"] = "[FractionalMP:PowerColor]"
|
||||
settings["onlyShowMana"] = false
|
||||
|
||||
return settings
|
||||
end
|
||||
@ -79,6 +80,11 @@ function IceTargetMana.prototype:Update(unit)
|
||||
else
|
||||
self:Show(true)
|
||||
end
|
||||
|
||||
if self.moduleSettings.onlyShowMana and UnitPowerType(self.unit) ~= 0 then
|
||||
self:Show(false)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local manaType = UnitPowerType(self.unit)
|
||||
@ -129,6 +135,22 @@ function IceTargetMana.prototype:GetOptions()
|
||||
order = 51
|
||||
}
|
||||
|
||||
opts["onlyShowMana"] = {
|
||||
type = 'toggle',
|
||||
name = 'Only show if target uses mana',
|
||||
desc = 'Will only show this bar if the target uses mana (as opposed to rage, energy, runic power, etc.)',
|
||||
get = function()
|
||||
return self.moduleSettings.onlyShowMana
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.onlyShowMana = v
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end
|
||||
}
|
||||
|
||||
return opts
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user