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

16 lines
13 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/action - /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/action.html#var">Var Details</a> - <a href="datum/action.html#proc">Proc Details</a></header><main><h1>action <aside>/<a href="datum.html">datum</a>/<a href="datum/action.html">action</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L7"><img src="git.png" width="16" height="16" title="code/datums/action.dm 7"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/action.html#var/background_icon_state">background_icon_state</a></th><td>This is the icon state state for the BACKGROUND underlay icon of the button
(If set to ACTION_BUTTON_DEFAULT_BACKGROUND, uses the hud's default background)</td></tr><tr><th><a href="datum/action.html#var/button_icon">button_icon</a></th><td>This is the file for the BACKGROUND underlay icon of the button</td></tr><tr><th><a href="datum/action.html#var/button_icon_state">button_icon_state</a></th><td>This is the icon state for the icon that appears on the button</td></tr><tr><th><a href="datum/action.html#var/buttontooltipstyle">buttontooltipstyle</a></th><td>The style the button's tooltips appear to be</td></tr><tr><th><a href="datum/action.html#var/check_flags">check_flags</a></th><td>Flags that will determine of the owner / user of the action can... use the action</td></tr><tr><th><a href="datum/action.html#var/default_button_position">default_button_position</a></th><td>Where any buttons we create should be by default. Accepts screen_loc and location defines</td></tr><tr><th><a href="datum/action.html#var/desc">desc</a></th><td>The description of what the action does, shown in button tooltips</td></tr><tr><th><a href="datum/action.html#var/icon_icon">icon_icon</a></th><td>This is the file for the icon that appears on the button</td></tr><tr><th><a href="datum/action.html#var/name">name</a></th><td>The name of the action</td></tr><tr><th><a href="datum/action.html#var/owner">owner</a></th><td>This is who currently owns the action, and most often, this is who is using the action if it is triggered
This can be the same as &quot;target&quot; but is not ALWAYS the same - this is set and unset with Grant() and Remove()</td></tr><tr><th><a href="datum/action.html#var/target">target</a></th><td>The target the action is attached to. If the target datum is deleted, the action is as well.
Set in New() via the proc link_to(). PLEASE set a target if you're making an action</td></tr><tr><th><a href="datum/action.html#var/transparent_when_unavailable">transparent_when_unavailable</a></th><td>Whether the button becomes transparent when it can't be used, or just reddened</td></tr><tr><th><a href="datum/action.html#var/viewers">viewers</a></th><td>List of all mobs that are viewing our action button -&gt; A unique movable for them to view.</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/action.html#proc/GiveAction">GiveAction</a></th><td>Gives our action to the passed viewer.
Puts our action in their actions list and shows them the button.</td></tr><tr><th><a href="datum/action.html#proc/HideFrom">HideFrom</a></th><td>Removes our action from the passed viewer.</td></tr><tr><th><a href="datum/action.html#proc/IsAvailable">IsAvailable</a></th><td>Whether our action is currently available to use or not</td></tr><tr><th><a href="datum/action.html#proc/ShowTo">ShowTo</a></th><td>Adds our action button to the screen of the passed viewer.</td></tr><tr><th><a href="datum/action.html#proc/Trigger">Trigger</a></th><td>Actually triggers the effects of the action.
Called when the on-screen button is clicked, for example.</td></tr><tr><th><a href="datum/action.html#proc/clear_ref">clear_ref</a></th><td>Signal proc that clears any references based on the owner or target deleting
If the owner's deleted, we will simply remove from them, but if the target's deleted, we will self-delete</td></tr><tr><th><a href="datum/action.html#proc/update_status_on_signal">update_status_on_signal</a></th><td>A general use signal proc that reacts to an event and updates JUST our button's status</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/background_icon_state"><aside class="declaration">var </aside>background_icon_state <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L36"><img src="git.png" width="16" height="16" title="code/datums/action.dm 36"></a></h3><p>This is the icon state state for the BACKGROUND underlay icon of the button
(If set to ACTION_BUTTON_DEFAULT_BACKGROUND, uses the hud's default background)</p><h3 id="var/button_icon"><aside class="declaration">var </aside>button_icon <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L33"><img src="git.png" width="16" height="16" title="code/datums/action.dm 33"></a></h3><p>This is the file for the BACKGROUND underlay icon of the button</p><h3 id="var/button_icon_state"><aside class="declaration">var </aside>button_icon_state <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L41"><img src="git.png" width="16" height="16" title="code/datums/action.dm 41"></a></h3><p>This is the icon state for the icon that appears on the button</p><h3 id="var/buttontooltipstyle"><aside class="declaration">var </aside>buttontooltipstyle <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L30"><img src="git.png" width="16" height="16" title="code/datums/action.dm 30"></a></h3><p>The style the button's tooltips appear to be</p><h3 id="var/check_flags"><aside class="declaration">var </aside>check_flags <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L21"><img src="git.png" width="16" height="16" title="code/datums/action.dm 21"></a></h3><p>Flags that will determine of the owner / user of the action can... use the action</p><h3 id="var/default_button_position"><aside class="declaration">var </aside>default_button_position <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L16"><img src="git.png" width="16" height="16" title="code/datums/action.dm 16"></a></h3><p>Where any buttons we create should be by default. Accepts screen_loc and location defines</p><h3 id="var/desc"><aside class="declaration">var </aside>desc <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L11"><img src="git.png" width="16" height="16" title="code/datums/action.dm 11"></a></h3><p>The description of what the action does, shown in button tooltips</p><h3 id="var/icon_icon"><aside class="declaration">var </aside>icon_icon <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L39"><img src="git.png" width="16" height="16" title="code/datums/action.dm 39"></a></h3><p>This is the file for the icon that appears on the button</p><h3 id="var/name"><aside class="declaration">var </aside>name <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L9"><img src="git.png" width="16" height="16" title="code/datums/action.dm 9"></a></h3><p>The name of the action</p><h3 id="var/owner"><aside class="declaration">var </aside>owner <aside> /<a href="mob.html">mob</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L19"><img src="git.png" width="16" height="16" title="code/datums/action.dm 19"></a></h3><p>This is who currently owns the action, and most often, this is who is using the action if it is triggered
This can be the same as &quot;target&quot; but is not ALWAYS the same - this is set and unset with Grant() and Remove()</p><h3 id="var/target"><aside class="declaration">var </aside>target <aside> /<a href="datum.html">datum</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L14"><img src="git.png" width="16" height="16" title="code/datums/action.dm 14"></a></h3><p>The target the action is attached to. If the target datum is deleted, the action is as well.
Set in New() via the proc link_to(). PLEASE set a target if you're making an action</p><h3 id="var/transparent_when_unavailable"><aside class="declaration">var </aside>transparent_when_unavailable <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L25"><img src="git.png" width="16" height="16" title="code/datums/action.dm 25"></a></h3><p>Whether the button becomes transparent when it can't be used, or just reddened</p><h3 id="var/viewers"><aside class="declaration">var </aside>viewers <aside> /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L27"><img src="git.png" width="16" height="16" title="code/datums/action.dm 27"></a></h3><p>List of all mobs that are viewing our action button -&gt; A unique movable for them to view.</p><h2 id="proc">Proc Details</h2><h3 id="proc/GiveAction"><aside class="declaration">proc </aside>GiveAction<aside>(/<a href="mob.html">mob</a>/viewer) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L210"><img src="git.png" width="16" height="16" title="code/datums/action.dm 210"></a></aside></h3><p>Gives our action to the passed viewer.
Puts our action in their actions list and shows them the button.</p><h3 id="proc/HideFrom"><aside class="declaration">proc </aside>HideFrom<aside>(/<a href="mob.html">mob</a>/viewer) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L236"><img src="git.png" width="16" height="16" title="code/datums/action.dm 236"></a></aside></h3><p>Removes our action from the passed viewer.</p><h3 id="proc/IsAvailable"><aside class="declaration">proc </aside>IsAvailable<aside>(silent) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L128"><img src="git.png" width="16" height="16" title="code/datums/action.dm 128"></a></aside></h3><p>Whether our action is currently available to use or not</p>
<ul>
<li>silent - If false this is being called to check if we have any messages to show to the owner</li>
</ul><h3 id="proc/ShowTo"><aside class="declaration">proc </aside>ShowTo<aside>(/<a href="mob.html">mob</a>/viewer) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L219"><img src="git.png" width="16" height="16" title="code/datums/action.dm 219"></a></aside></h3><p>Adds our action button to the screen of the passed viewer.</p><h3 id="proc/Trigger"><aside class="declaration">proc </aside>Trigger<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L114"><img src="git.png" width="16" height="16" title="code/datums/action.dm 114"></a></aside></h3><p>Actually triggers the effects of the action.
Called when the on-screen button is clicked, for example.</p><h3 id="proc/clear_ref"><aside class="declaration">proc </aside>clear_ref<aside>(/<a href="datum.html">datum</a>/ref) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L62"><img src="git.png" width="16" height="16" title="code/datums/action.dm 62"></a></aside></h3><p>Signal proc that clears any references based on the owner or target deleting
If the owner's deleted, we will simply remove from them, but if the target's deleted, we will self-delete</p><h3 id="proc/update_status_on_signal"><aside class="declaration">proc </aside>update_status_on_signal<aside>(/<a href="datum.html">datum</a>/source, new_stat, old_stat) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/action.dm#L269"><img src="git.png" width="16" height="16" title="code/datums/action.dm 269"></a></aside></h3><p>A general use signal proc that reacts to an event and updates JUST our button's status</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>