mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-10 15:45:05 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user