[MIRROR] Refactored fundamental circuit components that have varying inputs. Improvements to the integrated circuit UI. Improves and rebalances the drone shell [MDB IGNORE] (#15264)

* Refactored fundamental circuit components that have varying inputs. Improvements to the integrated circuit UI. Improves and rebalances the drone shell (#68586)

* Refactored fundamental circuit components that have varying inputs. Made the integrated circuit UI slightly better.

* Fixes with UI

* Removes logger

* Ran prettier

* Fixed documentation

* Rebalances drone circuit

* Drones can now charge in chargers

Co-authored-by: Watermelon914 <hidden@ hidden.com>

* Refactored fundamental circuit components that have varying inputs. Improvements to the integrated circuit UI. Improves and rebalances the drone shell

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <hidden@ hidden.com>
This commit is contained in:
SkyratBot
2022-07-30 17:22:46 +02:00
committed by GitHub
parent e2c4318f29
commit 856ea9c79a
25 changed files with 533 additions and 336 deletions
@@ -8,21 +8,28 @@
desc = "A component that combines strings."
category = "String"
/// The amount of input ports to have
var/input_port_amount = 4
var/list/datum/port/input/concat_ports = list()
/// The result from the output
var/datum/port/output/output
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
/obj/item/circuit_component/concat/populate_ports()
for(var/port_id in 1 to input_port_amount)
var/letter = ascii2text(text2ascii("A") + (port_id-1))
concat_ports += add_input_port(letter, PORT_TYPE_STRING)
ui_buttons = list(
"plus" = "add",
"minus" = "remove"
)
output = add_output_port("Output", PORT_TYPE_STRING)
/obj/item/circuit_component/concat/populate_ports()
AddComponent(/datum/component/circuit_component_add_port, \
port_list = concat_ports, \
add_action = "add", \
remove_action = "remove", \
port_type = PORT_TYPE_STRING, \
prefix = "Port", \
minimum_amount = 2 \
)
output = add_output_port("Output", PORT_TYPE_STRING, order = 1.1)
/obj/item/circuit_component/concat/input_received(datum/port/input/port)
@@ -8,8 +8,6 @@
desc = "Checks if a string contains a word/letter"
category = "String"
input_port_amount = 0
var/datum/port/input/needle
var/datum/port/input/haystack
@@ -22,11 +20,7 @@
haystack = null
return ..()
/obj/item/circuit_component/compare/contains/do_comparisons(list/ports)
if(length(ports) < input_port_amount)
return
/obj/item/circuit_component/compare/contains/do_comparisons()
var/to_find = needle.value
var/to_search = haystack.value