- made sure that the new custom text colors get set before using them

This commit is contained in:
Parnic
2010-12-14 07:16:05 +00:00
parent e3e3d01583
commit 5985e86f0e
2 changed files with 17 additions and 8 deletions

View File

@ -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)