storage
Datumized Storage Eliminates the need for custom signals specifically for the storage component, and attaches a storage variable (atom_storage) to every atom. The parent and real_location variables are both weakrefs, so they must be resolved before they can be used. 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 | should we be allowed to pickup an object by clicking it |
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 | shows what we can hold in examine text |
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 |
closer | close button object |
collection_mode | the mode for collection when allow_quick_gather is enabled |
display_contents | If true shows the contents of the storage in open_storage |
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. |
exception_max | if exception_hold is set, how many exception items can we hold at any one time? |
insert_preposition | you put things in a bag, but on a plate |
is_using | list of all the mobs currently viewing the contents |
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 |
parent | the actual item we're attached to |
quickdraw | alt click takes an item out instead of opening up storage |
real_location | the actual item we're storing in |
rustle_sound | play a rustling sound when interacting with the bag |
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 | don't show any chat messages regarding inserting items |
silent_for_user | same as above but only for the user, useful to cut on chat spam without removing feedback for other players |
supports_smart_equip | If we support smartly removing/inserting things from ourselves |
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 Ignores removal do_afters. Only use this if you're doing it as part of a dumping action |
can_insert | Checks if an item is capable of being inserted into the storage |
can_see_contents | Checks who is currently capable of viewing our storage (and is.) |
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. |
dump_content_at | Dumps all of our contents at a specific location. |
exception_count | Returns a count of how many items held due to exception_hold we have |
generate_hold_desc | Generates a description, primarily for clothing storage. |
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 receive 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. |
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_single | Allows a mob to attempt to remove a single item from the storage Allows for hooks into things like removal delays |
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_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
should we be allowed to pickup an object by clicking it
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
shows what we can hold in examine text
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
closer
close button object
collection_mode
the mode for collection when allow_quick_gather is enabled
display_contents
If true shows the contents of the storage in open_storage
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.
exception_max
if exception_hold is set, how many exception items can we hold at any one time?
insert_preposition
you put things in a bag, but on a plate
is_using
list of all the mobs currently viewing the contents
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
parent
the actual item we're attached to
quickdraw
alt click takes an item out instead of opening up storage
real_location
the actual item we're storing in
rustle_sound
play a rustling sound when interacting with the bag
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
don't show any chat messages regarding inserting items
silent_for_user
same as above but only for the user, useful to cut on chat spam without removing feedback for other players
supports_smart_equip
If we support smartly removing/inserting things from ourselves
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 up to a certain level. See [code/__DEFINES/storage.dm]
attempt_remove
Attempts to remove an item from the storage Ignores removal do_afters. Only use this if you're doing it as part of a dumping action
@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
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 up to a certain level. See [code/__DEFINES/storage.dm]
can_see_contents
Checks who is currently capable of viewing our storage (and is.)
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
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
exception_count
Returns a count of how many items held due to exception_hold we have
generate_hold_desc
Generates a description, primarily for clothing storage.
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 receive 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.
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_single
Allows a mob to attempt to remove a single item from the storage Allows for hooks into things like removal delays
@param mob/removing the mob doing the removing @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
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_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
@returns FALSE if the show failed, TRUE otherwise
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.