diff --git a/code/__DEFINES/paper.dm b/code/__DEFINES/paper.dm index e77086a40e5..ff4c4a50856 100644 --- a/code/__DEFINES/paper.dm +++ b/code/__DEFINES/paper.dm @@ -43,3 +43,7 @@ #define LIST_PAPER_STAMP_X "x" #define LIST_PAPER_STAMP_Y "y" #define LIST_PAPER_ROTATION "rotation" + +///Use in conjunction with `advanced_html` to have underlined text that, when hovered over, will let you see additional text. +///Would be appreciated if you avoided dotted underlined (and underlined in general) text elsewhere so players don't get confused. +#define UNDERLINED_HTML_TEXT(text_displayed, revealed_text) "[text_displayed]" diff --git a/code/__DEFINES/time.dm b/code/__DEFINES/time.dm index d445b4ec461..0ac278a4f86 100644 --- a/code/__DEFINES/time.dm +++ b/code/__DEFINES/time.dm @@ -1,8 +1,8 @@ ///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(...) ( "[STATION_TIME_PASSED() > MIDNIGHT_ROLLOVER ? "[round(STATION_TIME_PASSED()/MIDNIGHT_ROLLOVER)]:[gameTimestamp(wtime = STATION_TIME_PASSED())]" : gameTimestamp(wtime = STATION_TIME_PASSED())]" ) +/// In-universe, SS13 is set 540 years in the future from the real-world day, hence this number for determining the year-offset for the in-game year. +#define STATION_YEAR_OFFSET 540 ///Returns the time that has passed since the game started #define STATION_TIME_PASSED(...) (world.time - SSticker.round_start_time) @@ -10,12 +10,6 @@ /// Define that just has the current in-universe year for use in whatever context you might want to display that in. (For example, 2022 -> 2562 given a 540 year offset) #define CURRENT_STATION_YEAR (GLOB.year_integer + STATION_YEAR_OFFSET) -/// Used in the GLOB year and tgui PreInit -#define UTC_YEAR time2text(world.realtime,"YYYY",NO_TIMEZONE) - -/// In-universe, SS13 is set 540 years in the future from the real-world day, hence this number for determining the year-offset for the in-game year. -#define STATION_YEAR_OFFSET 540 - #define JANUARY 1 #define FEBRUARY 2 #define MARCH 3 diff --git a/code/__HELPERS/logging/mob.dm b/code/__HELPERS/logging/mob.dm index f5f51256f32..d4ab156bcd9 100644 --- a/code/__HELPERS/logging/mob.dm +++ b/code/__HELPERS/logging/mob.dm @@ -46,7 +46,7 @@ if(LOG_RADIO_EMOTE) colored_message = "(RADIOEMOTE) [colored_message]" - var/list/timestamped_message = list("\[[time_stamp(format = "YYYY-MM-DD hh:mm:ss")]\] [key_name_and_tag(src)] [loc_name(src)] (Event #[LAZYLEN(logging[smessage_type])])" = colored_message) + var/list/timestamped_message = list("\[[server_timestamp(format = "YYYY-MM-DD hh:mm:ss")]\] [key_name_and_tag(src)] [loc_name(src)] (Event #[LAZYLEN(logging[smessage_type])])" = colored_message) logging[smessage_type] += timestamped_message diff --git a/code/__HELPERS/logging/research.dm b/code/__HELPERS/logging/research.dm index f352123f9a2..704e8cb6c45 100644 --- a/code/__HELPERS/logging/research.dm +++ b/code/__HELPERS/logging/research.dm @@ -3,4 +3,4 @@ if(!text) return var/html_file = file("[GLOB.log_directory]/[INVESTIGATE_RESEARCH].html") - WRITE_FILE(html_file, "[time_stamp(format = "YYYY-MM-DD hh:mm:ss")] [text]
") + WRITE_FILE(html_file, "[server_timestamp(format = "YYYY-MM-DD hh:mm:ss")] [text]
") diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 59e95ad8e85..eab1103fc81 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -1,30 +1,14 @@ -/// Returns UTC timestamp with the specifified format and optionally deciseconds -/proc/time_stamp(format = "hh:mm:ss", show_ds) - var/time_string = time2text(world.timeofday, format, TIMEZONE_UTC) +/// Returns UTC timestamp with the specifified format, with optionally deciseconds or optional IC time (year offset), AKA Nanotrasen Standard Time (NST) +/proc/server_timestamp(format = "hh:mm:ss", show_ds, ic_time, twelve_hour_clock) + var/time_string = twelve_hour_clock ? time_to_twelve_hour(format, world.timeofday, world.timezone) : time2text(world.timeofday, format, world.timezone) + if(ic_time && findtext(format, "YYYY")) //if we have a year, replace the year + time_string = replacetext_char(time_string, "[GLOB.year_integer]", CURRENT_STATION_YEAR) return show_ds ? "[time_string]:[world.timeofday % 10]" : time_string -/// Returns timestamp since the server started, for use with world.time -/proc/gameTimestamp(format = "hh:mm:ss", wtime=world.time) +/// Returns timestamp since the round started, AKA Pay Time (PT) +/proc/round_timestamp(format = "hh:mm:ss", wtime = STATION_TIME_PASSED()) return time2text(wtime, format, NO_TIMEZONE) -///returns the current IC station time in a world.time format -/proc/station_time(wtime = world.time) - return (((wtime - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % (24 HOURS) - -///returns the current IC station time in a human readable format -/proc/station_time_timestamp(format = "hh:mm:ss", wtime) - return time2text(station_time(wtime), format, NO_TIMEZONE) - -/proc/station_time_debug(force_set) - if(isnum(force_set)) - SSticker.gametime_offset = force_set - return - SSticker.gametime_offset = rand(0, 24 HOURS) //hours in day * minutes in hour * seconds in minute * deciseconds in second - if(prob(50)) - SSticker.gametime_offset = FLOOR(SSticker.gametime_offset, 1 HOURS) - else - SSticker.gametime_offset = CEILING(SSticker.gametime_offset, 1 HOURS) - ///returns timestamp in a sql and a not-quite-compliant ISO 8601 friendly format. Do not use for SQL, use NOW() instead /proc/ISOtime(timevar) return time2text(timevar || world.timeofday, "YYYY-MM-DD hh:mm:ss", world.timezone) @@ -128,7 +112,7 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0) * the format arg is the format passed down to time2text() (e.g. "hh:mm" is hours and minutes but not seconds). * the timezone is the time value offset from the local time. It's to be applied outside time2text() to get the AM/PM right. */ -/proc/time_to_twelve_hour(time, format = "hh:mm:ss", timezone = TIMEZONE_UTC) +/proc/time_to_twelve_hour(format = "hh:mm:ss", time = STATION_TIME_PASSED(), timezone = NO_TIMEZONE) time = MODULUS(time + (timezone * (1 HOURS)), 24 HOURS) var/am_pm = "AM" if(time > 12 HOURS) @@ -137,4 +121,5 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0) time -= 12 HOURS // e.g. 4:16 PM but not 00:42 PM else if (time < 1 HOURS) time += 12 HOURS // e.g. 12.23 AM - return "[time2text(time, format)] [am_pm]" + //set NO_TIMEZONE because we've already applied the timezone above. + return "[time2text(time, format, NO_TIMEZONE)] [am_pm]" diff --git a/code/_globalvars/time_vars.dm b/code/_globalvars/time_vars.dm index fd9b925e0d4..a006a4bc699 100644 --- a/code/_globalvars/time_vars.dm +++ b/code/_globalvars/time_vars.dm @@ -1,6 +1,3 @@ -/// The difference betwen midnight (of the host computer) and 0 world.ticks. -GLOBAL_VAR_INIT(timezoneOffset, 0) - -GLOBAL_VAR_INIT(year, UTC_YEAR) +GLOBAL_VAR_INIT(year, time2text(world.timeofday, "YYYY", TIMEZONE_UTC)) GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013??? diff --git a/code/_onclick/hud/screen_objects/new_player.dm b/code/_onclick/hud/screen_objects/new_player.dm index 5a17abfc5d9..47977aab8eb 100644 --- a/code/_onclick/hud/screen_objects/new_player.dm +++ b/code/_onclick/hud/screen_objects/new_player.dm @@ -695,7 +695,7 @@ if(round_started) new_maptext = "[SSmapping.current_map.map_name]
\ [LAZYLEN(GLOB.clients)] player\s online
\ - [ROUND_TIME()] in
" + [round_timestamp()] in
" new_maptext += "
" else if(hud.mymob.client?.holder) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index 0ccde360e3b..4191f5c6fcd 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -396,15 +396,6 @@ /datum/config_entry/flag/enable_night_shifts -/datum/config_entry/flag/randomize_shift_time - -/datum/config_entry/flag/shift_time_realtime - -/datum/config_entry/number/shift_time_start_hour - default = 12 - min_val = 0 - max_val = 23 - /datum/config_entry/number/monkeycap default = 64 min_val = 0 diff --git a/code/controllers/subsystem/economy.dm b/code/controllers/subsystem/economy.dm index 750cdfc7d7c..02cea10cdc8 100644 --- a/code/controllers/subsystem/economy.dm +++ b/code/controllers/subsystem/economy.dm @@ -217,7 +217,7 @@ SUBSYSTEM_DEF(economy) "account" = "[account.account_holder]", "cost" = price_to_use, "vendor" = "[astype(vendor, /atom)?.name || vendor]", - "stationtime" = station_time_timestamp("hh:mm"), + "stationtime" = round_timestamp("hh:mm"), )) /** diff --git a/code/controllers/subsystem/explosions.dm b/code/controllers/subsystem/explosions.dm index f5c733c0fd6..4e7d0d5fb8a 100644 --- a/code/controllers/subsystem/explosions.dm +++ b/code/controllers/subsystem/explosions.dm @@ -367,7 +367,7 @@ ADMIN_VERB(check_bomb_impacts, R_DEBUG, "Check Bomb Impact", "See what the effec var/y0 = epicenter.y var/z0 = epicenter.z var/area/areatype = get_area(epicenter) - SSblackbox.record_feedback("associative", "explosion", 1, list("dev" = devastation_range, "heavy" = heavy_impact_range, "light" = light_impact_range, "flame" = flame_range, "flash" = flash_range, "orig_dev" = orig_dev_range, "orig_heavy" = orig_heavy_range, "orig_light" = orig_light_range, "x" = x0, "y" = y0, "z" = z0, "area" = areatype.type, "time" = time_stamp("YYYY-MM-DD hh:mm:ss", 1), "possible_cause" = explosion_cause, "possible_suspect" = who_did_it_game_log)) + SSblackbox.record_feedback("associative", "explosion", 1, list("dev" = devastation_range, "heavy" = heavy_impact_range, "light" = light_impact_range, "flame" = flame_range, "flash" = flash_range, "orig_dev" = orig_dev_range, "orig_heavy" = orig_heavy_range, "orig_light" = orig_light_range, "x" = x0, "y" = y0, "z" = z0, "area" = areatype.type, "time" = server_timestamp("YYYY-MM-DD hh:mm:ss", 1), "possible_cause" = explosion_cause, "possible_suspect" = who_did_it_game_log)) // Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves. // Stereo users will also hear the direction of the explosion! diff --git a/code/controllers/subsystem/networks/modular_computers.dm b/code/controllers/subsystem/networks/modular_computers.dm index eb25e0c97ae..40ce21c51cd 100644 --- a/code/controllers/subsystem/networks/modular_computers.dm +++ b/code/controllers/subsystem/networks/modular_computers.dm @@ -146,7 +146,7 @@ SUBSYSTEM_DEF(modular_computers) */ /datum/controller/subsystem/modular_computers/proc/add_log(log_string) var/list/log_text = list() - log_text += "\[[station_time_timestamp()]\]" + log_text += "\[[round_timestamp()]\]" log_text += "*SYSTEM* - " log_text += log_string log_string = log_text.Join() diff --git a/code/controllers/subsystem/nightshift.dm b/code/controllers/subsystem/nightshift.dm deleted file mode 100644 index 170f1269614..00000000000 --- a/code/controllers/subsystem/nightshift.dm +++ /dev/null @@ -1,66 +0,0 @@ -SUBSYSTEM_DEF(nightshift) - name = "Night Shift" - wait = 10 MINUTES - - var/nightshift_active = FALSE - var/nightshift_start_time = 702000 //7:30 PM, station time - var/nightshift_end_time = 270000 //7:30 AM, station time - var/nightshift_first_check = 30 SECONDS - - var/high_security_mode = FALSE - var/list/currentrun - -/datum/controller/subsystem/nightshift/Initialize() - if(!CONFIG_GET(flag/enable_night_shifts)) - can_fire = FALSE - return SS_INIT_SUCCESS - -/datum/controller/subsystem/nightshift/fire(resumed = FALSE) - if(resumed) - update_nightshift(resumed = TRUE) - return - if(world.time - SSticker.round_start_time < nightshift_first_check) - return - check_nightshift() - -/datum/controller/subsystem/nightshift/proc/announce(message) - priority_announce( - text = message, - sound = 'sound/announcer/notice/notice2.ogg', - sender_override = "Automated Lighting System Announcement", - color_override = "grey", - ) - -/datum/controller/subsystem/nightshift/proc/check_nightshift() - var/emergency = SSsecurity_level.get_current_level_as_number() >= SEC_LEVEL_RED - var/announcing = TRUE - var/time = station_time() - var/night_time = (time < nightshift_end_time) || (time > nightshift_start_time) - if(high_security_mode != emergency) - high_security_mode = emergency - if(night_time) - announcing = FALSE - if(!emergency) - announce("Restoring night lighting configuration to normal operation.") - else - announce("Disabling night lighting: Station is in a state of emergency.") - if(emergency) - night_time = FALSE - if(nightshift_active != night_time) - update_nightshift(night_time, announcing) - -/datum/controller/subsystem/nightshift/proc/update_nightshift(active, announce = TRUE, resumed = FALSE, forced = FALSE) - if(!resumed) - currentrun = SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/power/apc) - nightshift_active = active - if(announce) - if (active) - announce("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.") - else - announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.") - for(var/obj/machinery/power/apc/APC as anything in currentrun) - currentrun -= APC - if (APC.area && (APC.area.type in GLOB.the_station_areas)) - APC.set_nightshift(nightshift_active) - if(MC_TICK_CHECK && !forced) // subsystem will be in state SS_IDLE if forced by an admin - return diff --git a/code/controllers/subsystem/security_level.dm b/code/controllers/subsystem/security_level.dm index 2e48d593fae..c88237ec7ea 100644 --- a/code/controllers/subsystem/security_level.dm +++ b/code/controllers/subsystem/security_level.dm @@ -42,9 +42,6 @@ SUBSYSTEM_DEF(security_level) if(!selected_level) CRASH("set_level was called with an invalid security level([new_level])") - if(SSnightshift.can_fire && (selected_level.number_level >= SEC_LEVEL_RED || current_security_level.number_level >= SEC_LEVEL_RED)) - SSnightshift.next_fire = world.time + 7 SECONDS // Fire nightshift after the security level announcement is complete - if(announce) level_announce(selected_level, current_security_level.number_level) // We want to announce BEFORE updating to the new level diff --git a/code/controllers/subsystem/statpanel.dm b/code/controllers/subsystem/statpanel.dm index 27c0b2d597d..191d270dbbd 100644 --- a/code/controllers/subsystem/statpanel.dm +++ b/code/controllers/subsystem/statpanel.dm @@ -37,9 +37,8 @@ SUBSYSTEM_DEF(statpanels) global_data += list( "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]", - "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss", world.timezone)]", - "Round Time: [ROUND_TIME()]", - "Station Time: [station_time_timestamp()]", + "Server Time/NST: [server_timestamp(format = "YYYY-MM-DD hh:mm:ss")]", + "Shift Time/PT: [(SSticker.round_start_time == 0) ? "Pre-Game" : round_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/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm index 9f5d518b6c2..df33cf68c8c 100644 --- a/code/controllers/subsystem/tgui.dm +++ b/code/controllers/subsystem/tgui.dm @@ -37,7 +37,7 @@ SUBSYSTEM_DEF(tgui) ntos_error = "" basehtml = replacetextEx(basehtml, "", ntos_error) - basehtml = replacetextEx(basehtml, "", "Nanotrasen (c) 2525-[text2num(UTC_YEAR) + STATION_YEAR_OFFSET]") // This can't use the GLOB as it runs before those are populated + basehtml = replacetextEx(basehtml, "", "Nanotrasen (c) 2525-[CURRENT_STATION_YEAR]") /datum/controller/subsystem/tgui/OnConfigLoad() var/storage_iframe = CONFIG_GET(string/storage_cdn_iframe) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 6bd850c3d08..9c5f67ec601 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -38,9 +38,6 @@ SUBSYSTEM_DEF(ticker) var/timeLeft //pregame timer var/start_at - var/gametime_offset = 432000 //Deciseconds to add to world.time for station time. - var/station_time_rate_multiplier = 12 //factor of station time progressal vs real time. - /// Num of players, used for pregame stats on statpanel var/totalPlayers = 0 /// Num of ready players, used for pregame stats on statpanel (only viewable by admins) @@ -131,21 +128,14 @@ SUBSYSTEM_DEF(ticker) GLOB.syndicate_code_response_regex = codeword_match start_at = world.time + (CONFIG_GET(number/lobby_countdown) * (1 SECONDS)) - round_start_time = start_at // May be changed later, but prevents the time from jumping back when the round actually starts - if(CONFIG_GET(flag/randomize_shift_time)) - gametime_offset = rand(0, 23) * (1 HOURS) - else if(CONFIG_GET(flag/shift_time_realtime)) - gametime_offset = world.timeofday + GLOB.timezoneOffset - station_time_rate_multiplier = 1 - else - gametime_offset = (CONFIG_GET(number/shift_time_start_hour) * (1 HOURS)) + return SS_INIT_SUCCESS /datum/controller/subsystem/ticker/fire() switch(current_state) if(GAME_STATE_STARTUP) if(Master.initializations_finished_with_no_players_logged_in) - start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10) + start_at = world.time + (CONFIG_GET(number/lobby_countdown) * (1 SECONDS)) for(var/client/C in GLOB.clients) window_flash(C, ignorepref = TRUE) //let them know lobby has opened up. to_chat(world, span_notice("Welcome to [station_name()]!")) @@ -156,9 +146,9 @@ SUBSYSTEM_DEF(ticker) fire() if(GAME_STATE_PREGAME) - //lobby stats for statpanels + //lobby stats for statpanels if(isnull(timeLeft)) - timeLeft = max(0,start_at - world.time) + timeLeft = max(0, start_at - world.time) totalPlayers = LAZYLEN(GLOB.new_player_list) totalPlayersReady = 0 total_admins_ready = 0 @@ -191,7 +181,7 @@ SUBSYSTEM_DEF(ticker) if(!setup()) //setup failed current_state = GAME_STATE_STARTUP - start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10) + start_at = world.time + (CONFIG_GET(number/lobby_countdown) * (1 SECONDS)) timeLeft = null Master.SetRunLevel(RUNLEVEL_LOBBY) SEND_SIGNAL(src, COMSIG_TICKER_ERROR_SETTING_UP) diff --git a/code/datums/records/crime.dm b/code/datums/records/crime.dm index 729b85c56b8..a403923ab80 100644 --- a/code/datums/records/crime.dm +++ b/code/datums/records/crime.dm @@ -19,7 +19,7 @@ src.author = author src.details = details src.name = name - src.time = station_time_timestamp() + src.time = round_timestamp() /datum/crime/citation /// Fine for the crime diff --git a/code/datums/request_message.dm b/code/datums/request_message.dm index 18feada06cb..c88433e5ca9 100644 --- a/code/datums/request_message.dm +++ b/code/datums/request_message.dm @@ -21,7 +21,7 @@ /datum/request_message/New(data) sender_department = data["sender_department"] - received_time = station_time_timestamp() + received_time = round_timestamp() content = data["message"] message_verified_by = data["verified"] message_stamped_by = data["stamped"] diff --git a/code/datums/status_effects/debuffs/debuffs.dm b/code/datums/status_effects/debuffs/debuffs.dm index b55a385e237..08f36ff7036 100644 --- a/code/datums/status_effects/debuffs/debuffs.dm +++ b/code/datums/status_effects/debuffs/debuffs.dm @@ -289,7 +289,7 @@ var/delta = world.time - last_dead_time var/new_timeofdeath = owner.timeofdeath + delta owner.timeofdeath = new_timeofdeath - owner.station_timestamp_timeofdeath = station_time_timestamp(wtime=new_timeofdeath) + owner.station_timestamp_timeofdeath = round_timestamp(wtime=new_timeofdeath) last_dead_time = null if(owner.stat == DEAD) last_dead_time = world.time diff --git a/code/game/machinery/computer/accounting.dm b/code/game/machinery/computer/accounting.dm index 05a1d12ed40..6ccc1d2c7b3 100644 --- a/code/game/machinery/computer/accounting.dm +++ b/code/game/machinery/computer/accounting.dm @@ -37,7 +37,7 @@ data["accounts"] = player_accounts data["audit_log"] = SSeconomy.audit_log data["crashing"] = HAS_TRAIT(SSeconomy, TRAIT_MARKET_CRASHING) - data["station_time"] = station_time_timestamp("hh:mm") + data["station_time"] = round_timestamp("hh:mm") return data /obj/machinery/computer/accounting/ui_static_data(mob/user) diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index 6c56f6e2aa6..a7add4639c3 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -48,7 +48,7 @@ /obj/machinery/computer/apc_control/proc/log_activity(log_text) if(!should_log) return - LAZYADD(logs, "([station_time_timestamp()]): [auth_id] [log_text]") + LAZYADD(logs, "([round_timestamp()]): [auth_id] [log_text]") ///Resets the console's emagged state and re-enables logging of activity /obj/machinery/computer/apc_control/proc/restore_comp(mob/user) diff --git a/code/game/machinery/computer/records/medical.dm b/code/game/machinery/computer/records/medical.dm index d148b5bd262..108abd8fbf9 100644 --- a/code/game/machinery/computer/records/medical.dm +++ b/code/game/machinery/computer/records/medical.dm @@ -100,7 +100,7 @@ if(!content) return FALSE - var/datum/medical_note/new_note = new(usr.name, content, station_time_timestamp()) + var/datum/medical_note/new_note = new(usr.name, content, round_timestamp()) while(length(target.medical_notes) > 2) target.medical_notes.Cut(1, 2) diff --git a/code/game/machinery/digital_clock.dm b/code/game/machinery/digital_clock.dm index 57c58083aae..e43ed60c32f 100644 --- a/code/game/machinery/digital_clock.dm +++ b/code/game/machinery/digital_clock.dm @@ -110,7 +110,7 @@ if(obj_flags & EMAGGED) station_minutes = rand(0, 99) else - station_minutes = text2num(station_time_timestamp(format = "mm")) + station_minutes = text2num(round_timestamp(format = "mm")) // tenth / the '3' in '31' / 31 -> 3.1 -> 3 var/station_minute_tenth = station_minutes >= 10 ? round(station_minutes * 0.1) : 0 @@ -122,7 +122,7 @@ if(obj_flags & EMAGGED) station_hours = rand(0, 99) else - station_hours = text2num(station_time_timestamp(format = "hh")) + station_hours = text2num(round_timestamp(format = "hh")) // one / the '1' in '12' / 12 -> 1.2 -> 1 var/station_hours_tenth = station_minutes >= 10 ? round(station_hours * 0.1) : 0 diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index edce48f662d..3ff1662d99b 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1575,7 +1575,7 @@ bolt() //Bolt it! set_electrified(MACHINE_ELECTRIFIED_PERMANENT) //Shock it! if(origin) - LAZYADD(shockedby, "\[[time_stamp()]\] [key_name(origin)]") + LAZYADD(shockedby, "\[[server_timestamp()]\] [key_name(origin)]") /obj/machinery/door/airlock/disable_lockdown() @@ -1599,7 +1599,7 @@ return if(prob(severity*10 - 20) && (secondsElectrified < 30) && (secondsElectrified != MACHINE_ELECTRIFIED_PERMANENT)) set_electrified(30) - LAZYADD(shockedby, "\[[time_stamp()]\]EM Pulse") + LAZYADD(shockedby, "\[[server_timestamp()]\]EM Pulse") /obj/machinery/door/airlock/proc/set_electrified(seconds, mob/user) secondsElectrified = seconds @@ -1616,7 +1616,7 @@ message = "unshocked" else message = "temp shocked for [secondsElectrified] seconds" - LAZYADD(shockedby, "\[[time_stamp()]\] [key_name(user)] - ([uppertext(message)])") + LAZYADD(shockedby, "\[[server_timestamp()]\] [key_name(user)] - ([uppertext(message)])") log_combat(user, src, message) add_hiddenprint(user) diff --git a/code/game/machinery/newscaster/newscaster_data.dm b/code/game/machinery/newscaster/newscaster_data.dm index 59b8f09db47..6c91c94d6af 100644 --- a/code/game/machinery/newscaster/newscaster_data.dm +++ b/code/game/machinery/newscaster/newscaster_data.dm @@ -207,7 +207,7 @@ GLOBAL_LIST_EMPTY(request_list) var/datum/feed_message/new_article = new /datum/feed_message new_article.author = author new_article.body = msg - new_article.time_stamp = "[station_time_timestamp()]" + new_article.time_stamp = "[round_timestamp()]" new_article.is_admin_message = adminMessage new_article.locked = !allow_comments @@ -243,7 +243,7 @@ GLOBAL_LIST_EMPTY(request_list) var/datum/feed_comment/new_feed_comment = new/datum/feed_comment new_feed_comment.author = newscaster_username new_feed_comment.body = comment_text - new_feed_comment.time_stamp = station_time_timestamp() + new_feed_comment.time_stamp = round_timestamp() GLOB.news_network.last_action ++ current_message.comments += new_feed_comment if(user) diff --git a/code/game/machinery/telecomms/machines/message_server.dm b/code/game/machinery/telecomms/machines/message_server.dm index f9fb183e53e..cb34bf1e813 100644 --- a/code/game/machinery/telecomms/machines/message_server.dm +++ b/code/game/machinery/telecomms/machines/message_server.dm @@ -105,7 +105,7 @@ if (calibrating) calibrating += world.time say("Calibrating... Estimated wait time: [rand(3, 9)] minutes.") - pda_msgs += new /datum/data_tablet_msg("System Administrator", "system", "This is an automated message. System calibration started at [station_time_timestamp()].") + pda_msgs += new /datum/data_tablet_msg("System Administrator", "system", "This is an automated message. System calibration started at [server_timestamp(ic_time = TRUE)] (PT: [round_timestamp()]).") else pda_msgs += new /datum/data_tablet_msg("System Administrator", "system", MESSAGE_SERVER_FUNCTIONING_MESSAGE) diff --git a/code/game/objects/items/AI_modules/_AI_modules.dm b/code/game/objects/items/AI_modules/_AI_modules.dm index 3422f57ac3b..69c809c903e 100644 --- a/code/game/objects/items/AI_modules/_AI_modules.dm +++ b/code/game/objects/items/AI_modules/_AI_modules.dm @@ -89,7 +89,7 @@ else to_chat(user, span_notice("Upload complete.")) - var/time = time2text(world.realtime,"hh:mm:ss", TIMEZONE_UTC) + var/time = round_timestamp() var/ainame = law_datum.owner ? law_datum.owner.name : "empty AI core" var/aikey = law_datum.owner ? law_datum.owner.ckey : "null" diff --git a/code/game/objects/items/devices/scanners/autopsy_scanner.dm b/code/game/objects/items/devices/scanners/autopsy_scanner.dm index c541e513a0d..5e0376879e7 100644 --- a/code/game/objects/items/devices/scanners/autopsy_scanner.dm +++ b/code/game/objects/items/devices/scanners/autopsy_scanner.dm @@ -54,8 +54,9 @@ var/obj/item/paper/autopsy_report = new(get_turf(src)) autopsy_report.color = "#99ccff" - autopsy_report.name = "autopsy report of [scanned] - [station_time_timestamp()])" - var/final_report_text = "
Autopsy report. Time of Autopsy: [station_time_timestamp()]
" + autopsy_report.name = "autopsy report of [scanned] - [server_timestamp(format = "hh:mm", ic_time = TRUE)]" + var/final_report_text = "
Autopsy report
\ + Time of Autopsy: [UNDERLINED_HTML_TEXT("[server_timestamp(format = "hh:mm", ic_time = TRUE)]", "Shift Time: [round_timestamp(format = "hh:mm")]")]
" //A lot of this is extremely similar to /proc/healthscan() - but with different formatting, no color, and some added/removed info //Does not list quirks/exhaustion/how to repair wounds @@ -240,7 +241,7 @@ autopsy_information += "Coroner's Notes:" //Bottom of the page, anything past here is player-written final_report_text += jointext(autopsy_information, "") - autopsy_report.add_raw_text(final_report_text) + autopsy_report.add_raw_text(final_report_text, advanced_html = TRUE) autopsy_report.update_appearance() user.put_in_hands(autopsy_report) user.balloon_alert(user, "report printed") diff --git a/code/game/objects/items/devices/scanners/health_analyzer.dm b/code/game/objects/items/devices/scanners/health_analyzer.dm index a3684806967..c3ae145b51e 100644 --- a/code/game/objects/items/devices/scanners/health_analyzer.dm +++ b/code/game/objects/items/devices/scanners/health_analyzer.dm @@ -80,7 +80,7 @@ span_notice("You stupidly try to analyze [scan_turf]'s vitals!"), ) - var/floor_text = "Analyzing results for [scan_turf] ([station_time_timestamp()]):
" + var/floor_text = "Analyzing results for [scan_turf] ([round_timestamp()]):
" floor_text += "Overall status: Unknown
" floor_text += "Subject lacks a brain.
" floor_text += "Body temperature: [scan_turf?.return_air()?.return_temperature() || "???"]
" @@ -168,7 +168,7 @@ oxy_loss += 200 - (oxy_loss + tox_loss + fire_loss + brute_loss) oxy_loss = clamp(oxy_loss, 0, 200) - render_list += "[span_info("Analyzing results for [target] ([station_time_timestamp()]):")]
Overall status: [mob_status]
" + render_list += "[span_info("Analyzing results for [target] ([round_timestamp()]):")]
Overall status: [mob_status]
" if(!advanced && target.has_reagent(/datum/reagent/inverse/technetium)) advanced = TRUE @@ -474,11 +474,12 @@ var/obj/item/paper/medical_report/report_paper = new(get_turf(src)) report_paper.color = "#99ccff" - report_paper.name = "health scan report - [station_time_timestamp()]" - var/report_text = "
Health scan report. Time of retrieval: [station_time_timestamp()]

