sign_language
Reactive Sign Language Component for Carbons. Allows Carbons to speak with sign language if they have the relevant traits. Implements sign language by incrementally overriding several critical functions, variables, and argument lists.
High-Level Theory of Operation:
- Component is added to a Carbon via AddComponent.
- Component grants sign language action to its parent, which adds and removes TRAIT_SIGN_LANG.
- Component reacts to addition and removal of TRAIT_SIGN_LANG in parent:
- If TRAIT_SIGN_LANG is added, then enable sign language. Listen for speech signals and modify the mob's speech, say_mod verbs, and typing indicator.
- If TRAIT_SIGN_LANG is removed, then disable sign language. Unregister from speech signals and reset the mob's speech, say_mob verbs, and typing indicator.
- Credits:
- Original Tongue Tied created by @Wallemations (https://github.com/tgstation/tgstation/pull/52907)
- Action sprite created by @Wallemations (icons/hud/actions.dmi:sign_language)
Vars | |
linked_action | The action for toggling sign language. |
---|---|
omissions | Any symbols to sanitize from signed messages. |
tonal_indicator | The tonal indicator shown when sign language users finish sending a message. If it's empty, none appears. |
tonal_timerid | The timerid for our sign language tonal indicator. |
Procs | |
can_cast_spell | Check if we can sign the given spell |
check_signables_state | Checks to see what state this person is in and if they are able to sign or not. |
disable_sign_language | Signal handler for [COMSIG_SIGNLANGUAGE_DISABLE] Disables signing for the parent Carbon, allowing them to speak vocally. This proc is only called directly after TRAIT_SIGN_LANG is removed from the Carbon. |
emote_tone | Send a visible message depending on the tone of the message that the sender is trying to convey to the world. |
enable_sign_language | Signal handler for [COMSIG_SIGNLANGUAGE_ENABLE] Enables signing for the parent Carbon, stopping them from speaking vocally. This proc is only called directly after TRAIT_SIGN_LANG is added to the Carbon. |
on_added_organ | Signal proc for COMSIG_CARBON_GAIN_ORGAN Applies the new say mod to any tongues that have appeared! |
on_say | Replaces emphatic punctuation with periods. Changes tonal indicator and emotes based on what is typed. |
on_say_quote | Signal proc for COMSIG_MOVABLE_SAY_QUOTE Removes exclamation/question marks. |
on_treat_living_message | Signal proc for COMSIG_LIVING_TREAT_MESSAGE Changes our message based on conditions that limit or alter our ability to communicate |
on_try_speech | Signal proc for COMSIG_MOB_TRY_SPEECH Sign languagers can always speak regardless of they're mute (as long as they're not mimes) |
on_using_radio | Signal proc for COMSIG_MOVABLE_USING_RADIO Disallows us from speaking on comms if we don't have the special trait. |
remove_tonal_indicator | Removes the tonal indicator overlay completely |
sanitize_message | Replace specific characters in the input string with periods. |
Var Details
linked_action
The action for toggling sign language.
omissions
Any symbols to sanitize from signed messages.
tonal_indicator
The tonal indicator shown when sign language users finish sending a message. If it's empty, none appears.
tonal_timerid
The timerid for our sign language tonal indicator.
Proc Details
can_cast_spell
Check if we can sign the given spell
Checks to make sure the spell is not a mime spell, and that we are able to physically cast the spell. Arguments:
-
mob/living/carbon/source - the caster of the spell
-
datum/action/cooldown/spell/spell - the spell we are trying to cast
-
feedback - whether or not a message should be displayed in chat
-
returns SPELL_INVOCATION_FAIL or SPELL_INVOCATION_SUCCESS
check_signables_state
Checks to see what state this person is in and if they are able to sign or not.
disable_sign_language
Signal handler for [COMSIG_SIGNLANGUAGE_DISABLE] Disables signing for the parent Carbon, allowing them to speak vocally. This proc is only called directly after TRAIT_SIGN_LANG is removed from the Carbon.
emote_tone
Send a visible message depending on the tone of the message that the sender is trying to convey to the world.
enable_sign_language
Signal handler for [COMSIG_SIGNLANGUAGE_ENABLE] Enables signing for the parent Carbon, stopping them from speaking vocally. This proc is only called directly after TRAIT_SIGN_LANG is added to the Carbon.
on_added_organ
Signal proc for COMSIG_CARBON_GAIN_ORGAN Applies the new say mod to any tongues that have appeared!
on_say
Replaces emphatic punctuation with periods. Changes tonal indicator and emotes based on what is typed.
on_say_quote
Signal proc for COMSIG_MOVABLE_SAY_QUOTE Removes exclamation/question marks.
on_treat_living_message
Signal proc for COMSIG_LIVING_TREAT_MESSAGE Changes our message based on conditions that limit or alter our ability to communicate
on_try_speech
Signal proc for COMSIG_MOB_TRY_SPEECH Sign languagers can always speak regardless of they're mute (as long as they're not mimes)
on_using_radio
Signal proc for COMSIG_MOVABLE_USING_RADIO Disallows us from speaking on comms if we don't have the special trait.
remove_tonal_indicator
Removes the tonal indicator overlay completely
sanitize_message
Replace specific characters in the input string with periods.