storage
Vars | |
allow_quick_empty | Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor. |
---|---|
allow_quick_gather | Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile. |
can_hold | List of objects which this item can store (if set, it can't store anything else) |
cant_hold | List of objects which this item can't store (in effect only if can_hold isn't set) |
cant_hold_override | 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.) |
display_contents_with_number | Set this to make the storage item group contents of the same type and display them as a number. |
foldable | What kind of /obj/item/stack can this be folded into. (e.g. Boxes and cardboard) |
foldable_amt | How much of the stack item do you get. |
max_combined_w_class | The sum of the w_classes of all the items in this storage item. |
max_w_class | Max size of objects that this object can store (in effect only if can_hold isn't set) |
mobs_viewing | Lazy list of mobs which are currently viewing the storage inventory. |
pickup_all_on_tile | Pick up one item at a time or everything on the tile |
silent | No message on putting items in. |
storage_slots | The number of storage slots in this container. |
use_sound | Sound played when used. null for no sound. |
use_to_pickup | 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. |
w_class_override | List of objects that can be stored, regardless of w_class |
Procs | |
can_be_inserted | Checks whether I can be inserted into the container. |
handle_item_insertion | Handles items being inserted into a storage container. |
hide_from | Hides the current container interface from user . |
hide_from_all | Hides the current container interface from all viewers. |
orient_objs | Draws the inventory and places the items on it using custom positions. |
populate_contents | Populates the container with items |
remove_from_storage | Handles the removal of an item from a storage container. |
return_inv | Loops through any nested containers inside src , and returns a list of everything inside them. |
show_to | Shows user the contents of src , and activates any mouse trap style triggers. |
update_viewers | Checks all mobs currently viewing the storage inventory, and hides it if they shouldn't be able to see it. |
Var Details
allow_quick_empty
Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
allow_quick_gather
Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
can_hold
List of objects which this item can store (if set, it can't store anything else)
cant_hold
List of objects which this item can't store (in effect only if can_hold isn't set)
cant_hold_override
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.)
display_contents_with_number
Set this to make the storage item group contents of the same type and display them as a number.
foldable
What kind of /obj/item/stack can this be folded into. (e.g. Boxes and cardboard)
foldable_amt
How much of the stack item do you get.
max_combined_w_class
The sum of the w_classes of all the items in this storage item.
max_w_class
Max size of objects that this object can store (in effect only if can_hold isn't set)
mobs_viewing
Lazy list of mobs which are currently viewing the storage inventory.
pickup_all_on_tile
Pick up one item at a time or everything on the tile
silent
No message on putting items in.
storage_slots
The number of storage slots in this container.
use_sound
Sound played when used. null
for no sound.
use_to_pickup
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.
w_class_override
List of objects that can be stored, regardless of w_class
Proc Details
can_be_inserted
Checks whether I
can be inserted into the container.
Returns TRUE
if it can, and FALSE
if it can't.
Arguments:
- obj/item/I - The item to insert
- stop_messages - Don't display a warning message if the item can't be inserted
handle_item_insertion
Handles items being inserted into a storage container.
This doesn't perform any checks of whether an item can be inserted. That's done by /obj/item/storage/proc/can_be_inserted Arguments:
- obj/item/I - The item to be inserted
- mob/user - The mob performing the insertion
- prevent_warning - Stop the insertion message being displayed. Intended for cases when you are inserting multiple items at once.
hide_from
Hides the current container interface from user
.
hide_from_all
Hides the current container interface from all viewers.
orient_objs
Draws the inventory and places the items on it using custom positions.
tx
and ty
are the upper left tile.
mx
and my
are the bottom right tile.
The numbers are calculated from the bottom left, with the bottom left being 1,1
.
populate_contents
Populates the container with items
Override with whatever you want to put in the container
remove_from_storage
Handles the removal of an item from a storage container.
Arguments:
- obj/item/I - The item to be removed
- atom/new_location - The location to send the item to.
return_inv
Loops through any nested containers inside src
, and returns a list of everything inside them.
Currently checks for storage containers, gifts containing storage containers, and folders.
show_to
Shows user
the contents of src
, and activates any mouse trap style triggers.
update_viewers
Checks all mobs currently viewing the storage inventory, and hides it if they shouldn't be able to see it.