add option cooldown number alpha
This commit is contained in:
		@@ -557,6 +557,22 @@ function Auras:GetOptions()
 | 
			
		||||
                            order = 4,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        auraCooldownNumberAlpha = {
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown number alpha"],
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 1,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                            set = function(info, value)
 | 
			
		||||
                                Gladdy.db.auraFontColor.a = value
 | 
			
		||||
                                Gladdy:UpdateFrame()
 | 
			
		||||
                            end,
 | 
			
		||||
                            get = function(info)
 | 
			
		||||
                                return Gladdy.db.auraFontColor.a
 | 
			
		||||
                            end,
 | 
			
		||||
                        },
 | 
			
		||||
                    }
 | 
			
		||||
                },
 | 
			
		||||
                font = {
 | 
			
		||||
 
 | 
			
		||||
@@ -279,7 +279,7 @@ local function styleIcon(aura, auraType)
 | 
			
		||||
    aura.cooldown:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/2 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
 | 
			
		||||
    aura.cooldown:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
    aura.stacks:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/3 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
 | 
			
		||||
    aura.stacks:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
    aura.stacks:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, 1)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function BuffsDebuffs:UpdateFrame(unit)
 | 
			
		||||
@@ -486,15 +486,15 @@ local function iconTimer(auraFrame, elapsed)
 | 
			
		||||
        auraFrame.timeLeft = timeLeftMilliSec
 | 
			
		||||
        if Gladdy.db.buffsDynamicColor then
 | 
			
		||||
            if timeLeftSec >= 60 then
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(0.7, 1, 0)
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(0.7, 1, 0, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
            elseif timeLeftSec < 60 and timeLeftSec >= 11 then
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(0.7, 1, 0)
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(0.7, 1, 0, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
            elseif timeLeftSec <= 10 and timeLeftSec >= 5 then
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(1, 0.7, 0)
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(1, 0.7, 0, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
            elseif timeLeftSec <= 4 and timeLeftSec >= 3 then
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(1, 0, 0)
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(1, 0, 0, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
            elseif timeLeftMilliSec <= 3 and timeLeftMilliSec > 0 then
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(1, 0, 0)
 | 
			
		||||
                auraFrame.cooldown:SetTextColor(1, 0, 0, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        if timeLeftMilliSec < 0 then
 | 
			
		||||
@@ -911,6 +911,22 @@ function BuffsDebuffs:GetOptions()
 | 
			
		||||
                            order = 10,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        buffsCooldownNumberAlpha = {
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown number alpha"],
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 1,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
                            order = 11,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                            set = function(info, value)
 | 
			
		||||
                                Gladdy.db.buffsFontColor.a = value
 | 
			
		||||
                                Gladdy:UpdateFrame()
 | 
			
		||||
                            end,
 | 
			
		||||
                            get = function(info)
 | 
			
		||||
                                return Gladdy.db.buffsFontColor.a
 | 
			
		||||
                            end,
 | 
			
		||||
                        },
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                font = {
 | 
			
		||||
 
 | 
			
		||||
@@ -663,6 +663,22 @@ function Cooldowns:GetOptions()
 | 
			
		||||
                            order = 9,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        cooldownCooldownNumberAlpha = {
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown number alpha"],
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 1,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
                            order = 10,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                            set = function(info, value)
 | 
			
		||||
                                Gladdy.db.cooldownFontColor.a = value
 | 
			
		||||
                                Gladdy:UpdateFrame()
 | 
			
		||||
                            end,
 | 
			
		||||
                            get = function(info)
 | 
			
		||||
                                return Gladdy.db.cooldownFontColor.a
 | 
			
		||||
                            end,
 | 
			
		||||
                        },
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                font = {
 | 
			
		||||
 
 | 
			
		||||
@@ -456,6 +456,22 @@ function Diminishings:GetOptions()
 | 
			
		||||
                            order = 9,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        drCooldownNumberAlpha = {
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown number alpha"],
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 1,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
                            order = 10,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                            set = function(info, value)
 | 
			
		||||
                                Gladdy.db.drFontColor.a = value
 | 
			
		||||
                                Gladdy:UpdateFrame()
 | 
			
		||||
                            end,
 | 
			
		||||
                            get = function(info)
 | 
			
		||||
                                return Gladdy.db.drFontColor.a
 | 
			
		||||
                            end,
 | 
			
		||||
                        },
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                font = {
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,7 @@ local Racial = Gladdy:NewModule("Racial", nil, {
 | 
			
		||||
    racialBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
			
		||||
    racialDisableCircle = false,
 | 
			
		||||
    racialCooldownAlpha = 1,
 | 
			
		||||
    racialCooldownNumberAlpha = 1,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
local ANCHORS = { ["LEFT"] = "RIGHT", ["RIGHT"] = "LEFT", ["BOTTOM"] = "TOP", ["TOP"] = "BOTTOM"}
 | 
			
		||||
@@ -43,19 +44,19 @@ local function iconTimer(self,elapsed)
 | 
			
		||||
        local timeLeft = ceil(self.timeLeft)
 | 
			
		||||
 | 
			
		||||
        if timeLeft >= 60 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 0.15* self:GetWidth()) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft < 60 and timeLeft >= 30 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft < 30 and timeLeft >= 11 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft < 10 and timeLeft >= 5 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft < 5 and timeLeft > 0 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.racialCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "racialFont"), (self:GetWidth()/2 - 1) * Gladdy.db.racialFontScale, "OUTLINE")
 | 
			
		||||
        end
 | 
			
		||||
        Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
 | 
			
		||||
@@ -270,6 +271,15 @@ function Racial:GetOptions()
 | 
			
		||||
                            order = 8,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        racialCooldownNumberAlpha = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown number alpha"],
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 1,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
                            order = 9,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                font = {
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,7 @@ local Trinket = Gladdy:NewModule("Trinket", nil, {
 | 
			
		||||
    trinketBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
			
		||||
    trinketDisableCircle = false,
 | 
			
		||||
    trinketCooldownAlpha = 1,
 | 
			
		||||
    trinketCooldownNumberAlpha = 1,
 | 
			
		||||
})
 | 
			
		||||
LibStub("AceComm-3.0"):Embed(Trinket)
 | 
			
		||||
 | 
			
		||||
@@ -39,19 +40,19 @@ local function iconTimer(self, elapsed)
 | 
			
		||||
        local timeLeft = ceil(self.timeLeft)
 | 
			
		||||
 | 
			
		||||
        if timeLeft >= 60 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 0.15*self:GetWidth()) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft < 60 and timeLeft >= 30 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 1, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft < 30 and timeLeft >= 11 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft <= 10 and timeLeft >= 5 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0.7, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
			
		||||
        elseif timeLeft < 5 and timeLeft > 0 then
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0, 0)
 | 
			
		||||
            self.cooldownFont:SetTextColor(1, 0, 0, Gladdy.db.trinketCooldownNumberAlpha)
 | 
			
		||||
            self.cooldownFont:SetFont(Gladdy:SMFetch("font", "trinketFont"), (self:GetWidth()/2 - 1) * Gladdy.db.trinketFontScale, "OUTLINE")
 | 
			
		||||
        end
 | 
			
		||||
        Gladdy:FormatTimer(self.cooldownFont, self.timeLeft, self.timeLeft < 10, true)
 | 
			
		||||
@@ -276,6 +277,15 @@ function Trinket:GetOptions()
 | 
			
		||||
                            order = 8,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        trinketCooldownNumberAlpha = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown number alpha"],
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 1,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
                            order = 9,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                font = {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user