Files
Paradise/datum/component/codeword_hearing.html

6 lines
4.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/component/codeword_hearing - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/component/codeword_hearing.html#var">Var Details</a> - <a href="datum/component/codeword_hearing.html#proc">Proc Details</a></header><main><h1>codeword_hearing <aside>/<a href="datum.html">datum</a>/<a href="datum/component.html">component</a>/<a href="datum/component/codeword_hearing.html">codeword_hearing</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/datums/components/codeword_hearing.dm#L11"><img src="git.png" width="16" height="16" title="code/datums/components/codeword_hearing.dm 11"></a></h1><p>Component that allows for highlighting of words or phrases in chat based on regular expressions.</p>
<p>Hooks into /mob/proc/combine_message to wrap every regex match in the message
between <span class=''></span> tags with the provided span class. This modifies the output that
is sent to the parent's chat window.</p>
<p>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)].</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/component/codeword_hearing.html#var/replace_regex">replace_regex</a></th><td>Regex for matching words or phrases you want highlighted.</td></tr><tr><th><a href="datum/component/codeword_hearing.html#var/source">source</a></th><td>The source of this component. Used to identify the source in delete_if_from_source since this component is COMPONENT_DUPE_ALLOWED.</td></tr><tr><th><a href="datum/component/codeword_hearing.html#var/span_class">span_class</a></th><td>The <span class=''> to use for highlighting matches.</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/component/codeword_hearing.html#proc/delete_if_from_source">delete_if_from_source</a></th><td>Since a parent can have multiple of these components on them simultaneously, this allows a datum to delete components from a specific source.</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/replace_regex"><aside class="declaration">var </aside>replace_regex <aside> /regex</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/datums/components/codeword_hearing.dm#L15"><img src="git.png" width="16" height="16" title="code/datums/components/codeword_hearing.dm 15"></a></h3><p>Regex for matching words or phrases you want highlighted.</p><h3 id="var/source"><aside class="declaration">var </aside>source <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/datums/components/codeword_hearing.dm#L19"><img src="git.png" width="16" height="16" title="code/datums/components/codeword_hearing.dm 19"></a></h3><p>The source of this component. Used to identify the source in delete_if_from_source since this component is COMPONENT_DUPE_ALLOWED.</p><h3 id="var/span_class"><aside class="declaration">var </aside>span_class <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/datums/components/codeword_hearing.dm#L17"><img src="git.png" width="16" height="16" title="code/datums/components/codeword_hearing.dm 17"></a></h3><p>The <span class=''> to use for highlighting matches.</p><h2 id="proc">Proc Details</h2><h3 id="proc/delete_if_from_source"><aside class="declaration">proc </aside>delete_if_from_source<aside>(component_source) <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/datums/components/codeword_hearing.dm#L42"><img src="git.png" width="16" height="16" title="code/datums/components/codeword_hearing.dm 42"></a></aside></h3><p>Since a parent can have multiple of these components on them simultaneously, this allows a datum to delete components from a specific source.</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/776b9861f70566b1e6a0763a465ef22f7920a3d6">776b986</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>