Files
Paradise/obj/item/storage.html

26 lines
20 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>/obj/item/storage - 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="obj/item/storage.html#var">Var Details</a> - <a href="obj/item/storage.html#proc">Proc Details</a></header><main><h1>storage <aside>/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/storage.html">storage</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L8"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 8"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="obj/item/storage.html#var/allow_quick_empty">allow_quick_empty</a></th><td>Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.</td></tr><tr><th><a href="obj/item/storage.html#var/allow_quick_gather">allow_quick_gather</a></th><td>Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.</td></tr><tr><th><a href="obj/item/storage.html#var/can_hold">can_hold</a></th><td>List of objects which this item can store (if set, it can't store anything else)</td></tr><tr><th><a href="obj/item/storage.html#var/cant_hold">cant_hold</a></th><td>List of objects which this item can't store (in effect only if can_hold isn't set)</td></tr><tr><th><a href="obj/item/storage.html#var/cant_hold_override">cant_hold_override</a></th><td>List of objects which this item overrides the cant_hold list (used to negate cant_hold on specific items. Ex: Allowing Smuggler's Satchels (subtype of backpack) to be stored inside bags of holding.)</td></tr><tr><th><a href="obj/item/storage.html#var/display_contents_with_number">display_contents_with_number</a></th><td>Set this to make the storage item group contents of the same type and display them as a number.</td></tr><tr><th><a href="obj/item/storage.html#var/foldable">foldable</a></th><td>What kind of <a href="obj/item/stack.html" title="/obj/item/stack">/obj/item/stack</a> can this be folded into. (e.g. Boxes and cardboard)</td></tr><tr><th><a href="obj/item/storage.html#var/foldable_amt">foldable_amt</a></th><td>How much of the stack item do you get.</td></tr><tr><th><a href="obj/item/storage.html#var/max_combined_w_class">max_combined_w_class</a></th><td>The sum of the w_classes of all the items in this storage item.</td></tr><tr><th><a href="obj/item/storage.html#var/max_w_class">max_w_class</a></th><td>Max size of objects that this object can store (in effect only if can_hold isn't set)</td></tr><tr><th><a href="obj/item/storage.html#var/mobs_viewing">mobs_viewing</a></th><td>Lazy list of mobs which are currently viewing the storage inventory.</td></tr><tr><th><a href="obj/item/storage.html#var/pickup_all_on_tile">pickup_all_on_tile</a></th><td>Pick up one item at a time or everything on the tile</td></tr><tr><th><a href="obj/item/storage.html#var/silent">silent</a></th><td>No message on putting items in.</td></tr><tr><th><a href="obj/item/storage.html#var/storage_slots">storage_slots</a></th><td>The number of storage slots in this container.</td></tr><tr><th><a href="obj/item/storage.html#var/use_sound">use_sound</a></th><td>Sound played when used. <code>null</code> for no sound.</td></tr><tr><th><a href="obj/item/storage.html#var/use_to_pickup">use_to_pickup</a></th><td>Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up.</td></tr><tr><th><a href="obj/item/storage.html#var/w_class_override">w_class_override</a></th><td>List of objects that can be stored, regardless of w_class</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="obj/item/storage.html#proc/can_be_inserted">can_be_inserted</a></th><td>Checks whether <code>I</code> can be inserted into the container.</td></tr><tr><th><a href="obj/item/storage.html#proc/handle_item_insertion">handle_item_insertion</a></th><td>Handles items being inserted into a storage container.</td></tr><tr><th><a href="obj/item/storage.html#proc/hide_from">hide_from</a></th><td>Hides the current container interface from <code>user</code>.</td></tr><tr><th><a href="obj/item/storage.html#proc/hide_from_all">hide_from_all</a></th><td>Hides the current container interface from all viewers.</td></tr><tr><th><a href="obj/item/storage.html#proc/orient_objs">orient_objs</a></th><td>Draws the inventory and places the items on it using custom positions.</td></tr><tr><th><a href="obj/item/storage.html#proc/populate_contents">populate_contents</a></th><td>Populates the container with items</td></tr><tr><th><a href="obj/item/storage.html#proc/remove_from_storage">remove_from_storage</a></th><td>Handles the removal of an item from a storage container.</td></tr><tr><th><a href="obj/item/storage.html#proc/return_inv">return_inv</a></th><td>Loops through any nested containers inside <code>src</code>, and returns a list of everything inside them.</td></tr><tr><th><a href="obj/item/storage.html#proc/show_to">show_to</a></th><td>Shows <code>user</code> the contents of <code>src</code>, and activates any mouse trap style triggers.</td></tr><tr><th><a href="obj/item/storage.html#proc/try_insert_item">try_insert_item</a></th><td>Checks if an item can be inserted, then insertsit. Riveting, I know.
Mostly exists to bypass the robot restriction for using storage (for like ore bags).</td></tr><tr><th><a href="obj/item/storage.html#proc/update_viewers">update_viewers</a></th><td>Checks all mobs currently viewing the storage inventory, and hides it if they shouldn't be able to see it.</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/allow_quick_empty"><aside class="declaration">var </aside>allow_quick_empty <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L36"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 36"></a></h3><p>Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.</p><h3 id="var/allow_quick_gather"><aside class="declaration">var </aside>allow_quick_gather <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L38"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 38"></a></h3><p>Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.</p><h3 id="var/can_hold"><aside class="declaration">var </aside>can_hold <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L15"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 15"></a></h3><p>List of objects which this item can store (if set, it can't store anything else)</p><h3 id="var/cant_hold"><aside class="declaration">var </aside>cant_hold <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L19"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 19"></a></h3><p>List of objects which this item can't store (in effect only if can_hold isn't set)</p><h3 id="var/cant_hold_override"><aside class="declaration">var </aside>cant_hold_override <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L21"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 21"></a></h3><p>List of objects which this item overrides the cant_hold list (used to negate cant_hold on specific items. Ex: Allowing Smuggler's Satchels (subtype of backpack) to be stored inside bags of holding.)</p><h3 id="var/display_contents_with_number"><aside class="declaration">var </aside>display_contents_with_number <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L34"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 34"></a></h3><p>Set this to make the storage item group contents of the same type and display them as a number.</p><h3 id="var/foldable"><aside class="declaration">var </aside>foldable <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L44"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 44"></a></h3><p>What kind of <a href="obj/item/stack.html" title="/obj/item/stack">/obj/item/stack</a> can this be folded into. (e.g. Boxes and cardboard)</p><h3 id="var/foldable_amt"><aside class="declaration">var </aside>foldable_amt <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L46"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 46"></a></h3><p>How much of the stack item do you get.</p><h3 id="var/max_combined_w_class"><aside class="declaration">var </aside>max_combined_w_class <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L25"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 25"></a></h3><p>The sum of the w_classes of all the items in this storage item.</p><h3 id="var/max_w_class"><aside class="declaration">var </aside>max_w_class <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L23"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 23"></a></h3><p>Max size of objects that this object can store (in effect only if can_hold isn't set)</p><h3 id="var/mobs_viewing"><aside class="declaration">var </aside>mobs_viewing <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L49"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 49"></a></h3><p>Lazy list of mobs which are currently viewing the storage inventory.</p><h3 id="var/pickup_all_on_tile"><aside class="declaration">var </aside>pickup_all_on_tile <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L40"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 40"></a></h3><p>Pick up one item at a time or everything on the tile</p><h3 id="var/silent"><aside class="declaration">var </aside>silent <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L13"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 13"></a></h3><p>No message on putting items in.</p><h3 id="var/storage_slots"><aside class="declaration">var </aside>storage_slots <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L27"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 27"></a></h3><p>The number of storage slots in this container.</p><h3 id="var/use_sound"><aside class="declaration">var </aside>use_sound <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L42"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 42"></a></h3><p>Sound played when used. <code>null</code> for no sound.</p><h3 id="var/use_to_pickup"><aside class="declaration">var </aside>use_to_pickup <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L32"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 32"></a></h3><p>Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up.</p><h3 id="var/w_class_override"><aside class="declaration">var </aside>w_class_override <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L17"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 17"></a></h3><p>List of objects that can be stored, regardless of w_class</p><h2 id="proc">Proc Details</h2><h3 id="proc/can_be_inserted"><aside class="declaration">proc </aside>can_be_inserted<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/I, stop_messages) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L389"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 389"></a></aside></h3><p>Checks whether <code>I</code> can be inserted into the container.</p>
<p>Returns <code>TRUE</code> if it can, and <code>FALSE</code> if it can't.
Arguments:</p>
<ul>
<li>obj/item/I - The item to insert</li>
<li>stop_messages - Don't display a warning message if the item can't be inserted</li>
</ul><h3 id="proc/handle_item_insertion"><aside class="declaration">proc </aside>handle_item_insertion<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/I, /<a href="mob.html">mob</a>/user, prevent_warning) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L466"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 466"></a></aside></h3><p>Handles items being inserted into a storage container.</p>
<p>This doesn't perform any checks of whether an item can be inserted. That's done by <a href="obj/item/storage.html#proc/can_be_inserted" title="/obj/item/storage">/obj/item/storage/proc/can_be_inserted</a>
Arguments:</p>
<ul>
<li>obj/item/I - The item to be inserted</li>
<li>mob/user - The mob performing the insertion</li>
<li>prevent_warning - Stop the insertion message being displayed. Intended for cases when you are inserting multiple items at once.</li>
</ul><h3 id="proc/hide_from"><aside class="declaration">proc </aside>hide_from<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L239"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 239"></a></aside></h3><p>Hides the current container interface from <code>user</code>.</p><h3 id="proc/hide_from_all"><aside class="declaration">proc </aside>hide_from_all<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L253"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 253"></a></aside></h3><p>Hides the current container interface from all viewers.</p><h3 id="proc/orient_objs"><aside class="declaration">proc </aside>orient_objs<aside>(tx, ty, mx, my) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L296"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 296"></a></aside></h3><p>Draws the inventory and places the items on it using custom positions.</p>
<p><code>tx</code> and <code>ty</code> are the upper left tile.
<code>mx</code> and <code>my</code> are the bottom right tile.</p>
<p>The numbers are calculated from the bottom left, with the bottom left being <code>1,1</code>.</p><h3 id="proc/populate_contents"><aside class="declaration">proc </aside>populate_contents<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L656"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 656"></a></aside></h3><p>Populates the container with items</p>
<p>Override with whatever you want to put in the container</p><h3 id="proc/remove_from_storage"><aside class="declaration">proc </aside>remove_from_storage<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/I, /<a href="atom.html">atom</a>/new_location) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L532"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 532"></a></aside></h3><p>Handles the removal of an item from a storage container.</p>
<p>Arguments:</p>
<ul>
<li>obj/item/I - The item to be removed</li>
<li>atom/new_location - The location to send the item to.</li>
</ul><h3 id="proc/return_inv"><aside class="declaration">proc </aside>return_inv<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L201"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 201"></a></aside></h3><p>Loops through any nested containers inside <code>src</code>, and returns a list of everything inside them.</p>
<p>Currently checks for storage containers, gifts containing storage containers, and folders.</p><h3 id="proc/show_to"><aside class="declaration">proc </aside>show_to<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L219"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 219"></a></aside></h3><p>Shows <code>user</code> the contents of <code>src</code>, and activates any mouse trap style triggers.</p><h3 id="proc/try_insert_item"><aside class="declaration">proc </aside>try_insert_item<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/I, /<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L590"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 590"></a></aside></h3><p>Checks if an item can be inserted, then insertsit. Riveting, I know.
Mostly exists to bypass the robot restriction for using storage (for like ore bags).</p><h3 id="proc/update_viewers"><aside class="declaration">proc </aside>update_viewers<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/items/storage/storage_base.dm#L260"><img src="git.png" width="16" height="16" title="code/game/objects/items/storage/storage_base.dm 260"></a></aside></h3><p>Checks all mobs currently viewing the storage inventory, and hides it if they shouldn't be able to see it.</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>