mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[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:
committed by
GitHub
parent
15490e9903
commit
56a4a1a592
2
.tgs.yml
2
.tgs.yml
@@ -3,7 +3,7 @@
|
|||||||
version: 1
|
version: 1
|
||||||
# The BYOND version to use (kept in sync with dependencies.sh by the "TGS Test Suite" CI job)
|
# 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
|
# Must be interpreted as a string, keep quoted
|
||||||
byond: "516.1657"
|
byond: "516.1662"
|
||||||
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
|
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
|
||||||
static_files:
|
static_files:
|
||||||
# Config directory should be static
|
# Config directory should be static
|
||||||
|
|||||||
@@ -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.
|
// The numbers just define the ordering, they are meaningless otherwise.
|
||||||
#define INIT_ORDER_SERVER_MAINT 93
|
#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_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_WEBHOOKS 50
|
||||||
#define INIT_ORDER_SQLITE 41
|
#define INIT_ORDER_SQLITE 41
|
||||||
#define INIT_ORDER_GARBAGE 40
|
#define INIT_ORDER_GARBAGE 40
|
||||||
|
|||||||
1
code/_global_vars/lists/mob.dm
Normal file
1
code/_global_vars/lists/mob.dm
Normal 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.
|
||||||
49
code/controllers/subsystems/lobby_monitor.dm
Normal file
49
code/controllers/subsystems/lobby_monitor.dm
Normal 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")
|
||||||
@@ -9,3 +9,8 @@
|
|||||||
// not actually a gif
|
// not actually a gif
|
||||||
assets["lobby_bg.gif"] = pick(using_map.lobby_screens)
|
assets["lobby_bg.gif"] = pick(using_map.lobby_screens)
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|
||||||
|
/datum/asset/simple/restart_animation
|
||||||
|
assets = list(
|
||||||
|
"loading" = 'html/lobby/loading.gif'
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/mob/Logout()
|
/mob/Logout()
|
||||||
SStgui.on_logout(src) // Cleanup any TGUIs the user has open
|
|
||||||
SEND_SIGNAL(src, COMSIG_MOB_LOGOUT)
|
SEND_SIGNAL(src, COMSIG_MOB_LOGOUT)
|
||||||
|
SStgui.on_logout(src) // Cleanup any TGUIs the user has open
|
||||||
player_list -= src
|
player_list -= src
|
||||||
disconnect_time = world.realtime //VOREStation Addition: logging when we disappear.
|
disconnect_time = world.realtime //VOREStation Addition: logging when we disappear.
|
||||||
update_client_z(null)
|
update_client_z(null)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
initialize_lobby_screen()
|
initialize_lobby_screen()
|
||||||
|
|
||||||
player_list |= src
|
player_list |= src
|
||||||
|
GLOB.new_player_list += src
|
||||||
|
|
||||||
created_for = ckey
|
created_for = ckey
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/mob/new_player/Logout()
|
/mob/new_player/Logout()
|
||||||
ready = 0
|
ready = 0
|
||||||
|
|
||||||
|
GLOB.new_player_list -= src
|
||||||
QDEL_NULL(lobby_window)
|
QDEL_NULL(lobby_window)
|
||||||
disable_lobby_browser()
|
disable_lobby_browser()
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
add_verb(src, /mob/proc/insidePanel)
|
add_verb(src, /mob/proc/insidePanel)
|
||||||
|
|
||||||
/mob/new_player/Destroy()
|
/mob/new_player/Destroy()
|
||||||
|
GLOB.new_player_list -= src
|
||||||
if(manifest_dialog)
|
if(manifest_dialog)
|
||||||
QDEL_NULL(manifest_dialog)
|
QDEL_NULL(manifest_dialog)
|
||||||
if(late_choices_dialog)
|
if(late_choices_dialog)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
# byond version
|
# byond version
|
||||||
export BYOND_MAJOR=516
|
export BYOND_MAJOR=516
|
||||||
export BYOND_MINOR=1657
|
export BYOND_MINOR=1662
|
||||||
|
|
||||||
# Macro Count
|
# Macro Count
|
||||||
export MACRO_COUNT=8
|
export MACRO_COUNT=8
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.1.0",
|
||||||
"tgui": "workspace:*",
|
"tgui": "workspace:*",
|
||||||
"tgui-core": "^3.1.4"
|
"tgui-core": "^3.1.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^19.1.0",
|
"@types/react": "^19.1.0",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.1.0",
|
||||||
"tgui": "workspace:*",
|
"tgui": "workspace:*",
|
||||||
"tgui-core": "^3.1.4",
|
"tgui-core": "^3.1.5",
|
||||||
"tgui-dev-server": "workspace:*"
|
"tgui-dev-server": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.1.0",
|
||||||
"tgui": "workspace:*",
|
"tgui": "workspace:*",
|
||||||
"tgui-core": "^3.1.4"
|
"tgui-core": "^3.1.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^19.1.0",
|
"@types/react": "^19.1.0",
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export class CircuitComponent extends Component<CircuitProps, CircuitState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box<HTMLDivElement>
|
||||||
className="ObjectComponent"
|
className="ObjectComponent"
|
||||||
position="absolute"
|
position="absolute"
|
||||||
left={x_pos + 'px'}
|
left={x_pos + 'px'}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export const ListInputModal = (props) => {
|
|||||||
setTimeout(() => document!.getElementById(selected.toString())?.focus(), 1);
|
setTimeout(() => document!.getElementById(selected.toString())?.focus(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
|
function handleKeyDown<T>(event: React.KeyboardEvent<T>) {
|
||||||
const key = event.key;
|
const key = event.key;
|
||||||
if (key === KEY.Down || key === KEY.Up) {
|
if (key === KEY.Down || key === KEY.Up) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
@@ -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 canvas = new OffscreenCanvas(1, 1);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
ctx.fillStyle = color;
|
ctx.fillStyle = color;
|
||||||
return ctx.fillStyle as string;
|
return ctx.fillStyle;
|
||||||
} else {
|
} else {
|
||||||
return '#000000';
|
return '#000000';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"marked": "^4.3.0",
|
"marked": "^4.3.0",
|
||||||
"react": "^19.1.0",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.1.0",
|
||||||
"tgui-core": "^3.1.4",
|
"tgui-core": "^3.1.5",
|
||||||
"tgui-dev-server": "workspace:*"
|
"tgui-dev-server": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -19904,19 +19904,19 @@ __metadata:
|
|||||||
react: "npm:^19.1.0"
|
react: "npm:^19.1.0"
|
||||||
react-dom: "npm:^19.1.0"
|
react-dom: "npm:^19.1.0"
|
||||||
tgui: "workspace:*"
|
tgui: "workspace:*"
|
||||||
tgui-core: "npm:^3.1.4"
|
tgui-core: "npm:^3.1.5"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"tgui-core@npm:^3.1.4":
|
"tgui-core@npm:^3.1.5":
|
||||||
version: 3.1.4
|
version: 3.1.5
|
||||||
resolution: "tgui-core@npm:3.1.4"
|
resolution: "tgui-core@npm:3.1.5"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@floating-ui/react": "npm:^0.27.6"
|
"@floating-ui/react": "npm:^0.27.6"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^19.1.0
|
react: ^19.1.0
|
||||||
react-dom: ^19.1.0
|
react-dom: ^19.1.0
|
||||||
checksum: 10c0/1f0caef121de74275c08dceef926d4d1e6260eaee32cbe1ee5614456d339de4c887ce13b7b2774674feba37b56bd99204519d3eadcc57b0df3f172aa37644704
|
checksum: 10c0/fdaa2c55b323f51609e8207e0d58859ff757de9b98464d44f67fbc5237f94e8eb03c9995933a92cb33a02c109c53d4937088a77b8da0395376b8a911eac9d6e8
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -19944,7 +19944,7 @@ __metadata:
|
|||||||
react: "npm:^19.1.0"
|
react: "npm:^19.1.0"
|
||||||
react-dom: "npm:^19.1.0"
|
react-dom: "npm:^19.1.0"
|
||||||
tgui: "workspace:*"
|
tgui: "workspace:*"
|
||||||
tgui-core: "npm:^3.1.4"
|
tgui-core: "npm:^3.1.5"
|
||||||
tgui-dev-server: "workspace:*"
|
tgui-dev-server: "workspace:*"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
@@ -19959,7 +19959,7 @@ __metadata:
|
|||||||
react: "npm:^19.1.0"
|
react: "npm:^19.1.0"
|
||||||
react-dom: "npm:^19.1.0"
|
react-dom: "npm:^19.1.0"
|
||||||
tgui: "workspace:*"
|
tgui: "workspace:*"
|
||||||
tgui-core: "npm:^3.1.4"
|
tgui-core: "npm:^3.1.5"
|
||||||
vitest: "npm:^3.1.1"
|
vitest: "npm:^3.1.1"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
@@ -20021,7 +20021,7 @@ __metadata:
|
|||||||
marked: "npm:^4.3.0"
|
marked: "npm:^4.3.0"
|
||||||
react: "npm:^19.1.0"
|
react: "npm:^19.1.0"
|
||||||
react-dom: "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:*"
|
tgui-dev-server: "workspace:*"
|
||||||
vitest: "npm:^3.1.1"
|
vitest: "npm:^3.1.1"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
|
|||||||
@@ -216,6 +216,7 @@
|
|||||||
#include "code\_global_vars\lists\logging.dm"
|
#include "code\_global_vars\lists\logging.dm"
|
||||||
#include "code\_global_vars\lists\mapping.dm"
|
#include "code\_global_vars\lists\mapping.dm"
|
||||||
#include "code\_global_vars\lists\misc.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\lists\species.dm"
|
||||||
#include "code\_global_vars\traits\_traits.dm"
|
#include "code\_global_vars\traits\_traits.dm"
|
||||||
#include "code\_helpers\_global_objects.dm"
|
#include "code\_helpers\_global_objects.dm"
|
||||||
@@ -412,6 +413,7 @@
|
|||||||
#include "code\controllers\subsystems\internal_wiki.dm"
|
#include "code\controllers\subsystems\internal_wiki.dm"
|
||||||
#include "code\controllers\subsystems\job.dm"
|
#include "code\controllers\subsystems\job.dm"
|
||||||
#include "code\controllers\subsystems\lighting.dm"
|
#include "code\controllers\subsystems\lighting.dm"
|
||||||
|
#include "code\controllers\subsystems\lobby_monitor.dm"
|
||||||
#include "code\controllers\subsystems\machines.dm"
|
#include "code\controllers\subsystems\machines.dm"
|
||||||
#include "code\controllers\subsystems\mail.dm"
|
#include "code\controllers\subsystems\mail.dm"
|
||||||
#include "code\controllers\subsystems\mapping.dm"
|
#include "code\controllers\subsystems\mapping.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user