This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
item_storage_slot [2020/11/30 20:29] – justin | item_storage_slot [2023/05/23 17:54] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
=====Element Properties===== | =====Element Properties===== | ||
^Icon^Property^Description^ | ^Icon^Property^Description^ | ||
+ | |{{: | ||
=====Scripting===== | =====Scripting===== | ||
+ | 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 the slot's [[item]]. In this case, we are assuming that the slot currently contains an [[item]], the [[widget]] has an ID of " | ||
- | (WIP - Accessing/changing properties of the element | + | **Retrieving the item data for an item storage slot:** |
+ | <code bauxite> | ||
+ | $item_id = widget[" | ||
+ | $item_count = widget[" | ||
+ | </code> | ||
+ | |||
+ | **Changing | ||
+ | <code bauxite> | ||
+ | widget[" | ||
+ | </ | ||
+ | |||
+ | **Changing the count of an item in an item storage slot:** | ||
+ | <code bauxite> | ||
+ | widget[" | ||
+ | </ | ||
+ | |||
+ | **Checking if an item exists in an item storage slot:** | ||
+ | <code bauxite> | ||
+ | if widget[" | ||
+ | | ||
+ | end | ||
+ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ |