From cda689393e45864fd17d098465e600b2ea56a84f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 3 Jul 2021 23:23:07 +0200 Subject: [PATCH] [MIRROR] PDAs now include round time (#6672) * PDAs now include round time (#59957) Part of my document on duplicating verb panel functionality so at some point in the far, far future we may be rid of it. you can read more here. hackmd.io/tJ5H3opRQiG1GCN1sP142w The other thing the status panel needs to do is send time dilation to the tgui chat. Having messed around with tgui chat, I am very confident i'm going to need stylemistake or mothblocks help me out with that one, it's so beyond my level it isn't even funny. I know this is a VERY long description for a very small change but expect more of this in the future * PDAs now include round time Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com> --- code/__DEFINES/time.dm | 7 ++++++- code/controllers/subsystem/statpanel.dm | 3 +-- code/game/objects/items/devices/PDA/PDA.dm | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/time.dm b/code/__DEFINES/time.dm index 5632333ffab..afdc5509e06 100644 --- a/code/__DEFINES/time.dm +++ b/code/__DEFINES/time.dm @@ -1,4 +1,9 @@ -#define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day +///number of deciseconds in a day +#define MIDNIGHT_ROLLOVER 864000 + +///displays the current time into the round, with a lot of extra code just there for ensuring it looks okay after an entire day passes +#define ROUND_TIME ( "[world.time - SSticker.round_start_time > MIDNIGHT_ROLLOVER ? "[round(world.time - SSticker.round_start_time/MIDNIGHT_ROLLOVER)]:[worldtime2text()]" : worldtime2text()]" ) + #define JANUARY 1 #define FEBRUARY 2 diff --git a/code/controllers/subsystem/statpanel.dm b/code/controllers/subsystem/statpanel.dm index ab2ddfc9496..f4f777f0fb7 100644 --- a/code/controllers/subsystem/statpanel.dm +++ b/code/controllers/subsystem/statpanel.dm @@ -13,13 +13,12 @@ SUBSYSTEM_DEF(statpanels) /datum/controller/subsystem/statpanels/fire(resumed = FALSE) if (!resumed) var/datum/map_config/cached = SSmapping.next_map_config - var/round_time = world.time - SSticker.round_start_time var/list/global_data = list( "Map: [SSmapping.config?.map_name || "Loading..."]", cached ? "Next Map: [cached.map_name]" : null, "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]", "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]", - "Round Time: [round_time > MIDNIGHT_ROLLOVER ? "[round(round_time/MIDNIGHT_ROLLOVER)]:[worldtime2text()]" : worldtime2text()]", + "Round Time: [ROUND_TIME]", "Station Time: [station_time_timestamp()]", "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)" ) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index d09238ee779..456259aef64 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -259,7 +259,9 @@ GLOBAL_LIST_EMPTY(PDAs) dat += text("
[id ? "Update PDA Info" : ""]

") dat += "[station_time_timestamp()]
" //:[world.time / 100 % 6][world.time / 100 % 10]" - dat += "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]" + dat += "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]
" + dat += "It has been [ROUND_TIME] since the emergency shuttle was last called." + dat += "

"