/datum/storage
a datum for atoms that allows holdable storage of items in a hud
Vars | |
can_hold | Types that can be held |
---|---|
can_hold_exact | Exact types that can be held, in addition to can_hold, if it has types |
check_wclass | If set, if can_hold is used, an item not in can_hold or can_hold_exact can fit in the storage if its weight is low enough |
hud | Storage hud attached to the storage |
linked_item | The storage item linked to this datum |
max_wclass | Maximum w_class that can be held |
move_triggered | Does moving the linked storage item cause anything to happen to stored items |
opens_if_worn | Prevent accessing storage when clicked when worn, ex. in pocket |
prevent_holding | Types that have a w_class holdable but that the storage will not hold |
slots | Number of storage slots, even numbers overlap the close button for the on-ground hud layout |
sneaky | Don't print a visible message on use |
stack_stackables | Whether or not this storage allows stacking stackables into its contents |
stealthy_storage | Don't show the contents of the storage on its description |
stored_items | All items stored |
Procs | |
add_contents | when adding an item in |
add_contents_extra | Available if add_contents needs to be overridden |
add_contents_safe | use this versus add_contents() if you also want extra safety checks |
check_can_hold | check if the storage can hold an item or not |
get_all_contents | return recursive search of all contents |
get_capacity_string | return outputtable capacity |
get_contents | return stored contents |
get_fullness | storage is full or not, or can hold some of the given item in it |
get_hud_contents | return contents that can be seen in the hud |
get_visible_slots | return number of visible slots in the hud |
hide_hud | hide storage |
hud_can_add | if an item can be added by clicking it on the visible hud |
hud_shown | if user sees the storage hud |
is_full | storage is full or not |
make_my_stuff | creates initial contents in the storage |
mousetrap_check | when reaching inside the storage item, check for traps |
show_hud | show storage contents |
storage_emp_act | emping storage emps everything inside |
storage_item_after_attack | after attacking an object with the storage item |
storage_item_attack_by | when clicking the storage item with an object
visible is for when the click is fake and we're actually calling it from a safe store chain |
storage_item_attack_hand | when clicking the storage item with an empty hand |
storage_item_attack_self | using storage item in hand |
storage_item_mouse_drop | storage item is mouse dropped onto something |
storage_item_move_triggered | storage item moving triggers a movement of items inside |
storage_item_on_drop | storage item is dropped |
transfer_stored_item | when transfering something in the storage out |
transfer_stored_item_extra | for use if transfer_stored_item is overridden |
try_stack_contents | For adding an item by trying to stack it with other items. Returns the item the input was stacked into if that happened, returns W if it was instead stacked into an available slot. Returns null if it wasn't stacked. |
Var Details
can_hold
Types that can be held
can_hold_exact
Exact types that can be held, in addition to can_hold, if it has types
check_wclass
If set, if can_hold is used, an item not in can_hold or can_hold_exact can fit in the storage if its weight is low enough
hud
Storage hud attached to the storage
linked_item
The storage item linked to this datum
max_wclass
Maximum w_class that can be held
move_triggered
Does moving the linked storage item cause anything to happen to stored items
opens_if_worn
Prevent accessing storage when clicked when worn, ex. in pocket
prevent_holding
Types that have a w_class holdable but that the storage will not hold
slots
Number of storage slots, even numbers overlap the close button for the on-ground hud layout
sneaky
Don't print a visible message on use
stack_stackables
Whether or not this storage allows stacking stackables into its contents
stealthy_storage
Don't show the contents of the storage on its description
stored_items
All items stored
Proc Details
add_contents
when adding an item in
add_contents_extra
Available if add_contents needs to be overridden
add_contents_safe
use this versus add_contents() if you also want extra safety checks
check_can_hold
check if the storage can hold an item or not
get_all_contents
return recursive search of all contents
get_capacity_string
return outputtable capacity
get_contents
return stored contents
get_fullness
storage is full or not, or can hold some of the given item in it
get_hud_contents
return contents that can be seen in the hud
get_visible_slots
return number of visible slots in the hud
hide_hud
hide storage
hud_can_add
if an item can be added by clicking it on the visible hud
hud_shown
if user sees the storage hud
is_full
storage is full or not
make_my_stuff
creates initial contents in the storage
mousetrap_check
when reaching inside the storage item, check for traps
show_hud
show storage contents
storage_emp_act
emping storage emps everything inside
storage_item_after_attack
after attacking an object with the storage item
storage_item_attack_by
when clicking the storage item with an object
visible
is for when the click is fake and we're actually calling it from a safe store chain
storage_item_attack_hand
when clicking the storage item with an empty hand
storage_item_attack_self
using storage item in hand
storage_item_mouse_drop
storage item is mouse dropped onto something
storage_item_move_triggered
storage item moving triggers a movement of items inside
storage_item_on_drop
storage item is dropped
transfer_stored_item
when transfering something in the storage out
transfer_stored_item_extra
for use if transfer_stored_item is overridden
try_stack_contents
For adding an item by trying to stack it with other items. Returns the item the input was stacked into if that happened, returns W if it was instead stacked into an available slot. Returns null if it wasn't stacked.