From 5985e86f0e6c661acc9d8c59dee6804d88f0d80d Mon Sep 17 00:00:00 2001 From: Parnic Date: Tue, 14 Dec 2010 07:16:05 +0000 Subject: [PATCH] - made sure that the new custom text colors get set before using them --- modules/CustomBar.lua | 9 +++++++-- modules/CustomCDBar.lua | 16 ++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index fc74591..de21c79 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -51,14 +51,18 @@ function IceCustomBar.prototype:Enable(core) self.moduleSettings.auraIconYOffset = 0 end + self:FixupTextColors() + self:SetCustomTextColor(self.frame.bottomUpperText, self.moduleSettings.upperTextColor) + self:SetCustomTextColor(self.frame.bottomLowerText, self.moduleSettings.lowerTextColor) +end + +function IceCustomBar.prototype:FixupTextColors() if not self.moduleSettings.upperTextColor then self.moduleSettings.upperTextColor = {r=1, g=1, b=1} end - self:SetCustomTextColor(self.frame.bottomUpperText, self.moduleSettings.upperTextColor) if not self.moduleSettings.lowerTextColor then self.moduleSettings.lowerTextColor = {r=1, g=1, b=1} end - self:SetCustomTextColor(self.frame.bottomLowerText, self.moduleSettings.lowerTextColor) end function IceCustomBar.prototype:ConditionalSubscribe() @@ -495,6 +499,7 @@ function IceCustomBar.prototype:GetOptions() type = "color", name = L["Upper Text Color"], get = function() + self:FixupTextColors() return self.moduleSettings.upperTextColor.r, self.moduleSettings.upperTextColor.g, self.moduleSettings.upperTextColor.b, 1 end, set = function(info, r,g,b) diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 951f7c8..e4e78a3 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -57,16 +57,19 @@ function IceCustomCDBar.prototype:Enable(core) self.moduleSettings.displayWhenEmpty = nil end - if not self.moduleSettings.upperTextColor then - self.moduleSettings.upperTextColor = {r=1, g=1, b=1} - end + self:FixupTextColors() self:SetCustomTextColor(self.frame.bottomUpperText, self.moduleSettings.upperTextColor) - if not self.moduleSettings.lowerTextColor then - self.moduleSettings.lowerTextColor = {r=1, g=1, b=1} - end self:SetCustomTextColor(self.frame.bottomLowerText, self.moduleSettings.lowerTextColor) end +function IceCustomCDBar.prototype:FixupTextColors() + if not self.moduleSettings.upperTextColor then + self.moduleSettings.upperTextColor = {r=1, g=1, b=1} + end + if not self.moduleSettings.lowerTextColor then + self.moduleSettings.lowerTextColor = {r=1, g=1, b=1} + end +end function IceCustomCDBar.prototype:Disable(core) IceHUD.IceCore:RequestUpdates(self, nil) @@ -392,6 +395,7 @@ function IceCustomCDBar.prototype:GetOptions() type = "color", name = L["Upper Text Color"], get = function() + self:FixupTextColors() return self.moduleSettings.upperTextColor.r, self.moduleSettings.upperTextColor.g, self.moduleSettings.upperTextColor.b, 1 end, set = function(info, r,g,b)