Add seconds to hh:mm:ss proc for Check Antagonists panel (#22733)

* My lost hours

* Update player_panel.dm
This commit is contained in:
Vi3trice
2023-10-12 15:27:10 +01:00
committed by GitHub
parent a837c0eb6b
commit fde04ee997
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -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)
+2 -2
View File
@@ -358,10 +358,10 @@
else
var/timeleft = SSshuttle.emergency.timeLeft()
if(SSshuttle.emergency.mode < SHUTTLE_DOCKED)
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[seconds_to_full_clock(timeleft)]</a><br>"
dat += "<a href='?_src_=holder;call_shuttle=2'>Send Back</a><br>"
else
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[seconds_to_full_clock(timeleft)]</a><br>"
dat += "<a href='?src=[UID()];delay_round_end=1'>[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
dat += "<br><b>Antagonist Teams</b><br>"