storage
Datumized Storage Eliminates the need for custom signals specifically for the storage component, and attaches a storage variable (atom_storage) to every atom. If you're looking to create custom storage type behaviors, check ../subtypes
Vars | |
allow_big_nesting | whether or not we allow storage objects of the same size inside |
---|---|
allow_quick_empty | show we allow emptying all contents by using the storage object in hand |
allow_quick_gather | If TRUE, we can click on items with the storage object to pick them up and insert them. |
animated | whether or not we should have those cute little animations |
attack_hand_interact | whether or not we should open when clicked |
boxes | storage display object |
can_hold | if this is set, only items, and their children, will fit |
can_hold_description | An additional description shown on double-examine. Is autogenerated to the can_hold list if not set. |
can_hold_trait | if set can only contain stuff with this single trait present. |
cant_hold | if this is set, items, and their children, won't fit |
close_sound | Sound played when closed. |
closer | close button object |
collection_mode | the mode for collection when allow_quick_gather is enabled |
emp_shielded | contents shouldn't be emped |
exception_hold | if set, these items will be the exception to the max size of object that can fit. |
insert_preposition | you put things in a bag, but on a plate |
is_using | List of all the mobs currently viewing the contents of this storage. |
max_specific_storage | max weight class for a single item being inserted |
max_total_storage | max combined weight classes the storage can hold |
numerical_stacking | instead of displaying multiple items of the same type, display them as numbered contents |
open_sound | Sound played when first opened. |
parent | A reference to the atom linked to this storage object If the parent goes, we go. Will never be null. |
quickdraw | alt click takes an item out instead of opening up storage |
real_location | A reference to the atom where the items are actually stored. By default this is parent. Should generally never be null. Sometimes it's not the parent, that's what is called "dissassociated storage". |
rustle_sound | Sound played when interacting with contents. |
screen_max_columns | maximum amount of columns a storage object can have |
screen_pixel_x | pixel location of the boxes and close button |
screen_start_x | where storage starts being rendered, screen_loc wise |
silent | If TRUE, chat messages for inserting/removing items will not be shown. |
Procs | |
animate_parent | Gives a spiffy animation to our parent to represent opening and closing. |
attempt_insert | Attempts to insert an item into the storage |
attempt_remove | Attempts to remove an item from the storage |
can_insert | Checks if an item is capable of being inserted into the storage |
can_manipulate_contents | Check to see if items can be added/removed. |
can_see_contents | Checks who is currently capable of viewing our storage (and is.) |
check_slots_full | Checks if we have enough slots to allow the item inside. |
check_total_weight | Checks if the total weight would exceed our capacity when adding the item. |
check_typecache_for_item | Checks if the item is in our can_hold list. |
check_weight_class | Checks if the item is allowed into storage based on it's weight class |
close_all | Close the storage UI for everyone viewing us. |
close_distance | Signal handler for whenever a mob walks away with us, close if they can't reach us. |
collect_on_turf | Collects every item of a type on a turf. |
contents_for_display | Returns a list of items to display in the hud |
dump_content_at | Dumps all of our contents at a specific location. |
generate_hold_desc | Generates a description, primarily for clothing storage. |
get_quickdraw_item | Returns an item to pull out with the quickdraw interaction. |
get_real_location | Getter for [real_location]. |
handle_enter | Automatically ran on all object insertions: flag marking and view refreshing. |
handle_exit | Automatically ran on all object removals: flag marking and view refreshing. |
handle_mass_pickup | Inserts every item in a given list, with a progress bar |
hide_contents | Hide our storage from a mob. |
item_insertion_feedback | Provides visual feedback in chat for an item insertion |
mass_empty | Signal handler for remove_all() |
on_attack | Signal handler for whenever we're attacked by a mob. |
on_attackby | Signal handler for whenever we're attacked by an object. |
on_emp_act | Signal handler for the emp_act() of all contents |
on_mousedrop_onto | Signal handler for whenever we drag the storage somewhere. |
on_mousedropped_onto | Signal handler for whenever something gets mouse-dropped onto us. |
on_preattack | Signal handler for preattack from an object. |
open_storage | Opens the storage to the mob, showing them the contents to their UI. |
open_storage_attackby_secondary | Signal handler for when we get attacked with secondary click by an item. |
open_storage_on_signal | Signal handler to open up the storage when we recieve a signal. |
orient_item_boxes | Generates the actual UI objects, their location, and alignments whenever we open storage up. |
orient_to_hud | Updates the storage UI to fit all objects inside storage. |
process_numerical_display | Generates the numbers on an item in storage to show stacking. |
put_in_hands_async | Async version of putting something into a mobs hand. |
real_location_gone | Signal handler for when the real location is deleted. |
refresh_views | Refresh the views of everyone currently viewing the storage. |
remove_all | Removes everything inside of our storage |
remove_and_refresh | Resets an object, removes it from our screen, and refreshes the view. |
remove_type | Removes only a specific type of item from our storage |
reset_item | Refreshes and item to be put back into the real world, out of storage. |
return_inv | Recursive proc to get absolutely EVERYTHING inside a storage item, including the contents of inner items. |
set_parent | Set the passed atom as the parent |
set_real_location | Sets where items are physically being stored in the case it shouldn't be on the parent. |
show_contents | Show our storage to a mob. |
toggle_collection_mode | Toggles the collectmode of our storage. |
update_actions | Updates the action button for toggling collectmode. |
Var Details
allow_big_nesting
whether or not we allow storage objects of the same size inside
allow_quick_empty
show we allow emptying all contents by using the storage object in hand
allow_quick_gather
If TRUE, we can click on items with the storage object to pick them up and insert them.
animated
whether or not we should have those cute little animations
attack_hand_interact
whether or not we should open when clicked
boxes
storage display object
can_hold
if this is set, only items, and their children, will fit
can_hold_description
An additional description shown on double-examine. Is autogenerated to the can_hold list if not set.
can_hold_trait
if set can only contain stuff with this single trait present.
cant_hold
if this is set, items, and their children, won't fit
close_sound
Sound played when closed.
closer
close button object
collection_mode
the mode for collection when allow_quick_gather is enabled
emp_shielded
contents shouldn't be emped
exception_hold
if set, these items will be the exception to the max size of object that can fit.
insert_preposition
you put things in a bag, but on a plate
is_using
List of all the mobs currently viewing the contents of this storage.
max_specific_storage
max weight class for a single item being inserted
max_total_storage
max combined weight classes the storage can hold
numerical_stacking
instead of displaying multiple items of the same type, display them as numbered contents
open_sound
Sound played when first opened.
parent
A reference to the atom linked to this storage object If the parent goes, we go. Will never be null.
quickdraw
alt click takes an item out instead of opening up storage
real_location
A reference to the atom where the items are actually stored. By default this is parent. Should generally never be null. Sometimes it's not the parent, that's what is called "dissassociated storage".
Do NOT set this directly, use set_real_location.
rustle_sound
Sound played when interacting with contents.
screen_max_columns
maximum amount of columns a storage object can have
screen_pixel_x
pixel location of the boxes and close button
screen_start_x
where storage starts being rendered, screen_loc wise
silent
If TRUE, chat messages for inserting/removing items will not be shown.
Proc Details
animate_parent
Gives a spiffy animation to our parent to represent opening and closing.
attempt_insert
Attempts to insert an item into the storage
@param datum/source used by the signal handler @param obj/item/to_insert the item we're inserting @param mob/user the user who is inserting the item @param override see item_insertion_feedback() @param force bypass locked storage
attempt_remove
Attempts to remove an item from the storage
@param obj/item/thing the object we're removing @param atom/newLoc where we're placing the item @param silent if TRUE, we won't play any exit sounds @param user the mob performing the action
can_insert
Checks if an item is capable of being inserted into the storage
@param obj/item/to_insert the item we're checking @param messages if TRUE, will print out a message if the item is not valid @param force bypass locked storage
can_manipulate_contents
Check to see if items can be added/removed.
@param mob/living/user an optional user @param force will bypass most checks @param silent will surpress feedback messages
can_see_contents
Checks who is currently capable of viewing our storage (and is.)
check_slots_full
Checks if we have enough slots to allow the item inside.
check_total_weight
Checks if the total weight would exceed our capacity when adding the item.
check_typecache_for_item
Checks if the item is in our can_hold list.
check_weight_class
Checks if the item is allowed into storage based on it's weight class
close_all
Close the storage UI for everyone viewing us.
close_distance
Signal handler for whenever a mob walks away with us, close if they can't reach us.
collect_on_turf
Collects every item of a type on a turf.
@param obj/item/thing the initial object to pick up @param mob/user the user who is picking up the items
contents_for_display
Returns a list of items to display in the hud
dump_content_at
Dumps all of our contents at a specific location.
@param atom/dest_object where to dump to @param mob/user the user who is dumping the contents
generate_hold_desc
Generates a description, primarily for clothing storage.
get_quickdraw_item
Returns an item to pull out with the quickdraw interaction.
get_real_location
Getter for [real_location].
handle_enter
Automatically ran on all object insertions: flag marking and view refreshing.
handle_exit
Automatically ran on all object removals: flag marking and view refreshing.
handle_mass_pickup
Inserts every item in a given list, with a progress bar
@param mob/user the user who is inserting the items @param list/things the list of items to insert @param atom/thing_loc the location of the items (used to make sure an item hasn't moved during pickup) @param list/rejections a list used to make sure we only complain once about an invalid insertion @param datum/progressbar/progress the progressbar used to show the progress of the insertion
hide_contents
Hide our storage from a mob.
@param mob/toshow the mob to hide the storage from
item_insertion_feedback
Provides visual feedback in chat for an item insertion
@param mob/user the user who is inserting the item @param obj/item/thing the item we're inserting @param override skip feedback, only do animation check
mass_empty
Signal handler for remove_all()
on_attack
Signal handler for whenever we're attacked by a mob.
on_attackby
Signal handler for whenever we're attacked by an object.
on_emp_act
Signal handler for the emp_act() of all contents
on_mousedrop_onto
Signal handler for whenever we drag the storage somewhere.
on_mousedropped_onto
Signal handler for whenever something gets mouse-dropped onto us.
on_preattack
Signal handler for preattack from an object.
open_storage
Opens the storage to the mob, showing them the contents to their UI.
open_storage_attackby_secondary
Signal handler for when we get attacked with secondary click by an item.
open_storage_on_signal
Signal handler to open up the storage when we recieve a signal.
orient_item_boxes
Generates the actual UI objects, their location, and alignments whenever we open storage up.
orient_to_hud
Updates the storage UI to fit all objects inside storage.
process_numerical_display
Generates the numbers on an item in storage to show stacking.
put_in_hands_async
Async version of putting something into a mobs hand.
real_location_gone
Signal handler for when the real location is deleted.
refresh_views
Refresh the views of everyone currently viewing the storage.
remove_all
Removes everything inside of our storage
@param atom/target where we're placing the item
remove_and_refresh
Resets an object, removes it from our screen, and refreshes the view.
@param atom/movable/gone the object leaving our storage
remove_type
Removes only a specific type of item from our storage
@param type the type of item to remove @param amount how many we should attempt to pick up at one time @param check_adjacent if TRUE, we'll check adjacent locations for the item type @param force if TRUE, we'll bypass the check_adjacent check all together @param mob/user the user who is removing the items @param list/inserted a list passed to attempt_remove for ultimate removal
reset_item
Refreshes and item to be put back into the real world, out of storage.
return_inv
Recursive proc to get absolutely EVERYTHING inside a storage item, including the contents of inner items.
@param list/interface the list we're adding objects to @param recursive whether or not we're checking inside of inner items
set_parent
Set the passed atom as the parent
set_real_location
Sets where items are physically being stored in the case it shouldn't be on the parent.
@param atom/real the new real location of the datum @param should_drop if TRUE, all the items in the old real location will be dropped
show_contents
Show our storage to a mob.
@param mob/toshow the mob to show the storage to
toggle_collection_mode
Toggles the collectmode of our storage.
@param mob/toshow the mob toggling us
update_actions
Updates the action button for toggling collectmode.