From 7daee4669a8ec5c7b0481032c8d53967460f9fcb Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 3 Aug 2021 22:26:32 +0200 Subject: [PATCH] [MIRROR] Removes required_shells var on circuit components not allowing them to be placed in an integrated circuit. (#7364) * Removes required_shells var on circuit components not allowing them to be placed in an integrated circuit. (#60661) Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> * Removes required_shells var on circuit components not allowing them to be placed in an integrated circuit. Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> --- code/modules/wiremod/component.dm | 11 +++++------ .../modules/wiremod/components/hud/counter_overlay.dm | 5 +++-- code/modules/wiremod/components/hud/object_overlay.dm | 5 +++-- .../wiremod/components/hud/target_intercept.dm | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/code/modules/wiremod/component.dm b/code/modules/wiremod/component.dm index d4e310981e7..ffb5a897772 100644 --- a/code/modules/wiremod/component.dm +++ b/code/modules/wiremod/component.dm @@ -50,7 +50,7 @@ // Whether the component is removable or not. Only affects user UI var/removable = TRUE - // Defines which shells can accept this component. If set to null then all shells can use it. + // Defines which shells support this component. Only used as an informational guide, does not restrict placing these components in circuits. var/required_shells = null /obj/item/circuit_component/Initialize() @@ -211,11 +211,6 @@ /// Called when this component is about to be added to an integrated_circuit. /obj/item/circuit_component/proc/add_to(obj/item/integrated_circuit/added_to) - if(required_shells && LAZYLEN(required_shells)) - for(var/shell_type in required_shells) - if(istype(added_to, shell_type) || istype(added_to.loc, shell_type)) - return TRUE - return FALSE return TRUE /// Called when this component is removed from an integrated_circuit. @@ -238,6 +233,10 @@ if(!removable) . += create_ui_notice("Unremovable", "red", "lock") + if(length(required_shells)) + . += create_ui_notice("Supported Shells:", "green", "notes-medical") + for(var/atom/movable/shell as anything in required_shells) + . += create_ui_notice(initial(shell.name), "green", "plus-square") if(length(input_ports)) . += create_ui_notice("Power Usage Per Input: [power_usage_per_input]", "orange", "bolt") diff --git a/code/modules/wiremod/components/hud/counter_overlay.dm b/code/modules/wiremod/components/hud/counter_overlay.dm index c2158ec76a1..4852adb877e 100644 --- a/code/modules/wiremod/components/hud/counter_overlay.dm +++ b/code/modules/wiremod/components/hud/counter_overlay.dm @@ -32,8 +32,9 @@ image_pixel_y = add_input_port("Y-Axis Shift", PORT_TYPE_NUMBER) /obj/item/circuit_component/counter_overlay/register_shell(atom/movable/shell) - bci = shell - RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed) + if(istype(shell, /obj/item/organ/cyberimp/bci)) + bci = shell + RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed) /obj/item/circuit_component/counter_overlay/unregister_shell(atom/movable/shell) bci = null diff --git a/code/modules/wiremod/components/hud/object_overlay.dm b/code/modules/wiremod/components/hud/object_overlay.dm index dd502329f97..7b5c0477831 100644 --- a/code/modules/wiremod/components/hud/object_overlay.dm +++ b/code/modules/wiremod/components/hud/object_overlay.dm @@ -72,8 +72,9 @@ options_map = options_to_icons /obj/item/circuit_component/object_overlay/register_shell(atom/movable/shell) - bci = shell - RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed) + if(istype(shell, /obj/item/organ/cyberimp/bci)) + bci = shell + RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed) /obj/item/circuit_component/object_overlay/unregister_shell(atom/movable/shell) bci = null diff --git a/code/modules/wiremod/components/hud/target_intercept.dm b/code/modules/wiremod/components/hud/target_intercept.dm index 5de5695da33..2a19264b005 100644 --- a/code/modules/wiremod/components/hud/target_intercept.dm +++ b/code/modules/wiremod/components/hud/target_intercept.dm @@ -23,8 +23,9 @@ clicked_atom = add_output_port("Targeted Object", PORT_TYPE_ATOM) /obj/item/circuit_component/target_intercept/register_shell(atom/movable/shell) - bci = shell - RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed) + if(istype(shell, /obj/item/organ/cyberimp/bci)) + bci = shell + RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed) /obj/item/circuit_component/target_intercept/unregister_shell(atom/movable/shell) bci = null @@ -61,4 +62,3 @@ /obj/item/circuit_component/target_intercept/get_ui_notices() . = ..() . += create_ui_notice("Target Interception Cooldown: [DisplayTimeText(intercept_cooldown)]", "orange", "stopwatch") - . += create_ui_notice("Only usable in BCI circuits", "orange", "info")