- Added a "When targeting" mode to custom cooldown bars that will always display the bar when a target is selected and never when no target is selected. (ticket #128)

This commit is contained in:
Parnic
2014-10-12 15:47:58 -05:00
parent 692121eca2
commit d5ae3cd7e2

View File

@ -3,7 +3,7 @@ IceCustomCDBar = IceCore_CreateClass(IceBarElement)
local IceHUD = _G.IceHUD
local validDisplayModes = {"Always", "When ready", "When cooling down"}
local validDisplayModes = {"Always", "When ready", "When cooling down", "When targeting"}
local validBuffTimers = {"none", "seconds", "minutes:seconds", "minutes"}
local AuraIconWidth = 20
local AuraIconHeight = 20
@ -361,7 +361,7 @@ function IceCustomCDBar.prototype:GetOptions()
return not self.moduleSettings.enabled
end,
hidden = function()
return self.moduleSettings.displayMode == "Always"
return self.moduleSettings.displayMode ~= "When ready"
end,
order = 31.4,
}
@ -703,6 +703,12 @@ function IceCustomCDBar.prototype:Show(bShouldShow, bForceHide)
else
IceCustomCDBar.super.prototype.Show(self, false)
end
elseif self.moduleSettings.displayMode == "When targeting" then
if UnitExists("target") then
IceCustomCDBar.super.prototype.Show(self, true)
else
IceCustomCDBar.super.prototype.Show(self, false)
end
else
IceCustomCDBar.super.prototype.Show(self, bShouldShow)
end