This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
item_storage_slot [2020/12/02 11:54] – justin | item_storage_slot [2024/02/18 21:45] (current) – justin | ||
---|---|---|---|
Line 3: | Line 3: | ||
An **item storage slot** is a [[widget]] element for storing an [[item]] or stack of [[item|items]]. This is useful for [[inventory]] windows, [[item container]] windows, or other [[widget|widgets]] that are meant for storing [[item|items]] into for later retrieval and usage. | An **item storage slot** is a [[widget]] element for storing an [[item]] or stack of [[item|items]]. This is useful for [[inventory]] windows, [[item container]] windows, or other [[widget|widgets]] that are meant for storing [[item|items]] into for later retrieval and usage. | ||
+ | |||
+ | <WRAP center round info 100%> | ||
+ | When left-clicking to remove an [[item]] from a storage slot that is stacked, you can hold down the Control key to pick up only one of the [[item]] instead of the entire stack. | ||
+ | </ | ||
=====Element Properties===== | =====Element Properties===== | ||
Line 9: | Line 13: | ||
=====Scripting===== | =====Scripting===== | ||
- | You can access | + | You can access certain properties of an item storage slot from a [[script]] by simply referencing the parent [[widget]] and the element by their unique IDs. See below for examples of retrieving |
+ | |||
+ | **Retrieving the item data for an item storage slot:** | ||
+ | <code bauxite> | ||
+ | $item_id = widget[" | ||
+ | $item_count = widget[" | ||
+ | </ | ||
- | **Changing | + | **Changing |
<code bauxite> | <code bauxite> | ||
- | widget[" | + | widget[" |
</ | </ | ||
- | **Changing | + | **Changing |
<code bauxite> | <code bauxite> | ||
- | widget[" | + | widget[" |
</ | </ | ||
- | **Changing a button' | + | **Checking if an item exists in an item storage slot:** |
<code bauxite> | <code bauxite> | ||
- | widget[" | + | if widget[" |
+ | | ||
+ | end | ||
</ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ |