[MIRROR] BCI overlays and click interception (#7319)

* BCI overlays and click interception (#60503)

* BCI overlays and click interception

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-08-03 19:36:42 +02:00
committed by GitHub
parent 23d27d9396
commit cc1ece2b38
11 changed files with 423 additions and 11 deletions

View File

@@ -11,9 +11,9 @@
AddComponent(/datum/component/shell, list(
new /obj/item/circuit_component/bci_core,
new /obj/item/circuit_component/bci_action("One"),
new /obj/item/circuit_component/bci_action("Two"),
new /obj/item/circuit_component/bci_action("Three"),
new /obj/item/circuit_component/bci_action(null, "One"),
new /obj/item/circuit_component/bci_action(null, "Two"),
new /obj/item/circuit_component/bci_action(null, "Three"),
), SHELL_CAPACITY_SMALL)
/obj/item/organ/cyberimp/bci/Insert(mob/living/carbon/reciever, special, drop_if_replaced)
@@ -33,13 +33,10 @@
else
return ..()
/obj/item/circuit_component/bci
display_name = "Brain-Computer Interface"
desc = "Used to receive inputs for the brain-computer interface. User is presented with three buttons."
/obj/item/circuit_component/bci_action
display_name = "BCI Action"
desc = "Represents an action the user can take when implanted with the brain-computer interface."
required_shells = list(/obj/item/organ/cyberimp/bci)
/// The name to use for the button
var/datum/port/input/button_name
@@ -394,12 +391,15 @@
if (. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
return .
if(!user.Adjacent(src))
return
if (locked)
balloon_alert(user, "it's locked!")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
var/obj/item/organ/cyberimp/bci/bci_to_implant_resolved = bci_to_implant?.resolve()
if (isnull(bci_to_implant_resolved) && user.Adjacent(src))
if (isnull(bci_to_implant_resolved))
balloon_alert(user, "no bci inserted!")
else
user.put_in_hands(bci_to_implant_resolved)
@@ -524,7 +524,7 @@
if (!isnull(message))
if (COOLDOWN_FINISHED(src, message_cooldown))
COOLDOWN_START(src, message_cooldown, 5 SECONDS)
balloon_alert(user, "it won't budge!")
balloon_alert(user, message)
return