This shows you the differences between two versions of the page.
item_slot [2023/05/23 17:54] – created justin | item_slot [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Item Storage Slot====== | ||
- | ---- | ||
- | 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. | ||
- | |||
- | =====Element Properties===== | ||
- | ^Icon^Property^Description^ | ||
- | |{{: | ||
- | |||
- | =====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 " | ||
- | |||
- | **Retrieving the item data for an item storage slot:** | ||
- | <code bauxite> | ||
- | $item_id = widget[" | ||
- | $item_count = widget[" | ||
- | </ | ||
- | |||
- | **Changing the item in an item storage slot:** | ||
- | <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~~ |