Skip to content

Commit

Permalink
update cooldown format
Browse files Browse the repository at this point in the history
show only minutes in case hhmm threshold enabled and cooldown lower than 1 hr
  • Loading branch information
Loaal committed Sep 28, 2019
1 parent b4ce228 commit 104f4b8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ElvUI/Core/Math.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function E:GetTimeInfo(s, threshhold, hhmm, mmss)
return s/MINUTE, 5, 0.51, s%MINUTE
else
local minutes = floor((s/MINUTE)+.5)
if hhmm and s < (hhmm * MINUTE) then
if hhmm and s < (hhmm * MINUTE) and 60 < minutes then
return s/HOUR, 6, minutes > 1 and (s - (minutes*MINUTE - HALFMINUTEISH)) or (s - MINUTEISH), minutes%MINUTE
else
return ceil(s / MINUTE), 2, minutes > 1 and (s - (minutes*MINUTE - HALFMINUTEISH)) or (s - MINUTEISH)
Expand All @@ -321,12 +321,14 @@ function E:GetTimeInfo(s, threshhold, hhmm, mmss)
elseif s < DAY then
if mmss and s < mmss then
return s/MINUTE, 5, 0.51, s%MINUTE
elseif hhmm and s < (hhmm * MINUTE) then
local minutes = floor((s/MINUTE)+.5)
return s/HOUR, 6, minutes > 1 and (s - (minutes*MINUTE - HALFMINUTEISH)) or (s - MINUTEISH), minutes%MINUTE
else
local hours = floor((s/HOUR)+.5)
return ceil(s / HOUR), 1, hours > 1 and (s - (hours*HOUR - HALFHOURISH)) or (s - HOURISH)
local minutes = floor((s/MINUTE)+.5)
if hhmm and s < (hhmm * MINUTE) and 60 < minutes then
return s/HOUR, 6, minutes > 1 and (s - (minutes*MINUTE - HALFMINUTEISH)) or (s - MINUTEISH), minutes%MINUTE
else
local hours = floor((s/HOUR)+.5)
return ceil(s / HOUR), 1, hours > 1 and (s - (hours*HOUR - HALFHOURISH)) or (s - HOURISH)
end
end
else
local days = floor((s/DAY)+.5)
Expand Down

0 comments on commit 104f4b8

Please sign in to comment.