OpenDream
OpenDream copied to clipboard
Time displays as minute (with decimal) : seconds instead of minutes:seconds
Issue on paradise test on SS14
This uses the following code:
/proc/add_zero(t, u)
while(length(t) < u)
t = "0[t]"
return t
/// 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)]"
called here:
var/timeleft = SSshuttle.emergency.timeLeft()
if(SSshuttle.emergency.mode < SHUTTLE_DOCKED)
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'>[seconds_to_full_clock(timeleft)]</a><br>"
Not sure what's going wrong with it.
the second_to_full_clock should be something like this
/proc/seconds_to_full_clock(seconds as num)
return "[round(seconds / 3600)]:[add_zero(num2text(seconds / 60), 2)]:[add_zero(num2text(seconds % 60), 2)]"
Fixed by #1759