Chemmaster and chemdispenser UI disables if the machine is not operable (#20101)

Chemmaster and chemdispenser UI disables if the machine is not operable.
Turned a comment into a DMDoc.

Fixes #19825
This commit is contained in:
Fluffy
2024-10-26 10:15:36 +00:00
committed by GitHub
parent d57baf5184
commit 3de4911dc8
4 changed files with 76 additions and 3 deletions
+6 -3
View File
@@ -28,10 +28,13 @@ This is /obj/machinery level code to properly manage power usage from the area.
chan = power_channel
return check_area.powered(chan) // return power status of the area
// called whenever the power settings of the containing area change
// by default, check equipment channel & set flag can override if needed
// This is NOT for when the machine's own status changes; update_use_power for that.
/// called whenever the power settings of the containing area change
/// by default, check equipment channel & set flag can override if needed
/// This is NOT for when the machine's own status changes; update_use_power for that.
/obj/machinery/proc/power_change()
SHOULD_NOT_SLEEP(TRUE)
SHOULD_CALL_PARENT(TRUE)
var/oldstat = stat
if(powered(power_channel))
@@ -299,6 +299,11 @@
return TRUE
return TRUE
/obj/machinery/chem_master/ui_status(mob/user, datum/ui_state/state)
if(!operable())
return UI_DISABLED
. = ..()
/obj/machinery/chem_master/Topic(href, href_list)
@@ -202,6 +202,12 @@
add_fingerprint(usr)
/obj/machinery/chemical_dispenser/ui_status(mob/user, datum/ui_state/state)
if(!operable())
return UI_DISABLED
. = ..()
/obj/machinery/chemical_dispenser/attack_ai(mob/user as mob)
if(!ai_can_interact(user))
return