mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
[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>
This commit is contained in:
co-authored by
Watermelon914
Watermelon914
parent
bff3e1f65c
commit
7daee4669a
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user