From 3954fd1a94a20c437643fe98e684326eafaf6972 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 26 Jan 2023 20:29:38 +0100 Subject: [PATCH] [MIRROR] Adds the 2 new components to the techweb [MDB IGNORE] (#18953) Adds the 2 new components to the techweb (#72910) ## About The Pull Request Adds the 2 new components I made in my prior PR to the basic circuit research also fix an issue with associative pick list ## Why It's Good For The Game Being able to print them would be usefull Reason I didn't notice was properly since I ran on debug station and it never crossed my mind that they where research thingy ## Changelog :cl: fix: You can print the new list pick and associative list pick components fix: Associative list pick works as intended now /:cl: Co-authored-by: Autisem <36102060+Autisem@users.noreply.github.com> --- code/modules/research/designs/wiremod_designs.dm | 10 ++++++++++ code/modules/research/techweb/all_nodes.dm | 4 +++- .../modules/wiremod/components/list/assoc_list_pick.dm | 8 +++++++- code/modules/wiremod/components/list/list_pick.dm | 7 +++++-- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/code/modules/research/designs/wiremod_designs.dm b/code/modules/research/designs/wiremod_designs.dm index 1873fa8162a..eeb739f2b3a 100644 --- a/code/modules/research/designs/wiremod_designs.dm +++ b/code/modules/research/designs/wiremod_designs.dm @@ -436,6 +436,16 @@ id = "comp_access_checker" build_path = /obj/item/circuit_component/compare/access +/datum/design/component/list_pick + name = "List Pick Component" + id = "comp_list_pick" + build_path = /obj/item/circuit_component/list_pick + +/datum/design/component/list_pick_assoc + name = "Associative List Pick Component" + id = "comp_assoc_list_pick" + build_path = /obj/item/circuit_component/list_pick/assoc + /datum/design/compact_remote_shell name = "Compact Remote Shell" desc = "A handheld shell with one big button." diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index fd57c5403df..9492ef096de 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -315,6 +315,7 @@ "circuit_multitool", "comp_access_checker", "comp_arithmetic", + "comp_assoc_list_pick", "comp_binary_convert", "comp_clock", "comp_comparison", @@ -345,6 +346,7 @@ "comp_list_assoc_literal", "comp_list_clear", "comp_list_literal", + "comp_list_pick", "comp_list_remove", "comp_logic", "comp_matscanner", @@ -382,7 +384,7 @@ "component_printer", "integrated_circuit", "module_duplicator", - "usb_cable", + "usb_cable" ) /////////////////////////Biotech///////////////////////// diff --git a/code/modules/wiremod/components/list/assoc_list_pick.dm b/code/modules/wiremod/components/list/assoc_list_pick.dm index bab10f9c6b0..9c8e94c074a 100644 --- a/code/modules/wiremod/components/list/assoc_list_pick.dm +++ b/code/modules/wiremod/components/list/assoc_list_pick.dm @@ -13,7 +13,7 @@ list_options = add_option_port("List Type", GLOB.wiremod_basic_types) /obj/item/circuit_component/list_pick/assoc/make_list_port() - input_list = add_input_port("List", PORT_TYPE_ASSOC_LIST(PORT_TYPE_STRING, PORT_TYPE_LIST(PORT_TYPE_ANY))) + input_list = add_input_port("List", PORT_TYPE_ASSOC_LIST(PORT_TYPE_STRING, PORT_TYPE_ANY)) /obj/item/circuit_component/list_pick/assoc/pre_input_received(datum/port/input/port) @@ -22,4 +22,10 @@ input_list.set_datatype(PORT_TYPE_ASSOC_LIST(PORT_TYPE_STRING, new_type)) output.set_datatype(new_type) +/obj/item/circuit_component/list_pick/assoc/choose_item(choice, list/choice_list) + if(choice_list[choice]) + output.set_output(choice_list[choice]) + success.set_output(COMPONENT_SIGNAL) + else + failure.set_output(COMPONENT_SIGNAL) diff --git a/code/modules/wiremod/components/list/list_pick.dm b/code/modules/wiremod/components/list/list_pick.dm index a73fa90ab30..422811ec423 100644 --- a/code/modules/wiremod/components/list/list_pick.dm +++ b/code/modules/wiremod/components/list/list_pick.dm @@ -73,8 +73,11 @@ var/picked = tgui_input_list(user, message = message, items = showed_list) if(!(user.canUseTopic(src, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE))) return - if(picked) - output.set_output(picked) + choose_item(picked, showed_list) + +/obj/item/circuit_component/list_pick/proc/choose_item(choice, list/choice_list) + if(choice) + output.set_output(choice) success.set_output(COMPONENT_SIGNAL) else failure.set_output(COMPONENT_SIGNAL)