- added a 'display when empty' option to the custom bar that will make it still draw even if the specified buff/debuff is not present

This commit is contained in:
Parnic
2009-04-26 00:36:35 +00:00
parent cb39226f0e
commit b9c81c88f6

View File

@ -26,9 +26,6 @@ function IceCustomBar.prototype:Enable(core)
self:Show(true)
self:SetBottomText1("")
self:SetBottomText2("")
self.unit = self.moduleSettings.myUnit
self:UpdateCustomBar(self.unit)
@ -65,6 +62,8 @@ function IceCustomBar.prototype:GetDefaultSettings()
settings["buffOrDebuff"] = "buff"
settings["barColor"] = {r=1, g=0, b=0, a=1}
settings["trackOnlyMine"] = true
settings["displayWhenEmpty"] = false
settings["hideAnimationSettings"] = true
return settings
end
@ -76,10 +75,6 @@ function IceCustomBar.prototype:GetOptions()
opts.textSettings.args.upperTextString.hidden = false
opts.textSettings.args.lowerTextString.hidden = false
opts.headerAnimation.hidden = true
opts.shouldAnimate.hidden = true
opts.desiredLerpTime.hidden = true
opts["customHeader"] = {
type = 'header',
name = "Custom bar settings",
@ -213,6 +208,23 @@ function IceCustomBar.prototype:GetOptions()
order = 20.8,
}
opts["displayWhenEmpty"] = {
type = 'toggle',
name = 'Display when empty',
desc = 'Whether or not to display this bar even if the buff/debuff specified is not present.',
get = function()
return self.moduleSettings.displayWhenEmpty
end,
set = function(v)
self.moduleSettings.displayWhenEmpty = v
self:UpdateCustomBar()
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 20.9
}
return opts
end
@ -300,8 +312,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate)
self:SetBottomText1(self.moduleSettings.upperText .. " " .. tostring(ceil(remaining or 0)) .. "s")
else
self.auraBuffCount = 0
self:SetBottomText1("")
self:SetBottomText2("")
self:SetBottomText1(self.moduleSettings.upperText)
end
self.barFrame:SetStatusBarColor(self:GetBarColor())
@ -312,3 +323,13 @@ function IceCustomBar.prototype:OutCombat()
self:UpdateCustomBar(self.unit)
end
function IceCustomBar.prototype:Show(bShouldShow)
if self.moduleSettings.displayWhenEmpty then
if not self.bIsVisible then
IceCustomBar.super.prototype.Show(self, true)
end
else
IceCustomBar.super.prototype.Show(self, bShouldShow)
end
end