mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
33 lines
11 KiB
HTML
33 lines
11 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/pai_software - 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/pai_software.html#var">Var Details</a> - <a href="datum/pai_software.html#proc">Proc Details</a></header><main><h1>pAI Software <aside>/<a href="datum.html">datum</a>/<a href="datum/pai_software.html">pai_software</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L10"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 10"></a></h1><p>Datum module for pAI software</p>
|
||
<p>Very similar to the PDA app datum, this determines what UI sub-template to use,
|
||
as well as the RAM cost, and if it is toggle software (not a UI app)</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/pai_software.html#var/default">default</a></th><td>Do we have this software installed by default</td></tr><tr><th><a href="datum/pai_software.html#var/id">id</a></th><td>ID for the software. This must be unique</td></tr><tr><th><a href="datum/pai_software.html#var/name">name</a></th><td>Name for the software. This is used as the button text when buying or opening/toggling the software</td></tr><tr><th><a href="datum/pai_software.html#var/pai_holder">pai_holder</a></th><td>pAI which holds this software</td></tr><tr><th><a href="datum/pai_software.html#var/ram_cost">ram_cost</a></th><td>RAM cost; pAIs start with 100 RAM, spending it on programs</td></tr><tr><th><a href="datum/pai_software.html#var/template_file">template_file</a></th><td>Template for the TGUI file</td></tr><tr><th><a href="datum/pai_software.html#var/toggle_software">toggle_software</a></th><td>Whether this software is a toggle or not</td></tr><tr><th><a href="datum/pai_software.html#var/ui_icon">ui_icon</a></th><td>Icon for inside the UI</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/pai_software.html#proc/New">New</a></th><td>New handler</td></tr><tr><th><a href="datum/pai_software.html#proc/get_app_data">get_app_data</a></th><td>Handler for the app's UI data</td></tr><tr><th><a href="datum/pai_software.html#proc/get_holding_mob">get_holding_mob</a></th><td>Helper proc so that pAIs can get the mob holding them</td></tr><tr><th><a href="datum/pai_software.html#proc/is_active">is_active</a></th><td>Helper for checking if a toggle is enabled or not</td></tr><tr><th><a href="datum/pai_software.html#proc/toggle">toggle</a></th><td>Handler for toggling toggle apps on and off</td></tr><tr><th><a href="datum/pai_software.html#proc/ui_act">ui_act</a></th><td>ui_act sanity check helper</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/default"><aside class="declaration">var </aside>default <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L22"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 22"></a></h3><p>Do we have this software installed by default</p><h3 id="var/id"><aside class="declaration">var </aside>id <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L16"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 16"></a></h3><p>ID for the software. This must be unique</p><h3 id="var/name"><aside class="declaration">var </aside>name <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L12"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 12"></a></h3><p>Name for the software. This is used as the button text when buying or opening/toggling the software</p><h3 id="var/pai_holder"><aside class="declaration">var </aside>pai_holder <aside>– /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/silicon.html">silicon</a>/<a href="mob/living/silicon/pai.html">pai</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L28"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 28"></a></h3><p>pAI which holds this software</p><h3 id="var/ram_cost"><aside class="declaration">var </aside>ram_cost <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L14"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 14"></a></h3><p>RAM cost; pAIs start with 100 RAM, spending it on programs</p><h3 id="var/template_file"><aside class="declaration">var </aside>template_file <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L24"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 24"></a></h3><p>Template for the TGUI file</p><h3 id="var/toggle_software"><aside class="declaration">var </aside>toggle_software <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L20"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 20"></a></h3><p>Whether this software is a toggle or not</p><h3 id="var/ui_icon"><aside class="declaration">var </aside>ui_icon <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L26"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 26"></a></h3><p>Icon for inside the UI</p><h2 id="proc">Proc Details</h2><h3 id="proc/New">New<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/silicon.html">silicon</a>/<a href="mob/living/silicon/pai.html">pai</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L37"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 37"></a></aside></h3><p>New handler</p>
|
||
<p>Ensures that the pai_holder var is set to the pAI itself
|
||
Arguments:</p>
|
||
<ul>
|
||
<li>user - The pAI that this softawre is held by</li>
|
||
</ul><h3 id="proc/get_app_data"><aside class="declaration">proc </aside>get_app_data<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/silicon.html">silicon</a>/<a href="mob/living/silicon/pai.html">pai</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L50"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 50"></a></aside></h3><p>Handler for the app's UI data</p>
|
||
<p>This returns the list of the current app's data for the UI
|
||
This will then be injected as a variable on the TGUI data called "app_data"</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>user - The pAI that is using this app</li>
|
||
</ul><h3 id="proc/get_holding_mob"><aside class="declaration">proc </aside>get_holding_mob<aside>(inform) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L87"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 87"></a></aside></h3><p>Helper proc so that pAIs can get the mob holding them</p>
|
||
<p>This needs to exist because pAIs have many different locs
|
||
(Held card, mob itself, in pocket, etc)</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>inform - Boolean, should we inform the pAI if they fail to find a carrier</li>
|
||
</ul><h3 id="proc/is_active"><aside class="declaration">proc </aside>is_active<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/silicon.html">silicon</a>/<a href="mob/living/silicon/pai.html">pai</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L75"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 75"></a></aside></h3><p>Helper for checking if a toggle is enabled or not</p>
|
||
<p>Returns TRUE if the toggle software is active, FALSE if not</p>
|
||
<p>Its like this instead of a simple <code>is_toggled</code> var because some toggles override eachother and this is easier</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>user - The pAI that is using this app</li>
|
||
</ul><h3 id="proc/toggle"><aside class="declaration">proc </aside>toggle<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/silicon.html">silicon</a>/<a href="mob/living/silicon/pai.html">pai</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L62"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 62"></a></aside></h3><p>Handler for toggling toggle apps on and off</p>
|
||
<p>This is invoked whenever you toggle a toggleable function
|
||
Put your toggleable work in here</p>
|
||
<p>Arguments:</p>
|
||
<ul>
|
||
<li>user - The pAI that is using this toggle</li>
|
||
</ul><h3 id="proc/ui_act"><aside class="parent"><a title="/datum" href="datum.html#proc/ui_act">↑</a></aside>ui_act<aside>(action, /list/params, /<a href="datum.html">datum</a>/<a href="datum/tgui.html">tgui</a>/ui, /<a href="datum.html">datum</a>/<a href="datum/ui_state.html">ui_state</a>/state) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/modules/mob/living/silicon/pai/software/pai_software_base.dm#L108"><img src="git.png" width="16" height="16" title="code/modules/mob/living/silicon/pai/software/pai_software_base.dm 108"></a></aside></h3><p>ui_act sanity check helper</p>
|
||
<p>Basically checks the existing href exploit stuff, as well as making sure the user using the UI is the pAI itself</p></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> |