[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:
SkyratBot
2021-08-04 19:30:56 +02:00
committed by GitHub
parent 742f11f0d8
commit 3ab1e7ebe2
39 changed files with 487 additions and 271 deletions
@@ -7,6 +7,8 @@
display_name = "Text Case"
desc = "A component that makes its input uppercase or lowercase."
var/datum/port/input/option/textcase_options
/// The input port
var/datum/port/input/input_port
@@ -20,7 +22,7 @@
COMP_TEXT_LOWER,
COMP_TEXT_UPPER,
)
options = component_options
textcase_options = add_option_port("Textcase Options", component_options)
/obj/item/circuit_component/textcase/Initialize()
. = ..()
@@ -37,7 +39,7 @@
return
var/result
switch(current_option)
switch(textcase_options.input_value)
if(COMP_TEXT_LOWER)
result = lowertext(value)
if(COMP_TEXT_UPPER)