Skip to content

Commit

Permalink
Fix time display (#1114)
Browse files Browse the repository at this point in the history
## Что этот PR делает

Round time и lobby time теперь показывают время правильно

## Тестирование

Запустил, проверил

## Changelog

:cl:
fix: Round time и lobby time теперь показывают время правильно
/:cl:

## Summary by Sourcery

Bug Fixes:
- Correctly display the round and lobby time in the stat panel and
escape menu.

---------

Co-authored-by: dj-34 <dj-34@bk.ru>
  • Loading branch information
Gaxeer and dj-34 authored Jan 31, 2025
1 parent 6a4e6f1 commit f1d71ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/__HELPERS/time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
var/time_string = time2text(world.timeofday, format)
return show_ds ? "[time_string]:[world.timeofday % 10]" : time_string

/proc/gameTimestamp(format = "hh:mm:ss", wtime=world.time)
return time2text(wtime, format)
/proc/gameTimestamp(format = "hh:mm:ss", wtime=world.time, timezone) // BANDASTATION ADDITION - timezone
return time2text(wtime, format, timezone) // BANDASTATION ADDITION - timezone

/proc/station_time(display_only = FALSE, wtime=world.time)
return ((((wtime - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % 864000) - (display_only? GLOB.timezoneOffset : 0)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/statpanel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SUBSYSTEM_DEF(statpanels)
"Players Connected: [LAZYLEN(GLOB.clients)]", // BANDASTATION ADD
"Players in Lobby: [LAZYLEN(GLOB.new_player_list)]", // BANDASTATION ADD
"Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]",
"[SSticker.round_start_time ? "Round Time" : "Lobby Time"]: [STATION_TIME_PASSED() > MIDNIGHT_ROLLOVER ? "[round(STATION_TIME_PASSED() / MIDNIGHT_ROLLOVER)]:[gameTimestamp(wtime = STATION_TIME_PASSED())]" : gameTimestamp(wtime = STATION_TIME_PASSED())]", // BANDASTATION EDIT - original: ROUND_TIME()
"[SSticker.round_start_time ? "Round Time" : "Lobby Time"]: [STATION_TIME_PASSED() > MIDNIGHT_ROLLOVER ? "[round(STATION_TIME_PASSED() / MIDNIGHT_ROLLOVER)]:[gameTimestamp(wtime = STATION_TIME_PASSED(), timezone = 0)]" : gameTimestamp(wtime = STATION_TIME_PASSED(), timezone = 0)]", // BANDASTATION ADDITION - timezone
"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)]%)"
)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/escape_menu/details.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ GLOBAL_DATUM(escape_menu_details, /atom/movable/screen/escape_menu/details)
var/new_maptext = {"
<span style='text-align: right; line-height: 0.7'>
Round ID: [GLOB.round_id || "Unset"]<br />
[SSticker.round_start_time ? "Round Time" : "Lobby Time"]: [STATION_TIME_PASSED() > MIDNIGHT_ROLLOVER ? "[round(STATION_TIME_PASSED() / MIDNIGHT_ROLLOVER)]:[gameTimestamp(wtime = STATION_TIME_PASSED())]" : gameTimestamp(wtime = STATION_TIME_PASSED())]<br />
[SSticker.round_start_time ? "Round Time" : "Lobby Time"]: [STATION_TIME_PASSED() > MIDNIGHT_ROLLOVER ? "[round(STATION_TIME_PASSED() / MIDNIGHT_ROLLOVER)]:[gameTimestamp(wtime = STATION_TIME_PASSED(), timezone = 0)]" : gameTimestamp(wtime = STATION_TIME_PASSED(), timezone = 0)]<br /> // BANDASTATION ADDITION - timezone
Map: [SSmapping.current_map.map_name || "Loading..."]<br />
Time Dilation: [round(SStime_track.time_dilation_current,1)]%<br />
</span>
Expand Down

0 comments on commit f1d71ee

Please sign in to comment.