TGUI Fix verb, TGUI AI state fix, TGUI focus fix

This commit is contained in:
ShadowLarkens
2020-09-16 19:54:54 -07:00
parent 44f65e2602
commit ef846b5807
4 changed files with 75 additions and 17 deletions
+23 -2
View File
@@ -12,9 +12,10 @@
*
* required user mob The mob who opened/is using the UI.
* optional ui datum/tgui The UI to be updated, if it exists.
* optional parent_ui datum/tgui A parent UI that, when closed, closes this UI as well.
*/
/datum/proc/tgui_interact(mob/user, datum/tgui/ui = null)
/datum/proc/tgui_interact(mob/user, datum/tgui/ui = null, datum/tgui/parent_ui = null)
return FALSE // Not implemented.
/**
@@ -27,7 +28,7 @@
*
* return list Data to be sent to the UI.
*/
/datum/proc/tgui_data(mob/user)
/datum/proc/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
return list() // Not implemented.
/**
@@ -140,6 +141,26 @@
*/
/datum/proc/tgui_close(mob/user)
/**
* verb
*
* Used by a client to fix broken TGUI windows caused by opening a UI window before assets load.
* Probably not very performant and forcibly destroys a bunch of windows, so it has some warnings attached.
* Conveniently, also allows devs to force a dev server reattach without relogging, since it yeets windows.
*/
/client/verb/tgui_fix_white()
set desc = "Only use this if you have a broken TGUI window occupying your screen!"
set name = "Fix TGUI"
set category = "OOC"
if(alert(src, "Only use this verb if you have a white TGUI window stuck on your screen.", "Fix TGUI", "Continue", "Nevermind") != "Continue")
return
SStgui.close_user_uis(mob)
if(alert(src, "Did that fix the problem?", "Fix TGUI", "Yes", "No") == "No")
SStgui.force_close_all_windows(mob)
alert(src, "UIs should be fixed now. If not, please cry to your nearest coder.", "Fix TGUI")
/**
* verb
*