Files
Paradise/datum/chatmessage.html

35 lines
11 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/chatmessage - 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/chatmessage.html#var">Var Details</a> - <a href="datum/chatmessage.html#proc">Proc Details</a></header><main><h1>Chat Message Overlay <aside>/<a href="datum.html">datum</a>/<a href="datum/chatmessage.html">chatmessage</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L36"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 36"></a></h1><p>Datum for generating a message overlay on the map</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/chatmessage.html#var/animate_lifespan">animate_lifespan</a></th><td>Our animation lifespan, how long this message will last</td></tr><tr><th><a href="datum/chatmessage.html#var/animate_start">animate_start</a></th><td>When we started animating the message</td></tr><tr><th><a href="datum/chatmessage.html#var/approx_lines">approx_lines</a></th><td>Contains the approximate amount of lines for height decay</td></tr><tr><th><a href="datum/chatmessage.html#var/current_z_idx">current_z_idx</a></th><td>The current index used for adjusting the layer of each sequential chat message such that recent messages will overlay older ones</td></tr><tr><th><a href="datum/chatmessage.html#var/message">message</a></th><td>The visual element of the chat messsage</td></tr><tr><th><a href="datum/chatmessage.html#var/message_loc">message_loc</a></th><td>The location in which the message is appearing</td></tr><tr><th><a href="datum/chatmessage.html#var/owned_by">owned_by</a></th><td>The client who heard this message</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/chatmessage.html#proc/New">New</a></th><td>Constructs a chat message overlay</td></tr><tr><th><a href="datum/chatmessage.html#proc/colorize_string">colorize_string</a></th><td>Gets a color for a name, will return the same color for a given string consistently within a round.atom</td></tr><tr><th><a href="datum/chatmessage.html#proc/finish_image_generation">finish_image_generation</a></th><td>finishes the image generation after the MeasureText() call in generate_image().
necessary because after that call the proc can resume at the end of the tick and cause overtime.</td></tr><tr><th><a href="datum/chatmessage.html#proc/generate_image">generate_image</a></th><td>Generates a chat message image representation</td></tr><tr><th><a href="datum/chatmessage.html#proc/get_current_alpha">get_current_alpha</a></th><td>Returns the current alpha of the message based on the time spent</td></tr><tr><th><a href="datum/chatmessage.html#proc/on_parent_qdel">on_parent_qdel</a></th><td>Calls qdel on the chatmessage when its parent is deleted, used to register qdel signal</td></tr><tr><th><a href="datum/chatmessage.html#proc/sanitize_color">sanitize_color</a></th><td>Ensures a colour is bright enough for the system</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/animate_lifespan"><aside class="declaration">var </aside>animate_lifespan <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L50"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 50"></a></h3><p>Our animation lifespan, how long this message will last</p><h3 id="var/animate_start"><aside class="declaration">var </aside>animate_start <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L48"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 48"></a></h3><p>When we started animating the message</p><h3 id="var/approx_lines"><aside class="declaration">var </aside>approx_lines <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L44"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 44"></a></h3><p>Contains the approximate amount of lines for height decay</p><h3 id="var/current_z_idx"><aside class="declaration">var </aside>current_z_idx <aside> /static</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L46"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 46"></a></h3><p>The current index used for adjusting the layer of each sequential chat message such that recent messages will overlay older ones</p><h3 id="var/message"><aside class="declaration">var </aside>message <aside> /image</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L38"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 38"></a></h3><p>The visual element of the chat messsage</p><h3 id="var/message_loc"><aside class="declaration">var </aside>message_loc <aside> /<a href="atom.html">atom</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L40"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 40"></a></h3><p>The location in which the message is appearing</p><h3 id="var/owned_by"><aside class="declaration">var </aside>owned_by <aside> /<a href="client.html">client</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L42"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 42"></a></h3><p>The client who heard this message</p><h2 id="proc">Proc Details</h2><h3 id="proc/New">New<aside>(text, /<a href="atom.html">atom</a>/target, /<a href="mob.html">mob</a>/owner, italics, size, lifespan, symbol) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L63"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 63"></a></aside></h3><p>Constructs a chat message overlay</p>
<p>Arguments:</p>
<ul>
<li>text - The text content of the overlay</li>
<li>target - The target atom to display the overlay at</li>
<li>owner - The mob that owns this overlay, only this mob will be able to view it</li>
<li>italics - Should we use italics or not</li>
<li>lifespan - The lifespan of the message in deciseconds</li>
<li>symbol - The symbol type of the message</li>
</ul><h3 id="proc/colorize_string"><aside class="declaration">proc </aside>colorize_string<aside>(name, sat_shift, lum_shift) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L274"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 274"></a></aside></h3><p>Gets a color for a name, will return the same color for a given string consistently within a round.atom</p>
<p>Note that this proc aims to produce pastel-ish colors using the HSL colorspace. These seem to be favorable for displaying on the map.</p>
<p>Arguments:</p>
<ul>
<li>name - The name to generate a color for</li>
<li>sat_shift - A value between 0 and 1 that will be multiplied against the saturation</li>
<li>lum_shift - A value between 0 and 1 that will be multiplied against the luminescence</li>
</ul><h3 id="proc/finish_image_generation"><aside class="declaration">proc </aside>finish_image_generation<aside>(mheight, /<a href="atom.html">atom</a>/target, /<a href="mob.html">mob</a>/owner, complete_text, lifespan) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L164"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 164"></a></aside></h3><p>finishes the image generation after the MeasureText() call in generate_image().
necessary because after that call the proc can resume at the end of the tick and cause overtime.</p><h3 id="proc/generate_image"><aside class="declaration">proc </aside>generate_image<aside>(text, /<a href="atom.html">atom</a>/target, /<a href="mob.html">mob</a>/owner, lifespan, italics, size, symbol) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L102"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 102"></a></aside></h3><p>Generates a chat message image representation</p>
<p>Arguments:</p>
<ul>
<li>text - The text content of the overlay</li>
<li>target - The target atom to display the overlay at</li>
<li>owner - The mob that owns this overlay, only this mob will be able to view it</li>
<li>radio_speech - Fancy shmancy radio icon represents that we use radio</li>
<li>lifespan - The lifespan of the message in deciseconds</li>
<li>italics - Just copy and paste, sir</li>
<li>size - Size of the message</li>
<li>symbol - The symbol type of the message</li>
</ul><h3 id="proc/get_current_alpha"><aside class="declaration">proc </aside>get_current_alpha<aside>(time_alive) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L233"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 233"></a></aside></h3><p>Returns the current alpha of the message based on the time spent</p><h3 id="proc/on_parent_qdel"><aside class="declaration">proc </aside>on_parent_qdel<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L86"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 86"></a></aside></h3><p>Calls qdel on the chatmessage when its parent is deleted, used to register qdel signal</p><h3 id="proc/sanitize_color"><aside class="declaration">proc </aside>sanitize_color<aside>(color) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/chatmessage.dm#L319"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 319"></a></aside></h3><p>Ensures a colour is bright enough for the system</p>
<p>This proc is used to brighten parts of a colour up if its too dark, and looks bad</p>
<p>Arguments:</p>
<ul>
<li>hex - Hex colour to be brightened up</li>
</ul></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>