" + report_paper.name = "health scan report - [server_timestamp(format = "hh:mm", ic_time = TRUE)]" + var/report_text = "
Health scan report
\ + Time of retrieval: [UNDERLINED_HTML_TEXT("[server_timestamp(format = "hh:mm", ic_time = TRUE)]", "Shift Time: [round_timestamp(format = "hh:mm")]")]

" report_text += last_scan_text - report_paper.add_raw_text(report_text) + report_paper.add_raw_text(report_text, advanced_html = TRUE) report_paper.update_appearance() user.put_in_hands(report_paper) diff --git a/code/game/objects/items/devices/table_clock.dm b/code/game/objects/items/devices/table_clock.dm index 0d819536366..c4420a81383 100644 --- a/code/game/objects/items/devices/table_clock.dm +++ b/code/game/objects/items/devices/table_clock.dm @@ -31,8 +31,9 @@ if(broken) . += span_info("It appears to be currently broken. You can use it in-hand to repair it.") else - . += span_info("The current CST (local) time is: [station_time_timestamp()].") - . += span_info("The current TCT (galactic) time is: [time2text(world.realtime, "hh:mm:ss", NO_TIMEZONE)].") + . += span_info("The current NST (local) time is: [server_timestamp(ic_time = TRUE, twelve_hour_clock = user.client?.prefs.read_preference(/datum/preference/toggle/twelve_hour))].") + if(user.is_literate()) + . += span_info("That means it is currently [round_timestamp()] into the shift.") /obj/item/table_clock/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers) . = ..() diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index ce765778cb6..a4f64946c0e 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1139,7 +1139,9 @@ /obj/item/toy/clockwork_watch/examine(mob/user) . = ..() - . += span_info("Station Time: [station_time_timestamp()]") + . += span_info("Station Time: [server_timestamp(ic_time = TRUE, twelve_hour_clock = user.client?.prefs.read_preference(/datum/preference/toggle/twelve_hour))]") + if(user.is_literate()) + . += span_info("That means it is currently [round_timestamp()] into the shift.") /* * Toy Dagger diff --git a/code/game/objects/structures/signs/signs_interactive.dm b/code/game/objects/structures/signs/signs_interactive.dm index 5ef9031fef9..49ae5ba6c29 100644 --- a/code/game/objects/structures/signs/signs_interactive.dm +++ b/code/game/objects/structures/signs/signs_interactive.dm @@ -1,14 +1,15 @@ /obj/structure/sign/clock name = "wall clock" - desc = "It's your run-of-the-mill wall clock showing both the local Coalition Standard Time and the galactic Treaty Coordinated Time. Perfect for staring at instead of working." + desc = "It's your run-of-the-mill wall clock showing both the local Nanotrasen Standard Time and the galactic Treaty Coordinated Time. Perfect for staring at instead of working." icon_state = "clock" MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/clock, 32) /obj/structure/sign/clock/examine(mob/user) . = ..() - . += span_info("The current CST (local) time is: [station_time_timestamp()].") - . += span_info("The current TCT (galactic) time is: [time2text(world.realtime, "hh:mm:ss", 0)].") + . += span_info("The current NST (local) time is: [server_timestamp(ic_time = TRUE, twelve_hour_clock = user.client?.prefs.read_preference(/datum/preference/toggle/twelve_hour))].") + if(user.is_literate()) + . += span_info("That means it is currently [round_timestamp()] into the shift.") /obj/structure/sign/calendar name = "wall calendar" diff --git a/code/game/world.dm b/code/game/world.dm index a243dd09e38..7561bfbd4bb 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -126,12 +126,7 @@ GLOBAL_VAR(restart_counter) * All atoms in both compiled and uncompiled maps are initialized() */ /world/New() - log_world("World loaded at [time_stamp()]!") - - // From a really fucking old commit (91d7150) - // I wanted to move it but I think this needs to be after /world/New is called but before any sleeps? - // - Dominion/Cyberboss - GLOB.timezoneOffset = world.timezone * 36000 + log_world("World loaded at [server_timestamp()]!") // First possible sleep() InitTgs() @@ -244,7 +239,7 @@ GLOBAL_VAR(restart_counter) GLOB.picture_logging_prefix += "R_[GLOB.round_id]_" GLOB.picture_log_directory += "[GLOB.round_id]" else - var/timestamp = replacetext(time_stamp(), ":", ".") + var/timestamp = replacetext(server_timestamp(), ":", ".") GLOB.log_directory += "[timestamp]" GLOB.picture_log_directory += "[timestamp]" GLOB.picture_logging_prefix += "T_[timestamp]_" @@ -373,14 +368,14 @@ GLOBAL_VAR_INIT(last_maptick_time, 0) return #else if(check_hard_reboot()) - log_world("World hard rebooted at [time_stamp()]") + log_world("World hard rebooted at [server_timestamp()]") shutdown_logging() // See comment below. QDEL_NULL(Tracy) QDEL_NULL(Debugger) TgsEndProcess() return ..() - log_world("World rebooted at [time_stamp()]") + log_world("World rebooted at [server_timestamp()]") shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss. QDEL_NULL(Tracy) @@ -436,7 +431,7 @@ GLOBAL_VAR_INIT(last_maptick_time, 0) else if(SSticker.current_state == GAME_STATE_SETTING_UP) new_status += "
Starting: Now" else if(SSticker.IsRoundInProgress()) - new_status += "
Time: [time2text(STATION_TIME_PASSED(), "hh:mm", NO_TIMEZONE)]" + new_status += "
Time: [round_timestamp("hh:mm")]" if(SSshuttle?.emergency && SSshuttle?.emergency?.mode != (SHUTTLE_IDLE || SHUTTLE_ENDGAME)) new_status += " | Shuttle: [SSshuttle.emergency.getModeStr()] [SSshuttle.emergency.getTimerStr()]" else if(SSticker.current_state == GAME_STATE_FINISHED) diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index e3840198665..642675dfc37 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -10,7 +10,7 @@ var/mob/living/source_mob = src source += " ([source_mob.ckey ? source_mob.ckey : "*no key*"])" - WRITE_FILE(F, "[time_stamp(format = "YYYY-MM-DD hh:mm:ss")] [REF(src)] ([x],[y],[z]) || [source] [message]
") + WRITE_FILE(F, "[server_timestamp(format = "YYYY-MM-DD hh:mm:ss")] [REF(src)] ([x],[y],[z]) || [source] [message]
") ADMIN_VERB(investigate_show, R_NONE, "Investigate", "Browse various detailed logs.", ADMIN_CATEGORY_GAME) var/static/list/investigates = list( diff --git a/code/modules/admin/verbs/admin_newscaster.dm b/code/modules/admin/verbs/admin_newscaster.dm index e300150659b..ec96d8babce 100644 --- a/code/modules/admin/verbs/admin_newscaster.dm +++ b/code/modules/admin/verbs/admin_newscaster.dm @@ -311,7 +311,7 @@ ADMIN_VERB(access_news_network, R_ADMIN, "Access Newscaster Network", "Allows yo var/datum/feed_comment/new_feed_comment = new /datum/feed_comment new_feed_comment.author = "Centcom Official" new_feed_comment.body = comment_text - new_feed_comment.time_stamp = station_time_timestamp() + new_feed_comment.time_stamp = round_timestamp() current_message.comments += new_feed_comment GLOB.news_network.last_action ++ usr.log_message("(as an admin) commented on message [current_message.return_body(-1)] -- [current_message.body]", LOG_COMMENT) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 4c235a48ca3..94f9eae85fb 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -278,7 +278,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) "PLAYERS" = player_count, "ROUND STATE" = round_state, "ROUND ID" = GLOB.round_id, - "ROUND TIME" = ROUND_TIME(), + "ROUND TIME" = round_timestamp(), "MESSAGE" = message, "ADMINS" = admin_text, ) @@ -356,9 +356,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) heard_by_no_admins = FALSE send2adminchat(initiator_ckey, "Ticket #[id]: Answered by [key_name(usr)]") - ticket_interactions += "[time_stamp()]: [formatted_message]" + ticket_interactions += "[server_timestamp()]: [formatted_message]" if (!isnull(player_message)) - player_interactions += "[time_stamp()]: [player_message]" + player_interactions += "[server_timestamp()]: [player_message]" //Removes the ahelp verb and returns it after 2 minutes /datum/admin_help/proc/TimeoutVerb() @@ -566,9 +566,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) dat += "[FOURSPACES][TicketHref("Refresh", ref_src)][FOURSPACES][TicketHref("Re-Title", ref_src, "retitle")]" if(state != AHELP_ACTIVE) dat += "[FOURSPACES][TicketHref("Reopen", ref_src, "reopen")]" - dat += "

