From 88a309ef8c05d696f55e3be091ed3703b70cda27 Mon Sep 17 00:00:00 2001 From: Parnic Date: Sat, 16 Oct 2010 15:40:37 +0000 Subject: [PATCH] - fixed "bar visible" checkbox to also hide/show the solar portion of the eclipse bar --- IceBarElement.lua | 20 ++++++++++---------- modules/EclipseBar.lua | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/IceBarElement.lua b/IceBarElement.lua index ba24df1..b2591d7 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -261,11 +261,7 @@ function IceBarElement.prototype:GetOptions() end, set = function(info, v) self.moduleSettings.barVisible['bar'] = v - if v then - self.barFrame:Show() - else - self.barFrame:Hide() - end + self:SetBarVisibility(v) end, disabled = function() return not self.moduleSettings.enabled @@ -766,6 +762,14 @@ end return opts end +function IceBarElement.prototype:SetBarVisibility(visible) + if visible then + self.barFrame:Show() + else + self.barFrame:Hide() + end +end + function IceBarElement.prototype:SetBarFramePoints() self.barFrame:ClearAllPoints() if (self.moduleSettings.inverse) then @@ -1107,11 +1111,7 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha) self.frame.bg:Show() end - if not self.moduleSettings.barVisible['bar'] then - self.barFrame:Hide() - else - self.barFrame:Show() - end + self:SetBarVisibility(self.moduleSettings.barVisible['bar']) if DogTag ~= nil and self.moduleSettings.usesDogTagStrings then DogTag:UpdateAllForFrame(self.frame) diff --git a/modules/EclipseBar.lua b/modules/EclipseBar.lua index dd9a703..935f742 100644 --- a/modules/EclipseBar.lua +++ b/modules/EclipseBar.lua @@ -56,6 +56,20 @@ function EclipseBar.prototype:Disable(core) EclipseBar.super.prototype.Disable(self, core) end +function EclipseBar.prototype:SetBarVisibility(visible) + EclipseBar.super.prototype.SetBarVisibility(self, visible) + + if not self.solarBar then + return + end + + if visible then + self.solarBar:Show() + else + self.solarBar:Hide() + end +end + function EclipseBar.prototype:CreateFrame() EclipseBar.super.prototype.CreateFrame(self)