[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

View File

@@ -38,6 +38,9 @@
desc = "Represents an action the user can take when implanted with the brain-computer interface."
required_shells = list(/obj/item/organ/cyberimp/bci)
/// The icon of the button
var/datum/port/input/option/icon_options
/// The name to use for the button
var/datum/port/input/button_name
@@ -51,7 +54,7 @@
. = ..()
if (!isnull(default_icon))
set_option(default_icon)
icon_options.set_input(default_icon)
button_name = add_input_port("Name", PORT_TYPE_STRING)
@@ -99,7 +102,7 @@
"Wireless",
)
options = action_options
icon_options = add_option_port("Icon", action_options)
/obj/item/circuit_component/bci_action/register_shell(atom/movable/shell)
var/obj/item/organ/cyberimp/bci/bci = shell
@@ -126,7 +129,7 @@
/obj/item/circuit_component/bci_action/proc/update_action()
bci_action.name = button_name.input_value
bci_action.button_icon_state = "bci_[replacetextEx(lowertext(current_option), " ", "_")]"
bci_action.button_icon_state = "bci_[replacetextEx(lowertext(icon_options.input_value), " ", "_")]"
/datum/action/innate/bci_action
name = "Action"