mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-05 22:43:46 +00:00
[MIRROR] Fix runtime with ntos apps and improves code involved in the runtime (#854)
* Fix runtime with NTOS apps and improve code involved (#53779) There exists a specific state where ui.open() can be called yet the result would be a null window and such behaviour would be intentional. The following CRASH in ui.send_asset() would thus be misleading, because send_asset() was called after open(). This PR adds more information to the CRASH about when the failure state can occur, makes open() return a value based on whether it actually opened a new pooled window or not, and makes sure modular computer apps don't send_assets unless a new pooled window was created. * Fix runtime with ntos apps and improves code involved in the runtime Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
@@ -37,8 +37,8 @@
|
||||
if (!ui)
|
||||
ui = new(user, src, "NtosMain")
|
||||
ui.set_autoupdate(TRUE)
|
||||
ui.open()
|
||||
ui.send_asset(get_asset_datum(/datum/asset/simple/headers))
|
||||
if(ui.open())
|
||||
ui.send_asset(get_asset_datum(/datum/asset/simple/headers))
|
||||
|
||||
|
||||
/obj/item/modular_computer/ui_data(mob/user)
|
||||
|
||||
@@ -179,8 +179,8 @@
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui && tgui_id)
|
||||
ui = new(user, src, tgui_id, filedesc)
|
||||
ui.open()
|
||||
ui.send_asset(get_asset_datum(/datum/asset/simple/headers))
|
||||
if(ui.open())
|
||||
ui.send_asset(get_asset_datum(/datum/asset/simple/headers))
|
||||
|
||||
// CONVENTIONS, READ THIS WHEN CREATING NEW PROGRAM AND OVERRIDING THIS PROC:
|
||||
// Topic calls are automagically forwarded from NanoModule this program contains.
|
||||
|
||||
Reference in New Issue
Block a user