mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
[MIRROR] Refactors port types completely and adds the option type. Refactors options to use this new type (#7386)
* Refactors port types completely and adds the option type. Refactors options to use this new type (#60571) Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> * Refactors port types completely and adds the option type. Refactors options to use this new type 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
742f11f0d8
commit
3ab1e7ebe2
@@ -8,6 +8,8 @@
|
||||
desc = "A component used with USB cables that can perform select queries on a list based on the column name selected. The values are then compared with the comparison input."
|
||||
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
|
||||
|
||||
var/datum/port/input/option/comparison_options
|
||||
|
||||
/// The list to perform the filter on
|
||||
var/datum/port/input/received_table
|
||||
|
||||
@@ -31,7 +33,7 @@
|
||||
COMP_COMPARISON_GREATER_THAN_OR_EQUAL,
|
||||
COMP_COMPARISON_LESS_THAN_OR_EQUAL,
|
||||
)
|
||||
options = component_options
|
||||
comparison_options = add_option_port("Comparison Options", component_options)
|
||||
|
||||
/obj/item/circuit_component/select/Initialize()
|
||||
. = ..()
|
||||
@@ -43,6 +45,8 @@
|
||||
|
||||
/obj/item/circuit_component/select/input_received(datum/port/input/port)
|
||||
. = ..()
|
||||
var/current_option = comparison_options.input_value
|
||||
|
||||
switch(current_option)
|
||||
if(COMP_COMPARISON_EQUAL, COMP_COMPARISON_NOT_EQUAL)
|
||||
if(current_type != PORT_TYPE_ANY)
|
||||
|
||||
Reference in New Issue
Block a user