[MIRROR] Enforce preserving parent proc return values across ui_act call stacks (#999)

* Enforce preserving parent proc return values across ui_act call stacks (#53964)

All ui_act procs should call parent by default. All procs should preserve the value of the parent proc when it's TRUTHY and pass it down the call stack. No UI should be interactible when its flags or state indicate it should not be, except when explicity overriden by child procs intentionally disregarding parent return values to achieve a specific goal.

* Enforce preserving parent proc return values across ui_act call stacks

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
SkyratBot
2020-09-26 17:17:59 +02:00
committed by GitHub
parent 2158237170
commit 98568e191a
158 changed files with 386 additions and 180 deletions
@@ -188,18 +188,20 @@
// Calls beginning with "PC_" are reserved for computer handling (by whatever runs the program)
// ALWAYS INCLUDE PARENT CALL ..() OR DIE IN FIRE.
/datum/computer_file/program/ui_act(action,list/params,datum/tgui/ui)
if(..())
return 1
. = ..()
if(.)
return
if(computer)
switch(action)
if("PC_exit")
computer.kill_program()
ui.close()
return 1
return TRUE
if("PC_shutdown")
computer.shutdown_computer()
ui.close()
return 1
return TRUE
if("PC_minimize")
var/mob/user = usr
if(!computer.active_program || !computer.all_components[MC_CPU])