[MIRROR] lobby screen subsystem (#10859)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-05-11 04:32:23 -07:00
committed by GitHub
parent 15490e9903
commit 56a4a1a592
19 changed files with 80 additions and 19 deletions

View File

@@ -3,7 +3,7 @@
version: 1
# The BYOND version to use (kept in sync with dependencies.sh by the "TGS Test Suite" CI job)
# Must be interpreted as a string, keep quoted
byond: "516.1657"
byond: "516.1662"
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
static_files:
# Config directory should be static

View File

@@ -121,6 +121,7 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
// The numbers just define the ordering, they are meaningless otherwise.
#define INIT_ORDER_SERVER_MAINT 93
#define INIT_ORDER_ADMIN_VERBS 84 // needs to be pretty high, admins can't do much without it
#define INIT_ORDER_LOBBY 82
#define INIT_ORDER_WEBHOOKS 50
#define INIT_ORDER_SQLITE 41
#define INIT_ORDER_GARBAGE 40

View File

@@ -0,0 +1 @@
GLOBAL_LIST_EMPTY(new_player_list) //all /mob/new_player, in theory all should have clients and those that don't are in the process of spawning and get deleted when done.

View File

@@ -0,0 +1,49 @@
SUBSYSTEM_DEF(lobby_monitor)
name = "Lobby Art"
init_order = INIT_ORDER_LOBBY
// init_stage = INITSTAGE_EARLY
flags = SS_NO_INIT
wait = 1 SECOND
runlevels = ALL
/// The clients who we've waited a [wait] duration to start working. If they haven't, we reboot them
var/to_reinitialize = list()
/datum/controller/subsystem/lobby_monitor/fire(resumed)
var/list/new_players = GLOB.new_player_list
for(var/mob/new_player/player as anything in to_reinitialize)
if(!player.client)
continue
var/datum/tgui/ui = SStgui.get_open_ui(player, player)
if(ui && player.lobby_window && player.lobby_window.status > TGUI_WINDOW_CLOSED)
continue
log_tgui(player, "Reinitialized [player.client.ckey]'s lobby window: [ui ? "ui" : "no ui"], status: [player.lobby_window?.status].", "lobby_monitor/Fire")
INVOKE_ASYNC(player, TYPE_PROC_REF(/mob/new_player, initialize_lobby_screen))
var/initialize_queue = list()
for(var/mob/new_player/player as anything in new_players)
if(!player.client)
continue
if(player in to_reinitialize)
continue
var/datum/tgui/ui = SStgui.get_open_ui(player, player)
if(ui && player.lobby_window && player.lobby_window.status > TGUI_WINDOW_CLOSED)
continue
initialize_queue += player
to_reinitialize = initialize_queue
/datum/controller/subsystem/lobby_monitor/Shutdown()
var/datum/asset/our_asset = get_asset_datum(/datum/asset/simple/restart_animation)
var/to_send = "<!DOCTYPE html><html lang='en'><head><meta http-equiv='X-UA-Compatible' content='IE=edge' /></head><body style='overflow: hidden;padding: 0 !important;margin: 0 !important'><div style='background-image: url([our_asset.get_url_mappings()["loading"]]);background-position:center;background-size:cover;position:absolute;width:100%;height:100%'></body></html>"
for(var/client/client as anything in GLOB.clients)
winset(client, "lobby_browser", "is-disabled=false;is-visible=true")
client << browse(to_send, "window=lobby_browser")

View File

@@ -9,3 +9,8 @@
// not actually a gif
assets["lobby_bg.gif"] = pick(using_map.lobby_screens)
. = ..()
/datum/asset/simple/restart_animation
assets = list(
"loading" = 'html/lobby/loading.gif'
)

View File

@@ -1,6 +1,6 @@
/mob/Logout()
SStgui.on_logout(src) // Cleanup any TGUIs the user has open
SEND_SIGNAL(src, COMSIG_MOB_LOGOUT)
SStgui.on_logout(src) // Cleanup any TGUIs the user has open
player_list -= src
disconnect_time = world.realtime //VOREStation Addition: logging when we disappear.
update_client_z(null)

View File

@@ -22,6 +22,7 @@
initialize_lobby_screen()
player_list |= src
GLOB.new_player_list += src
created_for = ckey

View File

@@ -1,6 +1,7 @@
/mob/new_player/Logout()
ready = 0
GLOB.new_player_list -= src
QDEL_NULL(lobby_window)
disable_lobby_browser()

View File

@@ -26,6 +26,7 @@
add_verb(src, /mob/proc/insidePanel)
/mob/new_player/Destroy()
GLOB.new_player_list -= src
if(manifest_dialog)
QDEL_NULL(manifest_dialog)
if(late_choices_dialog)

View File

@@ -5,7 +5,7 @@
# byond version
export BYOND_MAJOR=516
export BYOND_MINOR=1657
export BYOND_MINOR=1662
# Macro Count
export MACRO_COUNT=8

View File

@@ -11,7 +11,7 @@
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tgui": "workspace:*",
"tgui-core": "^3.1.4"
"tgui-core": "^3.1.5"
},
"devDependencies": {
"@types/react": "^19.1.0",

View File

@@ -8,7 +8,7 @@
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tgui": "workspace:*",
"tgui-core": "^3.1.4",
"tgui-core": "^3.1.5",
"tgui-dev-server": "workspace:*"
},
"devDependencies": {

View File

@@ -7,7 +7,7 @@
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tgui": "workspace:*",
"tgui-core": "^3.1.4"
"tgui-core": "^3.1.5"
},
"devDependencies": {
"@types/react": "^19.1.0",

View File

@@ -152,7 +152,7 @@ export class CircuitComponent extends Component<CircuitProps, CircuitState> {
}
return (
<Box
<Box<HTMLDivElement>
className="ObjectComponent"
position="absolute"
left={x_pos + 'px'}

View File

@@ -102,7 +102,7 @@ export const ListInputModal = (props) => {
setTimeout(() => document!.getElementById(selected.toString())?.focus(), 1);
}
function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
function handleKeyDown<T>(event: React.KeyboardEvent<T>) {
const key = event.key;
if (key === KEY.Down || key === KEY.Up) {
event.preventDefault();

View File

@@ -38,12 +38,12 @@ export const Wires = (props) => {
);
};
export const standardizeColor = (color: any): string => {
export const standardizeColor = (color: string): string => {
const canvas = new OffscreenCanvas(1, 1);
const ctx = canvas.getContext('2d');
if (ctx) {
ctx.fillStyle = color;
return ctx.fillStyle as string;
return ctx.fillStyle;
} else {
return '#000000';
}

View File

@@ -14,7 +14,7 @@
"marked": "^4.3.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tgui-core": "^3.1.4",
"tgui-core": "^3.1.5",
"tgui-dev-server": "workspace:*"
},
"devDependencies": {

View File

@@ -19904,19 +19904,19 @@ __metadata:
react: "npm:^19.1.0"
react-dom: "npm:^19.1.0"
tgui: "workspace:*"
tgui-core: "npm:^3.1.4"
tgui-core: "npm:^3.1.5"
languageName: unknown
linkType: soft
"tgui-core@npm:^3.1.4":
version: 3.1.4
resolution: "tgui-core@npm:3.1.4"
"tgui-core@npm:^3.1.5":
version: 3.1.5
resolution: "tgui-core@npm:3.1.5"
dependencies:
"@floating-ui/react": "npm:^0.27.6"
peerDependencies:
react: ^19.1.0
react-dom: ^19.1.0
checksum: 10c0/1f0caef121de74275c08dceef926d4d1e6260eaee32cbe1ee5614456d339de4c887ce13b7b2774674feba37b56bd99204519d3eadcc57b0df3f172aa37644704
checksum: 10c0/fdaa2c55b323f51609e8207e0d58859ff757de9b98464d44f67fbc5237f94e8eb03c9995933a92cb33a02c109c53d4937088a77b8da0395376b8a911eac9d6e8
languageName: node
linkType: hard
@@ -19944,7 +19944,7 @@ __metadata:
react: "npm:^19.1.0"
react-dom: "npm:^19.1.0"
tgui: "workspace:*"
tgui-core: "npm:^3.1.4"
tgui-core: "npm:^3.1.5"
tgui-dev-server: "workspace:*"
languageName: unknown
linkType: soft
@@ -19959,7 +19959,7 @@ __metadata:
react: "npm:^19.1.0"
react-dom: "npm:^19.1.0"
tgui: "workspace:*"
tgui-core: "npm:^3.1.4"
tgui-core: "npm:^3.1.5"
vitest: "npm:^3.1.1"
languageName: unknown
linkType: soft
@@ -20021,7 +20021,7 @@ __metadata:
marked: "npm:^4.3.0"
react: "npm:^19.1.0"
react-dom: "npm:^19.1.0"
tgui-core: "npm:^3.1.4"
tgui-core: "npm:^3.1.5"
tgui-dev-server: "workspace:*"
vitest: "npm:^3.1.1"
languageName: unknown

View File

@@ -216,6 +216,7 @@
#include "code\_global_vars\lists\logging.dm"
#include "code\_global_vars\lists\mapping.dm"
#include "code\_global_vars\lists\misc.dm"
#include "code\_global_vars\lists\mob.dm"
#include "code\_global_vars\lists\species.dm"
#include "code\_global_vars\traits\_traits.dm"
#include "code\_helpers\_global_objects.dm"
@@ -412,6 +413,7 @@
#include "code\controllers\subsystems\internal_wiki.dm"
#include "code\controllers\subsystems\job.dm"
#include "code\controllers\subsystems\lighting.dm"
#include "code\controllers\subsystems\lobby_monitor.dm"
#include "code\controllers\subsystems\machines.dm"
#include "code\controllers\subsystems\mail.dm"
#include "code\controllers\subsystems\mapping.dm"