From d5ae3cd7e2705e8a2cc005e217fbd5c85a296fd8 Mon Sep 17 00:00:00 2001 From: Parnic Date: Sun, 12 Oct 2014 15:47:58 -0500 Subject: [PATCH] - 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) --- modules/CustomCDBar.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 74291c2..a7ac833 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -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