mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
[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:
co-authored by
Watermelon914
Watermelon914
parent
e2c4318f29
commit
856ea9c79a
@@ -10,7 +10,11 @@
|
||||
|
||||
var/datum/port/input/option/comparison_option
|
||||
|
||||
input_port_amount = 2
|
||||
/// First value to compare with the second value
|
||||
var/datum/port/input/first_port
|
||||
/// Second value to compare with the first value
|
||||
var/datum/port/input/second_port
|
||||
|
||||
var/current_type = PORT_TYPE_ANY
|
||||
|
||||
/obj/item/circuit_component/compare/comparison/populate_options()
|
||||
@@ -24,27 +28,27 @@
|
||||
)
|
||||
comparison_option = add_option_port("Comparison Option", component_options)
|
||||
|
||||
/obj/item/circuit_component/compare/comparison/populate_custom_ports()
|
||||
first_port = add_input_port("A", PORT_TYPE_ANY)
|
||||
second_port = add_input_port("B", PORT_TYPE_ANY)
|
||||
|
||||
/obj/item/circuit_component/compare/comparison/pre_input_received(datum/port/input/port)
|
||||
switch(comparison_option.value)
|
||||
if(COMP_COMPARISON_EQUAL, COMP_COMPARISON_NOT_EQUAL)
|
||||
if(current_type != PORT_TYPE_ANY)
|
||||
current_type = PORT_TYPE_ANY
|
||||
compare_ports[1].set_datatype(PORT_TYPE_ANY)
|
||||
compare_ports[2].set_datatype(PORT_TYPE_ANY)
|
||||
first_port.set_datatype(PORT_TYPE_ANY)
|
||||
second_port.set_datatype(PORT_TYPE_ANY)
|
||||
else
|
||||
if(current_type != PORT_TYPE_NUMBER)
|
||||
current_type = PORT_TYPE_NUMBER
|
||||
compare_ports[1].set_datatype(PORT_TYPE_NUMBER)
|
||||
compare_ports[2].set_datatype(PORT_TYPE_NUMBER)
|
||||
first_port.set_datatype(PORT_TYPE_NUMBER)
|
||||
second_port.set_datatype(PORT_TYPE_NUMBER)
|
||||
|
||||
|
||||
/obj/item/circuit_component/compare/comparison/do_comparisons(list/ports)
|
||||
if(length(ports) < input_port_amount)
|
||||
return FALSE
|
||||
|
||||
// Comparison component only compares the first two ports
|
||||
var/input1 = compare_ports[1].value
|
||||
var/input2 = compare_ports[2].value
|
||||
/obj/item/circuit_component/compare/comparison/do_comparisons()
|
||||
var/input1 = first_port.value
|
||||
var/input2 = second_port.value
|
||||
var/current_option = comparison_option.value
|
||||
|
||||
switch(current_option)
|
||||
|
||||
Reference in New Issue
Block a user