cooldown: use colorpicker for cooldowns

This commit is contained in:
shagu
2016-12-10 18:47:44 +01:00
parent 9b98455298
commit a534a92fdc
3 changed files with 12 additions and 10 deletions
+6 -4
View File
@@ -16,24 +16,26 @@ pfUI:RegisterModule("cooldown", function ()
local remaining = this.duration - (GetTime() - this.start)
if remaining >= 0 then
local r, g, b, a = 1, 1, 1, 1
local unit = ""
local color = "|cffffffff"
if remaining > 99 then
remaining = remaining / 60
unit = "m"
color = "|cff" .. pfUI_config.appearance.cd.mincolor
r,g,b,a = strsplit(",", pfUI_config.appearance.cd.mincolor)
end
if remaining > 99 then
remaining = remaining / 60
unit = "h"
color = "|cff" .. pfUI_config.appearance.cd.hourcolor
r,g,b,a = strsplit(",", pfUI_config.appearance.cd.hourcolor)
end
if remaining > 99 then
remaining = remaining / 24
unit = "d"
color = "|cff" .. pfUI_config.appearance.cd.daycolor
r,g,b,a = strsplit(",", pfUI_config.appearance.cd.daycolor)
end
this.text:SetText(color .. round(remaining) .. unit)
this.text:SetText(round(remaining) .. unit)
this.text:SetTextColor(r,g,b,a)
else
this:Hide()
end