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.
This commit is contained in:
Timberpoes
2020-09-18 01:46:33 +01:00
committed by GitHub
parent 8f17ee3ae4
commit 29e8852428
3 changed files with 13 additions and 9 deletions

View File

@@ -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)