Files
GS13NG/datum/chatmessage.html
2025-02-05 06:19:18 +00:00

35 lines
12 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 - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ 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/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L27"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 27"></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/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/eol_complete">eol_complete</a></th><td>Contains the time that the EOL for the message will be complete, used for qdel scheduling</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/next">next</a></th><td>Contains the reference to the next chatmessage in the bucket, used by runechat subsystem</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><th><a href="datum/chatmessage.html#var/prev">prev</a></th><td>Contains the reference to the previous chatmessage in the bucket, used by runechat subsystem</td></tr><tr><th><a href="datum/chatmessage.html#var/scheduled_destruction">scheduled_destruction</a></th><td>Contains the scheduled destruction time, used for scheduling EOL</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/end_of_life">end_of_life</a></th><td>Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion
Arguments:</td></tr><tr><th><a href="datum/chatmessage.html#proc/enter_subsystem">enter_subsystem</a></th><td>Enters the runechat subsystem with this chatmessage, inserting it into the end-of-life queue</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/leave_subsystem">leave_subsystem</a></th><td>Removes this chatmessage datum from the runechat subsystem</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></table><h2 id="var">Var Details</h2><h3 id="var/approx_lines"><aside class="declaration">var </aside>approx_lines <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L39"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 39"></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/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L45"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 45"></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/eol_complete"><aside class="declaration">var </aside>eol_complete <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L37"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 37"></a></h3><p>Contains the time that the EOL for the message will be complete, used for qdel scheduling</p><h3 id="var/message"><aside class="declaration">var </aside>message <aside> /<a href="image.html">image</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L29"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 29"></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/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L31"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 31"></a></h3><p>The location in which the message is appearing</p><h3 id="var/next"><aside class="declaration">var </aside>next <aside> /<a href="datum.html">datum</a>/<a href="datum/chatmessage.html">chatmessage</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L41"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 41"></a></h3><p>Contains the reference to the next chatmessage in the bucket, used by runechat subsystem</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/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L33"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 33"></a></h3><p>The client who heard this message</p><h3 id="var/prev"><aside class="declaration">var </aside>prev <aside> /<a href="datum.html">datum</a>/<a href="datum/chatmessage.html">chatmessage</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L43"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 43"></a></h3><p>Contains the reference to the previous chatmessage in the bucket, used by runechat subsystem</p><h3 id="var/scheduled_destruction"><aside class="declaration">var </aside>scheduled_destruction <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L35"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 35"></a></h3><p>Contains the scheduled destruction time, used for scheduling EOL</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, /list/extra_classes, lifespan) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L57"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 57"></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>extra_classes - Extra classes to apply to the span that holds the text</li>
<li>lifespan - The lifespan of the message in deciseconds</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/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L235"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 235"></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/end_of_life"><aside class="declaration">proc </aside>end_of_life<aside>(fadetime) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L185"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 185"></a></aside></h3><p>Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion
Arguments:</p>
<ul>
<li>fadetime - The amount of time to animate the message's fadeout for</li>
</ul><h3 id="proc/enter_subsystem"><aside class="declaration">proc </aside>enter_subsystem<aside>(new_sched_destruction) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/controllers/subsystem/runechat.dm#L142"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/runechat.dm 142"></a></aside></h3><p>Enters the runechat subsystem with this chatmessage, inserting it into the end-of-life queue</p>
<p>This will also account for a chatmessage already being registered, and in which case
the position will be updated to remove it from the previous location if necessary</p>
<p>Arguments:</p>
<ul>
<li>new_sched_destruction Optional, when provided is used to update an existing message with the new specified time</li>
</ul><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, /list/extra_classes, lifespan) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L94"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 94"></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>extra_classes - Extra classes to apply to the span that holds the text</li>
<li>lifespan - The lifespan of the message in deciseconds</li>
</ul><h3 id="proc/leave_subsystem"><aside class="declaration">proc </aside>leave_subsystem<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/controllers/subsystem/runechat.dm#L199"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/runechat.dm 199"></a></aside></h3><p>Removes this chatmessage datum from the runechat subsystem</p><h3 id="proc/on_parent_qdel"><aside class="declaration">proc </aside>on_parent_qdel<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/chatmessage.dm#L81"><img src="git.png" width="16" height="16" title="code/datums/chatmessage.dm 81"></a></aside></h3><p>Calls qdel on the chatmessage when its parent is deleted, used to register qdel signal</p></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html>