Opened at: [gameTimestamp(wtime = opened_at)] (Approx [DisplayTimeText(world.time - opened_at)] ago)" + dat += "

Opened at: [round_timestamp(wtime = opened_at)] (Approx [DisplayTimeText(world.time - opened_at)] ago)" if(closed_at) - dat += "
Closed at: [gameTimestamp(wtime = closed_at)] (Approx [DisplayTimeText(world.time - closed_at)] ago)" + dat += "
Closed at: [round_timestamp(wtime = closed_at)] (Approx [DisplayTimeText(world.time - closed_at)] ago)" dat += "

" if(initiator) dat += "Actions: [FullMonty(ref_src)]
" @@ -666,9 +666,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) else dat += "UNKNOWN" dat += "\n[FOURSPACES]Refresh" - dat += "

Opened at: [gameTimestamp("hh:mm:ss", opened_at)] (Approx [DisplayTimeText(world.time - opened_at)] ago)" + dat += "

Opened at: [round_timestamp("hh:mm:ss", opened_at)] (Approx [DisplayTimeText(world.time - opened_at)] ago)" if(closed_at) - dat += "
Closed at: [gameTimestamp("hh:mm:ss", closed_at)] (Approx [DisplayTimeText(world.time - closed_at)] ago)" + dat += "
Closed at: [round_timestamp("hh:mm:ss", closed_at)] (Approx [DisplayTimeText(world.time - closed_at)] ago)" dat += "

