Lobby info is now part of the hud instead of stat panel (#90572)

## About The Pull Request

Removes ``/mob/dead/get_status_tab_items()``, replaces it with a lobby
hud icon showing the same information

TV sprite made by Kryson, scanline and static taken from ``effects.dmi``
which I then blew up to fit the size.


https://github.com/user-attachments/assets/99733ae6-c596-42b1-bcae-d1a8d8f094c3

## Why It's Good For The Game

I want to try to remove as much reliance from the stat panel as possible
so we can hopefully remove it, as it takes up 1/3 of the screen for
nothing.

## Changelog

🆑 Kryson, JohnFulpWillard
qol: Lobby info is now on the title screen rather than being hidden in
the stat panel.
/🆑
This commit is contained in:
John Willard
2025-04-13 14:18:37 -06:00
committed by GitHub
parent c9b66f2fcb
commit 6ff440bbc2
6 changed files with 127 additions and 17 deletions
+121
View File
@@ -637,6 +637,127 @@
if(SSticker.current_state == GAME_STATE_STARTUP)
to_chat(usr, span_admin("The server is still setting up, but the round will be started as soon as possible."))
#define OVERLAY_X_DIFF 12
#define OVERLAY_Y_DIFF 5
///Lobby screen that appears before the game has started showing how many players there are and who is ready.
/atom/movable/screen/lobby/new_player_info
name = "New Player Info"
screen_loc = "TOP:-20,CENTER:192"
icon = 'icons/hud/lobby/newplayer.dmi'
icon_state = null //we only show up when we get update appearance called, cause we need our overlay to not look bad.
base_icon_state = "newplayer"
maptext_height = 70
maptext_width = 80
maptext_x = OVERLAY_X_DIFF
maptext_y = OVERLAY_Y_DIFF
var/show_static = TRUE
/atom/movable/screen/lobby/new_player_info/Initialize(mapload, datum/hud/hud_owner)
. = ..()
switch(SSticker.current_state)
if(GAME_STATE_PREGAME, GAME_STATE_STARTUP)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, PROC_REF(hide_info))
if(GAME_STATE_SETTING_UP)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, PROC_REF(show_info))
START_PROCESSING(SSnewplayer_info, src)
update_text()
update_appearance(UPDATE_ICON)
/atom/movable/screen/lobby/new_player_info/Destroy()
STOP_PROCESSING(SSnewplayer_info, src)
return ..()
/atom/movable/screen/lobby/new_player_info/update_overlays()
. = ..()
if(!always_available)
return .
. += mutable_appearance(icon, "[base_icon_state]_overlay", layer = src.layer+0.03)
if(show_static)
. += mutable_appearance(icon, "static_base", alpha = 20, layer = src.layer+0.01)
//we have this in a separate file because `generate_icon_alpha_mask` puts lighting even on non-existent pixels,
//giving the icon a weird background color.
var/mutable_appearance/scanline = mutable_appearance(generate_icon_alpha_mask('icons/hud/lobby/newplayer_scanline.dmi', "scanline"), alpha = 20, layer = src.layer+0.02)
scanline.pixel_y = OVERLAY_X_DIFF
scanline.pixel_x = OVERLAY_Y_DIFF
. += scanline
/atom/movable/screen/lobby/new_player_info/update_icon_state()
. = ..()
if(!always_available)
icon_state = "[base_icon_state]_disabled"
else
icon_state = base_icon_state
/atom/movable/screen/lobby/new_player_info/process(seconds_per_tick)
update_text()
/atom/movable/screen/lobby/new_player_info/collapse_button()
show_static = FALSE
update_text()
//to be in sync with parent, we'll turn the TV off in this time instead.
animate(src, appearance = update_appearance(UPDATE_ICON), time = SHUTTER_MOVEMENT_DURATION + SHUTTER_WAIT_DURATION)
//we go to the right, not up
animate(transform = transform.Translate(x = 146, y = 0), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_IN)
/atom/movable/screen/lobby/new_player_info/expand_button()
. = ..()
show_static = TRUE
update_appearance(UPDATE_ICON)
update_text()
/atom/movable/screen/lobby/new_player_info/proc/hide_info()
SIGNAL_HANDLER
STOP_PROCESSING(SSnewplayer_info, src)
UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP)
RegisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP, PROC_REF(show_info))
always_available = FALSE
update_appearance(UPDATE_ICON)
update_text()
/atom/movable/screen/lobby/new_player_info/proc/show_info()
SIGNAL_HANDLER
always_available = TRUE
update_appearance(UPDATE_ICON)
update_text()
START_PROCESSING(SSnewplayer_info, src)
UnregisterSignal(SSticker, COMSIG_TICKER_ERROR_SETTING_UP)
RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, PROC_REF(hide_info))
/atom/movable/screen/lobby/new_player_info/proc/update_text()
if(!always_available || !hud || !show_static)
maptext = null
return
var/new_maptext
if(!MC_RUNNING())
new_maptext = "<span style='text-align: center; vertical-align: middle'>Loading...</span>"
else
var/time_remaining = SSticker.GetTimeLeft()
if(time_remaining > 0)
time_remaining = "[round(time_remaining/10)]s"
else if(time_remaining == -10)
time_remaining = "DELAYED"
else
time_remaining = "SOON"
if(hud.mymob.client.holder)
new_maptext = "<span style='text-align: center; vertical-align: middle'>Starting in [time_remaining]<br /> \
[LAZYLEN(GLOB.clients)] player\s<br /> \
[SSticker.totalPlayersReady] players ready<br /> \
[SSticker.total_admins_ready] / [length(GLOB.admins)] admins ready</span>"
else
new_maptext = "<span style='text-align: center; vertical-align: middle; font-size: 18px'>[time_remaining]</span><br /> \
<span style='text-align: center; vertical-align: middle'>[LAZYLEN(GLOB.clients)] player\s</span>"
maptext = MAPTEXT(new_maptext)
#undef OVERLAY_X_DIFF
#undef OVERLAY_Y_DIFF
#undef SHUTTER_MOVEMENT_DURATION
#undef SHUTTER_WAIT_DURATION
#undef MAX_STATION_TRAIT_BUTTONS_VERTICAL
@@ -0,0 +1,5 @@
PROCESSING_SUBSYSTEM_DEF(newplayer_info)
name = "New Player Info"
flags = SS_NO_INIT | SS_BACKGROUND
wait = 1 SECONDS
runlevels = RUNLEVEL_LOBBY|RUNLEVEL_SETUP
-17
View File
@@ -29,23 +29,6 @@ INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead/canUseStorage()
return FALSE
/mob/dead/get_status_tab_items()
. = ..()
if(SSticker.HasRoundStarted())
return
var/time_remaining = SSticker.GetTimeLeft()
if(time_remaining > 0)
. += "Time To Start: [round(time_remaining/10)]s"
else if(time_remaining == -10)
. += "Time To Start: DELAYED"
else
. += "Time To Start: SOON"
. += "Players: [LAZYLEN(GLOB.clients)]"
if(client.holder)
. += "Players Ready: [SSticker.totalPlayersReady]"
. += "Admins Ready: [SSticker.total_admins_ready] / [length(GLOB.admins)]"
#define SERVER_HOPPER_TRAIT "server_hopper"
/mob/dead/proc/server_hop()
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

+1
View File
@@ -788,6 +788,7 @@
#include "code\controllers\subsystem\processing\greyscale.dm"
#include "code\controllers\subsystem\processing\instruments.dm"
#include "code\controllers\subsystem\processing\manufacturing.dm"
#include "code\controllers\subsystem\processing\newplayer.dm"
#include "code\controllers\subsystem\processing\obj.dm"
#include "code\controllers\subsystem\processing\plumbing.dm"
#include "code\controllers\subsystem\processing\priority_effects.dm"