mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
CMSS Lobby Screen (#17581)
* Establish base working new_player tgui * Tweak to fit virgo * . * fix that * split that * no as import * clean up old code * . * . --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -47,6 +47,8 @@
|
||||
var/list/children = list()
|
||||
/// Any partial packets that we have received from TGUI, waiting to be sent
|
||||
var/partial_packets
|
||||
/// If the window should be closed with other windows when requested
|
||||
var/closeable = TRUE
|
||||
|
||||
/**
|
||||
* public
|
||||
@@ -60,13 +62,13 @@
|
||||
* optional parent_ui datum/tgui The parent of this UI.
|
||||
* optional ui_x int Deprecated: Window width.
|
||||
* optional ui_y int Deprecated: Window height.
|
||||
* optional window datum/tgui_window: The window to display this TGUI within
|
||||
*
|
||||
* return datum/tgui The requested UI.
|
||||
*/
|
||||
/datum/tgui/New(mob/user, datum/src_object, interface, title, datum/tgui/parent_ui, ui_x, ui_y)
|
||||
/datum/tgui/New(mob/user, datum/src_object, interface, title, datum/tgui/parent_ui, ui_x, ui_y, datum/tgui_window/window)
|
||||
src.user = user
|
||||
src.src_object = src_object
|
||||
src.window_key = "[REF(src_object)]-main"
|
||||
src.interface = interface
|
||||
if(title)
|
||||
src.title = title
|
||||
@@ -78,6 +80,12 @@
|
||||
if(ui_x && ui_y)
|
||||
src.window_size = list(ui_x, ui_y)
|
||||
|
||||
if(window)
|
||||
src.window = window
|
||||
src.window_key = window.id
|
||||
else
|
||||
src.window_key = "[REF(src_object)]-main"
|
||||
|
||||
/datum/tgui/Destroy()
|
||||
user = null
|
||||
src_object = null
|
||||
@@ -88,22 +96,26 @@
|
||||
*
|
||||
* Open this UI (and initialize it with data).
|
||||
*
|
||||
* Args:
|
||||
* preinitialized: bool - if TRUE, we will not attempt to force strict mode on the tgui's window datum
|
||||
*
|
||||
* return bool - TRUE if a new pooled window is opened, FALSE in all other situations including if a new pooled window didn't open because one already exists.
|
||||
*/
|
||||
/datum/tgui/proc/open()
|
||||
/datum/tgui/proc/open(preinitialized = FALSE)
|
||||
if(!user?.client)
|
||||
return FALSE
|
||||
if(window)
|
||||
if(window && window.status > TGUI_WINDOW_LOADING)
|
||||
return FALSE
|
||||
process_status()
|
||||
if(status < STATUS_UPDATE)
|
||||
return FALSE
|
||||
window = SStgui.request_pooled_window(user)
|
||||
if(!window)
|
||||
window = SStgui.request_pooled_window(user)
|
||||
if(!window)
|
||||
return FALSE
|
||||
opened_at = world.time
|
||||
window.acquire_lock(src)
|
||||
if(!window.is_ready())
|
||||
if(!window.is_ready() && !preinitialized)
|
||||
window.initialize(
|
||||
strict_mode = TRUE,
|
||||
fancy = user.read_preference(/datum/preference/toggle/tgui_fancy),
|
||||
|
||||
Reference in New Issue
Block a user