" dat += "
Log:

" for (var/interaction in player_interactions) diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index 33c9afe6d5e..84ccaf2935b 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -163,21 +163,6 @@ ADMIN_VERB(secrets, R_NONE, "Secrets", "Abuse harder than you ever have before w log_admin("[key_name(holder)] reset the station name.") message_admins(span_adminnotice("[key_name_admin(holder)] reset the station name.")) priority_announce("[command_name()] has renamed the station to \"[new_name]\".") - if("night_shift_set") - var/val = tgui_alert(holder, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", list("On", "Off", "Automatic")) - switch(val) - if("Automatic") - if(CONFIG_GET(flag/enable_night_shifts)) - SSnightshift.can_fire = TRUE - SSnightshift.fire() - else - SSnightshift.update_nightshift(active = FALSE, announce = TRUE, forced = TRUE) - if("On") - SSnightshift.can_fire = FALSE - SSnightshift.update_nightshift(active = TRUE, announce = TRUE, forced = TRUE) - if("Off") - SSnightshift.can_fire = FALSE - SSnightshift.update_nightshift(active = FALSE, announce = TRUE, forced = TRUE) if("moveferry") SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Send CentCom Ferry")) if(!SSshuttle.toggleShuttle("ferry","ferry_home","ferry_away")) diff --git a/code/modules/admin/verbs/sprite_auditor.dm b/code/modules/admin/verbs/sprite_auditor.dm index 64022618c28..e1ffc660706 100644 --- a/code/modules/admin/verbs/sprite_auditor.dm +++ b/code/modules/admin/verbs/sprite_auditor.dm @@ -11,7 +11,7 @@ GLOBAL_DATUM_INIT(sprite_auditor, /datum/sprite_auditor, new) "name" = author.real_name, "ckey" = author.ckey, "appearance" = icon_appearance, - "timestamp" = gameTimestamp(), + "timestamp" = round_timestamp(), ))) SStgui.update_uis(src) diff --git a/code/modules/antagonists/heretic/heretic_knowledge.dm b/code/modules/antagonists/heretic/heretic_knowledge.dm index 48aeb721c1a..0c5efc1a959 100644 --- a/code/modules/antagonists/heretic/heretic_knowledge.dm +++ b/code/modules/antagonists/heretic/heretic_knowledge.dm @@ -555,7 +555,7 @@ to_chat(user, span_boldnotice("[name] completed!")) to_chat(user, span_hypnophrase(span_big("[pick_list(HERETIC_INFLUENCE_FILE, "drain_message")]"))) desc += " (Completed!)" - log_heretic_knowledge("[key_name(user)] completed a [name] at [gameTimestamp()].") + log_heretic_knowledge("[key_name(user)] completed a [name] at [round_timestamp()].") user.add_mob_memory(/datum/memory/heretic_knowledge_ritual) SEND_SIGNAL(our_heretic, COMSIG_HERETIC_PASSIVE_UPGRADE_FINAL) return TRUE @@ -586,7 +586,7 @@ var/list/cost = our_heretic.researched_knowledge[knowledge][HKT_COST] total_points += cost - log_heretic_knowledge("[key_name(user)] gained knowledge of their final ritual at [gameTimestamp()]. \ + log_heretic_knowledge("[key_name(user)] gained knowledge of their final ritual at [round_timestamp()]. \ They have [length(our_heretic.researched_knowledge)] knowledge nodes researched, totalling [total_points] points \ and have sacrificed [our_heretic.total_sacrifices] people ([our_heretic.high_value_sacrifices] of which were high value)") @@ -636,7 +636,7 @@ human_user.physiology.burn_mod *= 0.5 SSblackbox.record_feedback("tally", "heretic_ascended", 1, heretic_datum.heretic_path.route) - log_heretic_knowledge("[key_name(user)] completed their final ritual at [gameTimestamp()].") + log_heretic_knowledge("[key_name(user)] completed their final ritual at [round_timestamp()].") notify_ghosts( "[user.real_name] has completed an ascension ritual!", source = user, diff --git a/code/modules/cargo/order.dm b/code/modules/cargo/order.dm index af2f2f655eb..0f62be3dbab 100644 --- a/code/modules/cargo/order.dm +++ b/code/modules/cargo/order.dm @@ -109,7 +109,7 @@ var/requisition_text = "

[station_name()] Supply Requisition

" requisition_text += "
" requisition_text += "Order #[id]
" - requisition_text+= "Time of Order: [station_time_timestamp()]
" + requisition_text += "Time of Order: [UNDERLINED_HTML_TEXT("[server_timestamp(ic_time = TRUE)]", "Shift Time: [round_timestamp()]")]
" requisition_text += "Item: [pack.name]
" requisition_text += "Access Restrictions: [SSid_access.get_access_desc(pack.access)]
" requisition_text += "Requested by: [orderer]
" @@ -118,7 +118,7 @@ requisition_text += "Rank: [orderer_rank]
" requisition_text += "Comment: [reason]
" - requisition_paper.add_raw_text(requisition_text) + requisition_paper.add_raw_text(requisition_text, advanced_html = TRUE) requisition_paper.update_appearance() return requisition_paper diff --git a/code/modules/cargo/orderconsole.dm b/code/modules/cargo/orderconsole.dm index b3964610671..cda0c1a37e7 100644 --- a/code/modules/cargo/orderconsole.dm +++ b/code/modules/cargo/orderconsole.dm @@ -394,10 +394,10 @@ //create the paper from the SSshuttle.shopping_list if(length(SSshuttle.shopping_list)) var/obj/item/paper/requisition/requisition_paper = new(get_turf(src)) - requisition_paper.name = "requisition form - [station_time_timestamp()]" + requisition_paper.name = "requisition form - [server_timestamp(ic_time = TRUE)] (PT: [round_timestamp()])" var/requisition_text = "

[station_name()] Supply Requisition

" requisition_text += "
" - requisition_text += "Time of Order: [station_time_timestamp()]

" + requisition_text += "Time of Order: [UNDERLINED_HTML_TEXT("[server_timestamp(ic_time = TRUE)]", "Shift Time: [round_timestamp()]")]

" for(var/datum/supply_order/order as anything in SSshuttle.shopping_list) requisition_text += "[order.pack.name]
" requisition_text += "- Order ID: [order.id]
" @@ -412,7 +412,7 @@ if(reason) requisition_text += "- Reason Given: [reason]
" requisition_text += "

" - requisition_paper.add_raw_text(requisition_text) + requisition_paper.add_raw_text(requisition_text, advanced_html = TRUE) requisition_paper.color = "#9ef5ff" requisition_paper.update_appearance() diff --git a/code/modules/client/preferences/time.dm b/code/modules/client/preferences/time.dm new file mode 100644 index 00000000000..698618571ec --- /dev/null +++ b/code/modules/client/preferences/time.dm @@ -0,0 +1,5 @@ +/datum/preference/toggle/twelve_hour + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + savefile_key = "twelve_hour" + savefile_identifier = PREFERENCE_PLAYER + default_value = FALSE diff --git a/code/modules/detectivework/scanner.dm b/code/modules/detectivework/scanner.dm index a7cebef7bf2..bb1285c11a5 100644 --- a/code/modules/detectivework/scanner.dm +++ b/code/modules/detectivework/scanner.dm @@ -117,7 +117,7 @@ // Start gathering log_entry.scan_target = scanned_atom.name - log_entry.scan_time = station_time_timestamp() + log_entry.scan_time = round_timestamp() var/list/atom_fibers = GET_ATOM_FIBRES(scanned_atom) if(length(atom_fibers)) diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index f8355f53064..57eab84a1f9 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -110,7 +110,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0) var/skipcount = abs(error_cooldown[erroruid]) - 1 error_cooldown[erroruid] = 0 if(skipcount > 0) - SEND_TEXT(world.log, "\[[time_stamp()]] Skipped [skipcount] runtimes in [E.file],[E.line].") + SEND_TEXT(world.log, "\[[server_timestamp()]] Skipped [skipcount] runtimes in [E.file],[E.line].") GLOB.error_cache.log_error(E, skip_count = skipcount) error_last_seen[erroruid] = world.time @@ -158,7 +158,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0) if(GLOB.error_cache) GLOB.error_cache.log_error(E, desclines) - var/main_line = "\[[time_stamp()]] Runtime in [E.file],[E.line]: [E]" + var/main_line = "\[[server_timestamp()]] Runtime in [E.file],[E.line]: [E]" SEND_TEXT(world.log, main_line) for(var/line in desclines) SEND_TEXT(world.log, line) diff --git a/code/modules/error_handler/error_viewer.dm b/code/modules/error_handler/error_viewer.dm index fa0d1dcc981..7ffba15b40f 100644 --- a/code/modules/error_handler/error_viewer.dm +++ b/code/modules/error_handler/error_viewer.dm @@ -131,10 +131,10 @@ GLOBAL_DATUM(error_cache, /datum/error_viewer/error_cache) /datum/error_viewer/error_source/New(exception/e) if (!istype(e)) - name = "\[[time_stamp()]] Uncaught exceptions" + name = "\[[server_timestamp()]] Uncaught exceptions" return - name = "\[[time_stamp()]] Runtime in [e.file], line [e.line]: [html_encode(e.name)]" + name = "\[[server_timestamp()]] Runtime in [e.file], line [e.line]: [html_encode(e.name)]" /datum/error_viewer/error_source/show_to(user, datum/error_viewer/back_to, linear) if (!istype(back_to)) @@ -156,15 +156,15 @@ GLOBAL_DATUM(error_cache, /datum/error_viewer/error_cache) /datum/error_viewer/error_entry/New(exception/e, list/desclines, skip_count) if (!istype(e)) - name = "\[[time_stamp()]] Uncaught exception: [html_encode(e.name)]" + name = "\[[server_timestamp()]] Uncaught exception: [html_encode(e.name)]" return if(skip_count) - name = "\[[time_stamp()]] Skipped [skip_count] runtimes in [e.file],[e.line]." + name = "\[[server_timestamp()]] Skipped [skip_count] runtimes in [e.file],[e.line]." is_skip_count = TRUE return - name = "\[[time_stamp()]] Runtime in [e.file], line [e.line]: [html_encode(e.name)]" + name = "\[[server_timestamp()]] Runtime in [e.file], line [e.line]: [html_encode(e.name)]" exc = e if (istype(desclines)) for (var/line in desclines) diff --git a/code/modules/escape_menu/details.dm b/code/modules/escape_menu/details.dm index 00267ecba5d..69a6cc8f4d8 100644 --- a/code/modules/escape_menu/details.dm +++ b/code/modules/escape_menu/details.dm @@ -1,42 +1,16 @@ -// This doesn't instantiate right away, since we rely on other GLOBs -GLOBAL_DATUM(escape_menu_details, /atom/movable/screen/escape_menu/details) - -/// Provides a singleton for the escape menu details screen. -/proc/give_escape_menu_details() - if (isnull(GLOB.escape_menu_details)) - GLOB.escape_menu_details = new - - return GLOB.escape_menu_details - /atom/movable/screen/escape_menu/details - screen_loc = "EAST:-180,NORTH:-34" + screen_loc = "EAST:-175,NORTH:-40" maptext_height = 100 maptext_width = 200 -/atom/movable/screen/escape_menu/details/Initialize(mapload, datum/hud/hud_owner) - . = ..() - - update_text() - START_PROCESSING(SSescape_menu, src) - -/atom/movable/screen/escape_menu/details/Destroy() - if (GLOB.escape_menu_details == src) - stack_trace("Something tried to delete the escape menu details screen") - return QDEL_HINT_LETMELIVE - - STOP_PROCESSING(SSescape_menu, src) - return ..() - -/atom/movable/screen/escape_menu/details/process(seconds_per_tick) - update_text() - -/atom/movable/screen/escape_menu/details/proc/update_text() +/atom/movable/screen/escape_menu/details/proc/update_text(client/client_owner) var/new_maptext = {" Round ID: [GLOB.round_id || "Unset"]
- Round Time: [ROUND_TIME()]
+ Server Time (NST): [server_timestamp(format = "hh:mm:ss", ic_time = TRUE, twelve_hour_clock = client_owner.prefs.read_preference(/datum/preference/toggle/twelve_hour))]
+ Shift Time (PT): [(SSticker.round_start_time == 0) ? "Pre-Game" : round_timestamp()]
Map: [SSmapping.current_map.return_map_name(webmap_included = TRUE) || "Loading..."]
- Time Dilation: [round(SStime_track.time_dilation_current,1)]%
+ Time Dilation: [round(SStime_track.time_dilation_current, 1)]%
"} diff --git a/code/modules/escape_menu/escape_menu.dm b/code/modules/escape_menu/escape_menu.dm index 0042a6f7332..53940e0ae07 100644 --- a/code/modules/escape_menu/escape_menu.dm +++ b/code/modules/escape_menu/escape_menu.dm @@ -24,6 +24,8 @@ GLOBAL_LIST_EMPTY(escape_menus) var/client/client /// A weakref to the hud this escape menu currently applies to var/datum/weakref/our_hud_ref + /// The details at the top right that persists through all screens, showing round info. + var/atom/movable/screen/escape_menu/details/detail_screen VAR_PRIVATE ckey @@ -49,6 +51,8 @@ GLOBAL_LIST_EMPTY(escape_menus) base_holder = new(client) if(isnull(dim_screen)) dim_screen = new() + detail_screen = new() + detail_screen.update_text(client) populate_base_ui() page_holder = new(client) @@ -64,7 +68,10 @@ GLOBAL_LIST_EMPTY(escape_menus) if (!isnull(ckey)) GLOB.escape_menus[ckey] = src + START_PROCESSING(SSescape_menu, src) + /datum/escape_menu/Destroy(force) + STOP_PROCESSING(SSescape_menu, src) QDEL_NULL(base_holder) QDEL_NULL(page_holder) resource_panels = null // list contents were already qdeled in QDEL_NULL(page_holder), so we can safely null this @@ -82,6 +89,9 @@ GLOBAL_LIST_EMPTY(escape_menus) return ..() +/datum/escape_menu/process(seconds_per_tick) + detail_screen.update_text(client) + /datum/escape_menu/proc/on_client_qdel() SIGNAL_HANDLER PRIVATE_PROC(TRUE) @@ -127,7 +137,7 @@ GLOBAL_LIST_EMPTY(escape_menus) PRIVATE_PROC(TRUE) base_holder.give_protected_screen_object(dim_screen) - base_holder.give_protected_screen_object(give_escape_menu_details()) + base_holder.give_screen_object(detail_screen) /datum/escape_menu/proc/open_home_page() PRIVATE_PROC(TRUE) diff --git a/code/modules/events/nightshift.dm b/code/modules/events/nightshift.dm new file mode 100644 index 00000000000..785ad8e04ac --- /dev/null +++ b/code/modules/events/nightshift.dm @@ -0,0 +1,78 @@ +/datum/round_event_control/nightshift + name = "Night Shift" + typepath = /datum/round_event/nightshift + weight = 2 + max_occurrences = 1 + earliest_start = 30 SECONDS + category = EVENT_CATEGORY_FRIENDLY + description = "Sets the station's lights to Night Shift mode for the next 20 minutes." + +/datum/round_event_control/nightshift/New() + . = ..() + if(!CONFIG_GET(flag/enable_night_shifts)) + max_occurrences = 0 + +/datum/round_event/nightshift + announce_when = 1 + start_when = 1 + end_when = 700 //~22 Minutes + fakeable = FALSE + + ///Whether the nightshift is on or not, synced to the alert level (which decides whether we're active) + ///TRUE means they are disabled by red alert. + var/nightshift_disabled = FALSE + ///APCs to update through ticks to account for lag. + var/list/currentrun + +/datum/round_event/nightshift/announce(fake) + update_nightshift(active = TRUE, announce = TRUE) + +/datum/round_event/nightshift/tick() + var/emergency = (SSsecurity_level.get_current_level_as_number() >= SEC_LEVEL_RED) + if(nightshift_disabled != emergency) + nightshift_disabled = emergency + if(emergency) + update_nightshift(active = FALSE, resume = TRUE) + else + update_nightshift(active = TRUE, resume = TRUE) + + update_machines() + +/datum/round_event/nightshift/end() + update_nightshift(active = FALSE, announce = TRUE) + +///Called several times, to start & stop nightlights including during red alert/de-red alerting. +/datum/round_event/nightshift/proc/update_nightshift(active, resume = FALSE, announce = FALSE) + currentrun = SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/power/apc) + + if(announce) + if(active) + send_announcement("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.") + else + send_announcement("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.") + + if(resume) + if(active) + send_announcement("Restoring night lighting configuration to normal operation.") + else + send_announcement("Disabling night lighting: Station is in a state of emergency.") + + update_machines() + +///Called on process that will slowly update all APCs to be nightlight +/datum/round_event/nightshift/proc/update_machines() + for(var/obj/machinery/power/apc/APC as anything in currentrun) + currentrun -= APC + if (APC.area && (APC.area.type in GLOB.the_station_areas)) + APC.set_nightshift(!nightshift_disabled) + if(TICK_CHECK) + return + +///Custom messages sent throughout the event that we'll do here, instead of using the `announce` proc that's only at the start. +/datum/round_event/nightshift/proc/send_announcement(message) + priority_announce( + text = message, + sound = 'sound/announcer/notice/notice2.ogg', + sender_override = "Automated Lighting System Announcement", + color_override = "grey", + ) diff --git a/code/modules/food_and_drinks/recipes/food_mixtures.dm b/code/modules/food_and_drinks/recipes/food_mixtures.dm index 15368d2c543..31458a4a129 100644 --- a/code/modules/food_and_drinks/recipes/food_mixtures.dm +++ b/code/modules/food_and_drinks/recipes/food_mixtures.dm @@ -121,8 +121,7 @@ /datum/chemical_reaction/food/chocolatepudding/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) . = ..() - var/station_time = station_time() - if(!ISINRANGE(station_time, 3 HOURS + 45 MINUTES, 4 HOURS + 15 MINUTES)) + if(!ISINRANGE(world.timeofday, 3 HOURS + 45 MINUTES, 4 HOURS + 15 MINUTES)) return var/lastkey = holder.my_atom?.fingerprintslast if(!lastkey) diff --git a/code/modules/forensics/_forensics.dm b/code/modules/forensics/_forensics.dm index e03790e27b0..af37a9b5958 100644 --- a/code/modules/forensics/_forensics.dm +++ b/code/modules/forensics/_forensics.dm @@ -214,7 +214,7 @@ var/mob/living/carbon/human/human_suspect = suspect if(human_suspect.gloves) has_gloves = "(gloves)" - var/current_time = time_stamp() + var/current_time = round_timestamp() if(!LAZYACCESS(hiddenprints, suspect.key)) LAZYSET(hiddenprints, suspect.key, "First: \[[current_time]\] \"[suspect.real_name]\"[has_gloves]. Ckey: [suspect.ckey]") else diff --git a/code/modules/mining/machine_silo.dm b/code/modules/mining/machine_silo.dm index d35002d32f5..deb61dca16b 100644 --- a/code/modules/mining/machine_silo.dm +++ b/code/modules/mining/machine_silo.dm @@ -564,7 +564,7 @@ var/alist/user_data /datum/ore_silo_log/New(obj/machinery/M, _action, _amount, _noun, list/mats=list(), alist/user_data) - timestamp = station_time_timestamp() + timestamp = round_timestamp() machine_name = M.name area_name = get_area_name(M, TRUE) action = _action diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 32421516713..a7de4804b76 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -232,7 +232,7 @@ set_stat(DEAD) timeofdeath = world.time - station_timestamp_timeofdeath = station_time_timestamp() + station_timestamp_timeofdeath = round_timestamp() var/turf/death_turf = get_turf(src) var/area/death_area = get_area(src) // Display a death message if the mob is a player mob (has an active mind) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 240ddabf39d..1ae21953f23 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -487,7 +487,7 @@ create_modularInterface() var/mob/living/silicon/robot/robo = modularInterface.silicon_owner if(istype(robo)) - modularInterface.borglog += "[station_time_timestamp()] - [string]" + modularInterface.borglog += "[round_timestamp()] - [string]" var/datum/computer_file/program/robotact/program = modularInterface.get_robotact() if(program) var/datum/tgui/active_ui = SStgui.get_open_ui(src, program.computer) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 14bb9471a7c..765bfe5b89f 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -542,7 +542,7 @@ if(stat != DEAD) if(!silent) emote("deathgasp") - station_timestamp_timeofdeath = station_time_timestamp() + station_timestamp_timeofdeath = round_timestamp() if(!HAS_TRAIT(src, TRAIT_FAKEDEATH) && !silent) send_death_moodlets() diff --git a/code/modules/mod/modules/modules_general.dm b/code/modules/mod/modules/modules_general.dm index cf88eeffb1f..9cc733599ba 100644 --- a/code/modules/mod/modules/modules_general.dm +++ b/code/modules/mod/modules/modules_general.dm @@ -244,7 +244,7 @@ /obj/item/mod/module/status_readout/add_ui_data() . = ..() .["display_time"] = display_time - .["shift_time"] = station_time_timestamp() + .["shift_time"] = round_timestamp() .["shift_id"] = GLOB.round_id .["health"] = mod.wearer?.health || 0 .["health_max"] = mod.wearer?.getMaxHealth() || 0 diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index cced073163e..1225479d73b 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -687,7 +687,7 @@ data["PC_programheaders"] = program_headers - data["PC_stationtime"] = station_time_timestamp() + data["PC_stationtime"] = round_timestamp() data["PC_stationdate"] = "[time2text(world.realtime, "DDD, Month DD", NO_TIMEZONE)], [CURRENT_STATION_YEAR]" data["PC_showexitprogram"] = !!active_program // Hides "Exit Program" button on mainscreen return data diff --git a/code/modules/modular_computers/file_system/programs/chatroom/conversation.dm b/code/modules/modular_computers/file_system/programs/chatroom/conversation.dm index 969e56195ed..0e65dfedd2a 100644 --- a/code/modules/modular_computers/file_system/programs/chatroom/conversation.dm +++ b/code/modules/modular_computers/file_system/programs/chatroom/conversation.dm @@ -46,13 +46,13 @@ return ..() /datum/ntnet_conversation/proc/add_message(message, username) - message = "[station_time_timestamp(format = "hh:mm")] [username]: [message]" + message = "[round_timestamp(format = "hh:mm")] [username]: [message]" messages["[next_message_id]"] = message next_message_id++ trim_message_list() /datum/ntnet_conversation/proc/add_status_message(message) - message = "[station_time_timestamp(format = "hh:mm")] -!- [message]" + message = "[round_timestamp(format = "hh:mm")] -!- [message]" messages["[next_message_id]"] = message next_message_id++ trim_message_list() diff --git a/code/modules/modular_computers/file_system/programs/crewmanifest.dm b/code/modules/modular_computers/file_system/programs/crewmanifest.dm index d0dcf0ae873..eccb78a58ff 100644 --- a/code/modules/modular_computers/file_system/programs/crewmanifest.dm +++ b/code/modules/modular_computers/file_system/programs/crewmanifest.dm @@ -23,7 +23,7 @@
[GLOB.manifest ? GLOB.manifest.get_html(0) : ""] "} - if(!computer.print_text(contents, "crew manifest ([station_time_timestamp()])")) + if(!computer.print_text(contents, "crew manifest ([round_timestamp()])")) to_chat(usr, span_notice("Printer is out of paper.")) return else diff --git a/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm b/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm index dc83a7a76ae..e393ff2a60f 100644 --- a/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm +++ b/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm @@ -544,7 +544,7 @@ return FALSE // Log it in our logs - var/datum/pda_message/message_datum = new(message, TRUE, station_time_timestamp(PDA_MESSAGE_TIMESTAMP_FORMAT), photo_asset_key, everyone) + var/datum/pda_message/message_datum = new(message, TRUE, round_timestamp(PDA_MESSAGE_TIMESTAMP_FORMAT), photo_asset_key, everyone) for(var/datum/pda_chat/target_chat as anything in target_chats) target_chat.add_message(message_datum, show_in_recents = !everyone) target_chat.unread_messages = 0 @@ -675,7 +675,7 @@ // don't create a new chat for rigged messages, make it a one off notif if(!is_rigged) - var/datum/pda_message/message = new(signal.data["message"], FALSE, station_time_timestamp(PDA_MESSAGE_TIMESTAMP_FORMAT), signal.data["photo"], signal.data["everyone"]) + var/datum/pda_message/message = new(signal.data["message"], FALSE, round_timestamp(PDA_MESSAGE_TIMESTAMP_FORMAT), signal.data["photo"], signal.data["everyone"]) chat = find_chat_by_recipient(is_fake_user ? fake_name : sender_ref, is_fake_user) if(!istype(chat)) diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index b82d9549764..1761a7fe69f 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -477,7 +477,7 @@ GLOBAL_VAR_INIT(fax_autoprinting, FALSE) var/list/history_data = list() history_data["history_type"] = history_type history_data["history_fax_name"] = history_fax_name - history_data["history_time"] = station_time_timestamp() + history_data["history_time"] = round_timestamp() fax_history += list(history_data) /// Clears the history of fax operations. diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 78f591b3ec3..5b2459d3caf 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -233,9 +233,9 @@ if(is_signature) field_text = signature_name else if(is_date) - field_text = "[time2text(world.timeofday, "DD/MM", NO_TIMEZONE)]/[CURRENT_STATION_YEAR]" + field_text = "[server_timestamp("DD/MM/YYYY", ic_time = TRUE)]" else if(is_time) - field_text = time2text(world.timeofday, "hh:mm", NO_TIMEZONE) + field_text = round_timestamp() var/field_font = is_signature ? SIGNATURE_FONT : font diff --git a/code/modules/power/apc/apc_main.dm b/code/modules/power/apc/apc_main.dm index 2f53861f406..4af0bb0496b 100644 --- a/code/modules/power/apc/apc_main.dm +++ b/code/modules/power/apc/apc_main.dm @@ -660,9 +660,11 @@ equipment = autoset(equipment, AUTOSET_ON) lighting = autoset(lighting, AUTOSET_ON) environ = autoset(environ, AUTOSET_ON) - if(nightshift_lights && low_power_nightshift_lights) + //If nightlights are on, and we're recovering from low power/nightlight event, we'll remove it. + var/nightshift_disabled = !(locate(/datum/round_event/nightshift) in SSevents.running) + if(nightshift_lights && (nightshift_disabled || low_power_nightshift_lights)) low_power_nightshift_lights = FALSE - if(!SSnightshift.nightshift_active) + if(nightshift_disabled) INVOKE_ASYNC(src, PROC_REF(set_nightshift), FALSE) if(cell_percent > APC_CHANNEL_ALARM_TRESHOLD) alarm_manager.clear_alarm(ALARM_POWER) diff --git a/code/modules/requests/request_manager.dm b/code/modules/requests/request_manager.dm index d2257515f8f..77051641e50 100644 --- a/code/modules/requests/request_manager.dm +++ b/code/modules/requests/request_manager.dm @@ -270,7 +270,7 @@ GLOBAL_DATUM_INIT(requests, /datum/request_manager, new) "message" = request.message, "additional_info" = request.additional_information, "timestamp" = request.timestamp, - "timestamp_str" = gameTimestamp(wtime = request.timestamp) + "timestamp_str" = round_timestamp(wtime = request.timestamp) )) data["fax_autoprinting"] = GLOB.fax_autoprinting return data diff --git a/code/modules/research/ordnance/_scipaper.dm b/code/modules/research/ordnance/_scipaper.dm index 0b5efc03e10..e5fa3c3c8f0 100644 --- a/code/modules/research/ordnance/_scipaper.dm +++ b/code/modules/research/ordnance/_scipaper.dm @@ -185,7 +185,7 @@ author = "Unknown" et_alia = FALSE if(!abstract) - abstract = "Published on [station_time_timestamp()]" + abstract = "Published on [server_timestamp(ic_time = TRUE)] (PT: [round_timestamp()])" /datum/scientific_paper/explosive /** diff --git a/code/modules/research/ordnance/doppler_array.dm b/code/modules/research/ordnance/doppler_array.dm index b39758918ea..e22bb36b8e6 100644 --- a/code/modules/research/ordnance/doppler_array.dm +++ b/code/modules/research/ordnance/doppler_array.dm @@ -169,7 +169,7 @@ var/datum/data/tachyon_record/new_record = new /datum/data/tachyon_record() new_record.name = "Log Recording #[record_number]" - new_record.timestamp = station_time_timestamp() + new_record.timestamp = "[server_timestamp(ic_time = TRUE)] (PT: [round_timestamp()])" new_record.coordinates = "[epicenter.x], [epicenter.y]" new_record.displacement = took new_record.factual_radius["epicenter_radius"] = devastation_range diff --git a/code/modules/research/ordnance/tank_compressor.dm b/code/modules/research/ordnance/tank_compressor.dm index 4887b41849b..0631a7ed0aa 100644 --- a/code/modules/research/ordnance/tank_compressor.dm +++ b/code/modules/research/ordnance/tank_compressor.dm @@ -169,7 +169,7 @@ var/datum/data/compressor_record/new_record = new() new_record.name = "Log Recording #[record_number]" new_record.experiment_source = inserted_tank.name - new_record.timestamp = station_time_timestamp() + new_record.timestamp = "[server_timestamp(ic_time = TRUE)] (PT: [round_timestamp()])" for(var/gas_path in leaked_gas_buffer.gases) new_record.gas_data[gas_path] = leaked_gas_buffer.gases[gas_path][MOLES] diff --git a/code/modules/reta/reta_system.dm b/code/modules/reta/reta_system.dm index ebcfe06d896..51591a20590 100644 --- a/code/modules/reta/reta_system.dm +++ b/code/modules/reta/reta_system.dm @@ -5,7 +5,7 @@ /// Helper function for RETA-specific logging /proc/log_reta(text) - WRITE_LOG(GLOB.reta_log, "[time_stamp()] RETA: [text]") + WRITE_LOG(GLOB.reta_log, "[server_timestamp()] RETA: [text]") log_game("RETA: [text]") /proc/initialize_reta_system() diff --git a/code/modules/wiremod/components/utility/timepiece.dm b/code/modules/wiremod/components/utility/timepiece.dm index fa675bfa1b9..e40e4d1f09c 100644 --- a/code/modules/wiremod/components/utility/timepiece.dm +++ b/code/modules/wiremod/components/utility/timepiece.dm @@ -46,19 +46,19 @@ switch(format.value) if(COMP_TIMEPIECE_TWENTYFOUR_HOUR) - time = station_time_timestamp() + time = round_timestamp() if(COMP_TIMEPIECE_TWELVE_HOUR) - time = time_to_twelve_hour(station_time()) + time = time_to_twelve_hour() text_output.set_output(time) switch(time_unit.value) if(COMP_TIMEPIECE_HOURS) - time = round(station_time() / (1 HOURS)) + time = round_timestamp(format = "hh") if(COMP_TIMEPIECE_MINUTES) - time = round(station_time() / (1 MINUTES)) + time = round_timestamp(format = "mm") if(COMP_TIMEPIECE_SECONDS) - time = round(station_time() / (1 SECONDS)) + time = round_timestamp(format = "ss") num_output.set_output(time) diff --git a/config/game_options.txt b/config/game_options.txt index 3a8319cca9a..5588c20557c 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -493,15 +493,6 @@ ROUNDSTART_TRAITS ## Enable night shifts #ENABLE_NIGHT_SHIFTS -## The shift start hour in 24-hour (0-23) notation -SHIFT_TIME_START_HOUR 7 - -## Sets shift time to server time at roundstart. Overrides SHIFT_TIME_START_HOUR -#SHIFT_TIME_REALTIME - -## Enable randomized shift start times. Overrides SHIFT_TIME_REALTIME and SHIFT_TIME_START_HOUR -#RANDOMIZE_SHIFT_TIME - ## A cap on how many monkeys may be created via monkey cubes MONKEYCAP 64 diff --git a/tgstation.dme b/tgstation.dme index df33513e07e..7b10ea3d1e3 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -731,7 +731,6 @@ #include "code\controllers\subsystem\mobs.dm" #include "code\controllers\subsystem\moods.dm" #include "code\controllers\subsystem\mouse_entered.dm" -#include "code\controllers\subsystem\nightshift.dm" #include "code\controllers\subsystem\npcpool.dm" #include "code\controllers\subsystem\ore_generation.dm" #include "code\controllers\subsystem\overlays.dm" @@ -4122,6 +4121,7 @@ #include "code\modules\client\preferences\statpanel.dm" #include "code\modules\client\preferences\status_bar.dm" #include "code\modules\client\preferences\tgui.dm" +#include "code\modules\client\preferences\time.dm" #include "code\modules\client\preferences\tooltips.dm" #include "code\modules\client\preferences\trans_prosthetic.dm" #include "code\modules\client\preferences\ui_style.dm" @@ -4384,6 +4384,7 @@ #include "code\modules\events\market_crash.dm" #include "code\modules\events\mass_hallucination.dm" #include "code\modules\events\mice_migration.dm" +#include "code\modules\events\nightshift.dm" #include "code\modules\events\portal_storm.dm" #include "code\modules\events\processor_overload.dm" #include "code\modules\events\radiation_leak.dm" diff --git a/tgui/packages/tgui/interfaces/AccountingConsole/AuditScreen.tsx b/tgui/packages/tgui/interfaces/AccountingConsole/AuditScreen.tsx index 98a19e308b1..2885340059f 100644 --- a/tgui/packages/tgui/interfaces/AccountingConsole/AuditScreen.tsx +++ b/tgui/packages/tgui/interfaces/AccountingConsole/AuditScreen.tsx @@ -41,7 +41,7 @@ export const AuditScreen = () => { {purchase.vendor} - {purchase.stationtime || '00:00'} ST + {purchase.stationtime || '00:00'} PT ))} diff --git a/tgui/packages/tgui/interfaces/AccountingConsole/index.tsx b/tgui/packages/tgui/interfaces/AccountingConsole/index.tsx index 3e45671520f..622abff07aa 100644 --- a/tgui/packages/tgui/interfaces/AccountingConsole/index.tsx +++ b/tgui/packages/tgui/interfaces/AccountingConsole/index.tsx @@ -150,7 +150,7 @@ export const AccountingConsole = () => { diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/accessibility.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/accessibility.tsx index 1beda34b292..1e943cf1b01 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/accessibility.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/accessibility.tsx @@ -48,3 +48,13 @@ export const stair_indicator: FeatureToggle = { `, component: CheckboxInput, }; + +export const twelve_hour: FeatureToggle = { + name: 'Twelve-Hour Clock', + category: 'ACCESSIBILITY', + description: ` + When toggled, will replace many instances of real-world time with AM/PM instead. + `, + component: CheckboxInput, +}; + diff --git a/tgui/packages/tgui/interfaces/Secrets.jsx b/tgui/packages/tgui/interfaces/Secrets.jsx index fc65fd05990..37033185738 100644 --- a/tgui/packages/tgui/interfaces/Secrets.jsx +++ b/tgui/packages/tgui/interfaces/Secrets.jsx @@ -231,13 +231,13 @@ const HelpfulTab = (props) => { /> -