mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- made sure that the new custom text colors get set before using them
This commit is contained in:
@ -51,14 +51,18 @@ function IceCustomBar.prototype:Enable(core)
|
|||||||
self.moduleSettings.auraIconYOffset = 0
|
self.moduleSettings.auraIconYOffset = 0
|
||||||
end
|
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
|
if not self.moduleSettings.upperTextColor then
|
||||||
self.moduleSettings.upperTextColor = {r=1, g=1, b=1}
|
self.moduleSettings.upperTextColor = {r=1, g=1, b=1}
|
||||||
end
|
end
|
||||||
self:SetCustomTextColor(self.frame.bottomUpperText, self.moduleSettings.upperTextColor)
|
|
||||||
if not self.moduleSettings.lowerTextColor then
|
if not self.moduleSettings.lowerTextColor then
|
||||||
self.moduleSettings.lowerTextColor = {r=1, g=1, b=1}
|
self.moduleSettings.lowerTextColor = {r=1, g=1, b=1}
|
||||||
end
|
end
|
||||||
self:SetCustomTextColor(self.frame.bottomLowerText, self.moduleSettings.lowerTextColor)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function IceCustomBar.prototype:ConditionalSubscribe()
|
function IceCustomBar.prototype:ConditionalSubscribe()
|
||||||
@ -495,6 +499,7 @@ function IceCustomBar.prototype:GetOptions()
|
|||||||
type = "color",
|
type = "color",
|
||||||
name = L["Upper Text Color"],
|
name = L["Upper Text Color"],
|
||||||
get = function()
|
get = function()
|
||||||
|
self:FixupTextColors()
|
||||||
return self.moduleSettings.upperTextColor.r, self.moduleSettings.upperTextColor.g, self.moduleSettings.upperTextColor.b, 1
|
return self.moduleSettings.upperTextColor.r, self.moduleSettings.upperTextColor.g, self.moduleSettings.upperTextColor.b, 1
|
||||||
end,
|
end,
|
||||||
set = function(info, r,g,b)
|
set = function(info, r,g,b)
|
||||||
|
@ -57,16 +57,19 @@ function IceCustomCDBar.prototype:Enable(core)
|
|||||||
self.moduleSettings.displayWhenEmpty = nil
|
self.moduleSettings.displayWhenEmpty = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.moduleSettings.upperTextColor then
|
self:FixupTextColors()
|
||||||
self.moduleSettings.upperTextColor = {r=1, g=1, b=1}
|
|
||||||
end
|
|
||||||
self:SetCustomTextColor(self.frame.bottomUpperText, self.moduleSettings.upperTextColor)
|
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)
|
self:SetCustomTextColor(self.frame.bottomLowerText, self.moduleSettings.lowerTextColor)
|
||||||
end
|
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)
|
function IceCustomCDBar.prototype:Disable(core)
|
||||||
IceHUD.IceCore:RequestUpdates(self, nil)
|
IceHUD.IceCore:RequestUpdates(self, nil)
|
||||||
@ -392,6 +395,7 @@ function IceCustomCDBar.prototype:GetOptions()
|
|||||||
type = "color",
|
type = "color",
|
||||||
name = L["Upper Text Color"],
|
name = L["Upper Text Color"],
|
||||||
get = function()
|
get = function()
|
||||||
|
self:FixupTextColors()
|
||||||
return self.moduleSettings.upperTextColor.r, self.moduleSettings.upperTextColor.g, self.moduleSettings.upperTextColor.b, 1
|
return self.moduleSettings.upperTextColor.r, self.moduleSettings.upperTextColor.g, self.moduleSettings.upperTextColor.b, 1
|
||||||
end,
|
end,
|
||||||
set = function(info, r,g,b)
|
set = function(info, r,g,b)
|
||||||
|
Reference in New Issue
Block a user