mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-10 23:50:01 +00:00
cooldown: use colorpicker for cooldowns
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user