helpers: move timeconvert function to helpers

This commit is contained in:
shagu
2021-12-06 14:40:07 +01:00
parent e2cc2f2f82
commit a32c8dded9
2 changed files with 21 additions and 19 deletions
+1 -19
View File
@@ -10,25 +10,7 @@ local module = ShaguTweaks:register({
local libdebuff = ShaguTweaks.libdebuff
local UnitDebuff = libdebuff and libdebuff.UnitDebuff
local function TimeConvert(remaining)
local color = "|cffffffff"
if remaining < 5 then
color = "|cffff5555"
elseif remaining < 10 then
color = "|cffffff55"
end
if remaining < 60 then
return color..ceil(remaining)
elseif remaining < 3600 then
return color..ceil(remaining/60).."M"
elseif remaining < 43200 then
return color..ceil(remaining/3600).."H"
else
return color..ceil(remaining/43200).."D"
end
end
local TimeConvert = ShaguTweaks.TimeConvert
local function CreateTextCooldown(cooldown)
if cooldown.readable then return end