[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
co-authored by Timberpoes
parent 2158237170
commit 98568e191a
158 changed files with 386 additions and 180 deletions
+3 -1
View File
@@ -286,8 +286,10 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
return data
/obj/item/pipe_dispenser/ui_act(action, params)
if(..())
. = ..()
if(.)
return
if(!usr.canUseTopic(src, BE_CLOSE))
return
var/playeffect = TRUE
+3 -1
View File
@@ -222,8 +222,10 @@
return data
/obj/item/airlock_painter/decal/ui_act(action,list/params)
if(..())
. = ..()
if(.)
return
switch(action)
//Lists of decals and designs
if("select decal")
+3 -1
View File
@@ -229,8 +229,10 @@
.["current_colour"] = paint_color
/obj/item/toy/crayon/ui_act(action, list/params)
if(..())
. = ..()
if(.)
return
switch(action)
if("toggle_cap")
if(has_cap)
+2 -1
View File
@@ -78,7 +78,8 @@
return data
/obj/item/aicard/ui_act(action,params)
if(..())
. = ..()
if(.)
return
switch(action)
if("wipe")
@@ -177,7 +177,8 @@
return data
/obj/item/storage/portable_chem_mixer/ui_act(action, params)
if(..())
. = ..()
if(.)
return
switch(action)
if("amount")
@@ -103,7 +103,8 @@
return data
/obj/item/electropack/ui_act(action, params)
if(..())
. = ..()
if(.)
return
switch(action)
@@ -142,7 +142,8 @@
return data
/obj/item/radio/ui_act(action, params, datum/tgui/ui)
if(..())
. = ..()
if(.)
return
switch(action)
if("frequency")
@@ -130,7 +130,8 @@ effective or pretty fucking useless.
return data
/obj/item/healthanalyzer/rad_laser/ui_act(action, params)
if(..())
. = ..()
if(.)
return
switch(action)
@@ -210,7 +210,8 @@
return data
/obj/item/transfer_valve/ui_act(action, params)
if(..())
. = ..()
if(.)
return
switch(action)
+3 -1
View File
@@ -217,8 +217,10 @@
return data
/obj/item/toy/eightball/haunted/ui_act(action, params)
if(..())
. = ..()
if(.)
return
var/mob/user = usr
switch(action)
@@ -54,7 +54,8 @@
return data
/obj/machinery/implantchair/ui_act(action, params)
if(..())
. = ..()
if(.)
return
switch(action)
if("door")
+2 -1
View File
@@ -172,7 +172,8 @@
return data
/obj/item/tank/ui_act(action, params)
if(..())
. = ..()
if(.)
return
switch(action)
if("pressure")
-3
View File
@@ -91,9 +91,6 @@
data["trackimplants"] = track_implants
return data
/obj/machinery/my_machine/ui_act(action, params)
if(..()) return
/*
* Hand-tele
*/
+1 -1
View File
@@ -41,8 +41,8 @@
structureclimber.visible_message("<span class='warning'>[structureclimber] is knocked off [src].</span>", "<span class='warning'>You're knocked off [src]!</span>", "<span class='warning'>You see [structureclimber] get knocked off [src].</span>")
/obj/structure/ui_act(action, params)
. = ..()
add_fingerprint(usr)
return ..()
/obj/structure/MouseDrop_T(atom/movable/O, mob/user)
. = ..()
+2 -1
View File
@@ -426,7 +426,8 @@
return data
/obj/structure/displaycase/forsale/ui_act(action, params)
if(..())
. = ..()
if(.)
return
var/obj/item/card/id/potential_acc = usr.get_idcard(hand_first = TRUE)
switch(action)
@@ -84,7 +84,8 @@
return data
/obj/structure/tank_dispenser/ui_act(action, params)
if(..())
. = ..()
if(.)
return
switch(action)
if("plasma")