From 627c8a1c831e9adc88afb896fa3f9903ee0ee324 Mon Sep 17 00:00:00 2001 From: ReturnToZender Date: Fri, 15 Dec 2023 22:41:19 -0600 Subject: [PATCH] Player counts and station time to statpanel (#827) ## About The Pull Request This makes the statpanel slightly more readable. The station time is converted to 12-hour time, and includes a date. Additionally, active and observing players are both listed in number. ![image](https://github.com/Bubberstation/Bubberstation/assets/110273561/8d4b8a35-7fc0-4552-a810-c5bbe6b247fe) ![image](https://github.com/Bubberstation/Bubberstation/assets/110273561/56b945ee-9576-4750-9c24-af09ff06f04b) ## Why It's Good For The Game This makes it so you can get an idea of the time in-game, and also so you can see how many players are active when you join. Note that both of the lists used here do not change when players die, meaning these cannot be used to metagame when someone is dead, or has died. ## Changelog :cl: ReturnToZender, Shadow_Quill add: Adjusted statpanel with game time, active and observing players /:cl: --- code/controllers/subsystem/statpanel.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/statpanel.dm b/code/controllers/subsystem/statpanel.dm index 3f155695257..8467af1586b 100644 --- a/code/controllers/subsystem/statpanel.dm +++ b/code/controllers/subsystem/statpanel.dm @@ -36,17 +36,22 @@ SUBSYSTEM_DEF(statpanels) */ var/round_time = world.time - SSticker.round_start_time var/real_round_time = world.timeofday - SSticker.real_round_start_time + //BUBBER EDIT ADDITION: ACTIVE AND OBSERVING PLAYERS + var/active_players = get_active_player_count(alive_check = FALSE, afk_check = TRUE, human_check = FALSE) //This is a list of all active players, including players who are dead + var/observing_players = length(GLOB.current_observers_list) //This is a list of all players that started as an observer-- dead and lobby players are not included. + //BUBBER EDIT ADDITION: Time in the world (as in, in-game date) + var/timeinworld = "[time2text(world.realtime, "DD of Month,")] [CURRENT_STATION_YEAR]" global_data = list( "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)]%)", "Map: [SSmapping.config?.map_name || "Loading..."]", cached ? "Next Map: [cached.map_name]" : null, "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]", - "Connected Players: [GLOB.clients.len]", + "Connected: [GLOB.clients.len] | Active: [active_players]/[CONFIG_GET(number/hard_popcap)] | Observing: [observing_players]", //BUBBER EDIT: ACTIVE AND OBSERVING PLAYERS " ", "OOC: [GLOB.ooc_allowed ? "Enabled" : "Disabled"]", " ", "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]", - "Station Time: [station_time_timestamp()]", + "Station Time: [time_to_twelve_hour(station_time(), format = "hh:mm")], [timeinworld]", //BUBBER EDIT: READABLE STATION TIME "Round Timer: [round_time > MIDNIGHT_ROLLOVER ? "[round(round_time/MIDNIGHT_ROLLOVER)]:[worldtime2text()]" : worldtime2text()]", "Actual Round Timer: [time2text(real_round_time, "hh:mm:ss", 0)]" )