From fde04ee99718650193c577305f8612e4d0fe0019 Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:27:10 -0400 Subject: [PATCH] Add seconds to hh:mm:ss proc for Check Antagonists panel (#22733) * My lost hours * Update player_panel.dm --- code/__HELPERS/time.dm | 6 +++++- code/modules/admin/player_panel.dm | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 75e39c80280..3eb421604a9 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -110,10 +110,14 @@ var/numMinutes = (seconds - numSeconds) / 60 return "[numMinutes] [numMinutes > 1 ? "minutes" : "minute"] and [numSeconds] seconds" -//Take a value in seconds and makes it display like a clock +/// Take a value in seconds and makes it display like a clock. Hours are stripped. (mm:ss) /proc/seconds_to_clock(seconds as num) return "[add_zero(num2text((seconds / 60) % 60), 2)]:[add_zero(num2text(seconds % 60), 2)]" +/// Take a value in seconds and makes it display like a clock (h:mm:ss) +/proc/seconds_to_full_clock(seconds as num) + return "[round(seconds / 3600)]:[add_zero(num2text((seconds / 60) % 60), 2)]:[add_zero(num2text(seconds % 60), 2)]" + //Takes a value of time in deciseconds. //Returns a text value of that number in hours, minutes, or seconds. /proc/DisplayTimeText(time_value) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index d67132ddf08..c19cd604c70 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -358,10 +358,10 @@ else var/timeleft = SSshuttle.emergency.timeLeft() if(SSshuttle.emergency.mode < SHUTTLE_DOCKED) - dat += "ETA: [(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]
" + dat += "ETA: [seconds_to_full_clock(timeleft)]
" dat += "Send Back
" else - dat += "ETA: [(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]
" + dat += "ETA: [seconds_to_full_clock(timeleft)]
" dat += "[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]
" dat += "
Antagonist Teams
"