codeword_hearing
Component that allows for highlighting of words or phrases in chat based on regular expressions.
Hooks into the parent's COMSIG_MOVABLE_HEAR signal to wrap every regex match in the message between tags with the provided span class. This modifies the output that is sent to the parent's chat window.
Removal of this component should be done by calling [GetComponents(/datum/component/codeword_hearing)] on the parent and then iterating through all components calling [delete_if_from_source(source)].
Vars | |
replace_regex | Regex for matching words or phrases you want highlighted. |
---|---|
source | The source of this component. Used to identify the source in delete_if_from_source since this component is COMPONENT_DUPE_ALLOWED. |
span_class | The to use for highlighting matches. |
Procs | |
delete_if_from_source | Since a parent can have multiple of these components on them simultaneously, this allows a datum to delete components from a specific source. |
handle_hearing | Callback for COMSIG_MOVABLE_HEAR which highlights syndicate code phrases in chat. |
Var Details
replace_regex
Regex for matching words or phrases you want highlighted.
source
The source of this component. Used to identify the source in delete_if_from_source since this component is COMPONENT_DUPE_ALLOWED.
span_class
The to use for highlighting matches.
Proc Details
delete_if_from_source
Since a parent can have multiple of these components on them simultaneously, this allows a datum to delete components from a specific source.
handle_hearing
Callback for COMSIG_MOVABLE_HEAR which highlights syndicate code phrases in chat.