Integrated circuit modules now can be linked to component printers (#85519)

## About The Pull Request
Title. They've been missing quick component addition functionality due
to an oversight and were rather annoying to use.

## Why It's Good For The Game

Simple QOL, you no longer need to add every piece manually and can
develop circuits as actually intended (fully from their UI, as you can
do with primary circuits themselves)

## Changelog
🆑
qol: Integrated circuit modules now can be linked to component printers
/🆑
This commit is contained in:
SmArtKar
2024-08-14 14:21:30 +03:00
committed by GitHub
parent 2257abd46e
commit d598d4ff3b
+16 -7
View File
@@ -192,13 +192,22 @@
return data
/obj/machinery/component_printer/attackby(obj/item/weapon, mob/living/user, params)
if(istype(weapon, /obj/item/integrated_circuit) && !user.combat_mode)
var/obj/item/integrated_circuit/circuit = weapon
circuit.linked_component_printer = WEAKREF(src)
circuit.update_static_data_for_all_viewers()
balloon_alert(user, "successfully linked to the integrated circuit")
return
return ..()
if (user.combat_mode)
return ..()
var/obj/item/integrated_circuit/circuit
if(istype(weapon, /obj/item/integrated_circuit))
circuit = weapon
else if (istype(weapon, /obj/item/circuit_component/module))
var/obj/item/circuit_component/module/module = weapon
circuit = module.internal_circuit
if (isnull(circuit))
return ..()
circuit.linked_component_printer = WEAKREF(src)
circuit.update_static_data_for_all_viewers()
balloon_alert(user, "successfully linked to the integrated circuit")
/obj/machinery/component_printer/crowbar_act(mob/living/user, obj/item/tool)
if(..())