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

39 lines
9.3 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/tgui_window - /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/tgui_window.html#proc">Proc Details</a></header><main><h1>tgui_window <aside>/<a href="datum.html">datum</a>/<a href="datum/tgui_window.html">tgui_window</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L6"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 6"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/tgui_window.html#proc/New">New</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/acquire_lock">acquire_lock</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/can_be_suspended">can_be_suspended</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/close">close</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/flush_message_queue">flush_message_queue</a></th><td>private</td></tr><tr><th><a href="datum/tgui_window.html#proc/initialize">initialize</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/is_ready">is_ready</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/on_message">on_message</a></th><td>private</td></tr><tr><th><a href="datum/tgui_window.html#proc/release_lock">release_lock</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/send_asset">send_asset</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/send_message">send_message</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/send_raw_message">send_raw_message</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/subscribe">subscribe</a></th><td>public</td></tr><tr><th><a href="datum/tgui_window.html#proc/unsubscribe">unsubscribe</a></th><td>public</td></tr></table><h2 id="proc">Proc Details</h2><h3 id="proc/New">New<aside>(/<a href="client.html">client</a>/client, id, pooled) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L32"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 32"></a></aside></h3><p>public</p>
<p>Create a new tgui window.</p>
<p>required client /client
required id string A unique window identifier.</p><h3 id="proc/acquire_lock"><aside class="declaration">proc </aside>acquire_lock<aside>(/<a href="datum.html">datum</a>/<a href="datum/tgui.html">tgui</a>/ui) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L134"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 134"></a></aside></h3><p>public</p>
<p>Acquire the window lock. Pool will not be able to provide this window
to other UIs for the duration of the lock.</p>
<p>Can be given an optional tgui datum, which will be automatically
subscribed to incoming messages via the on_message proc.</p>
<p>optional ui /datum/tgui</p><h3 id="proc/can_be_suspended"><aside class="declaration">proc </aside>can_be_suspended<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L116"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 116"></a></aside></h3><p>public</p>
<p>Checks if the window can be sanely suspended.</p>
<p>return bool</p><h3 id="proc/close"><aside class="declaration">proc </aside>close<aside>(can_be_suspended) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L179"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 179"></a></aside></h3><p>public</p>
<p>Close the UI.</p>
<p>optional can_be_suspended bool</p><h3 id="proc/flush_message_queue"><aside class="declaration">proc </aside>flush_message_queue<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L268"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 268"></a></aside></h3><p>private</p>
<p>Sends queued messages if the queue wasn't empty.</p><h3 id="proc/initialize"><aside class="declaration">proc </aside>initialize<aside>(inline_assets, inline_html, fancy) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L51"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 51"></a></aside></h3><p>public</p>
<p>Initializes the window with a fresh page. Puts window into the &quot;loading&quot;
state. You can begin sending messages right after initializing. Messages
will be put into the queue until the window finishes loading.</p>
<p>optional inline_assets list List of assets to inline into the html.
optional inline_html string Custom HTML to inject.
optional fancy bool If TRUE, will hide the window titlebar.</p><h3 id="proc/is_ready"><aside class="declaration">proc </aside>is_ready<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L106"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 106"></a></aside></h3><p>public</p>
<p>Checks if the window is ready to receive data.</p>
<p>return bool</p><h3 id="proc/on_message"><aside class="declaration">proc </aside>on_message<aside>(type, payload, href_list) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L282"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 282"></a></aside></h3><p>private</p>
<p>Callback for handling incoming tgui messages.</p><h3 id="proc/release_lock"><aside class="declaration">proc </aside>release_lock<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L143"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 143"></a></aside></h3><p>public</p>
<p>Release the window lock.</p><h3 id="proc/send_asset"><aside class="declaration">proc </aside>send_asset<aside>(/<a href="datum.html">datum</a>/<a href="datum/asset.html">asset</a>/asset) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L253"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 253"></a></aside></h3><p>public</p>
<p>Makes an asset available to use in tgui.</p>
<p>required asset datum/asset</p>
<p>return bool - TRUE if any assets had to be sent to the client</p><h3 id="proc/send_message"><aside class="declaration">proc </aside>send_message<aside>(type, payload, force) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L209"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 209"></a></aside></h3><p>public</p>
<p>Sends a message to tgui window.</p>
<p>required type string Message type
required payload list Message payload
optional force bool Send regardless of the ready status.</p><h3 id="proc/send_raw_message"><aside class="declaration">proc </aside>send_raw_message<aside>(message, force) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L231"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 231"></a></aside></h3><p>public</p>
<p>Sends a raw payload to tgui window.</p>
<p>required message string JSON+urlencoded blob to send.
optional force bool Send regardless of the ready status.</p><h3 id="proc/subscribe"><aside class="declaration">proc </aside>subscribe<aside>(/<a href="datum.html">datum</a>/object, delegate) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L159"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 159"></a></aside></h3><p>public</p>
<p>Subscribes the datum to consume window messages on a specified proc.</p>
<p>Note, that this supports only one subscriber, because code for that
is simpler and therefore faster. If necessary, this can be rewritten
to support multiple subscribers.</p><h3 id="proc/unsubscribe"><aside class="declaration">proc </aside>unsubscribe<aside>(/<a href="datum.html">datum</a>/object) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/tgui/tgui_window.dm#L168"><img src="git.png" width="16" height="16" title="code/modules/tgui/tgui_window.dm 168"></a></aside></h3><p>public</p>
<p>Unsubscribes the datum. Do not forget to call this when cleaning up.</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>