lockable_storage
##lockable_storage
Adds a UI to the object that triggers when you use it in hand (if item) or attack (everything else).
The UI is a lock that, when unlocked, allows you to access the contents inside of it.
When using this, make sure you have icons for on_update_icon_state
.
Vars | |
can_hack_open | Boolean on whether the storage can be hacked open with a multitool. |
---|---|
lock_code | The code that will open this safe, set by usually players. Importantly, can be null if there's no password. |
numeric_input | The number currently sitting in the briefcase's panel. |
panel_open | Boolean on whether the panel has been hacked open with a screwdriver. |
Procs | |
hack_open | Does a do_after to hack the storage open, takes a long time cause idk. |
on_examine | Called when examining the storage item. |
on_interact | Called when interacted with in-hand or on attack, opens the UI. |
on_multitool_act | Called when a multitool is used on the parent, if it's hackable. Checks if we can start hacking and, if so, will begin the hacking process. |
on_requesting_context_from_item | Adds context screentips to the locked item. Arguments: |
on_screwdriver_act | Called when a screwdriver is used on the parent, if it's hackable. |
on_update_icon_state | Updates the icon state depending on if we're locked or not. |
Var Details
can_hack_open
Boolean on whether the storage can be hacked open with a multitool.
lock_code
The code that will open this safe, set by usually players. Importantly, can be null if there's no password.
numeric_input
The number currently sitting in the briefcase's panel.
panel_open
Boolean on whether the panel has been hacked open with a screwdriver.
Proc Details
hack_open
Does a do_after to hack the storage open, takes a long time cause idk.
on_examine
Called when examining the storage item.
on_interact
Called when interacted with in-hand or on attack, opens the UI.
on_multitool_act
Called when a multitool is used on the parent, if it's hackable. Checks if we can start hacking and, if so, will begin the hacking process.
on_requesting_context_from_item
Adds context screentips to the locked item. Arguments:
- source - The item that will display its screentip
- context - The list of context that will be displayed. We add onto this list for it to show up.
- held_item - The item in your hand, which in this case should be a screwdriver or multitool, if necessary.
- user - The user who is going to see the screentips.
on_screwdriver_act
Called when a screwdriver is used on the parent, if it's hackable.
on_update_icon_state
Updates the icon state depending on if we're locked or not.