— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
This is an old revision of the document!
A shop item slot is a widget element for allowing an item to be purchased by the player. The cost of the item is configured in the Item Editor.
Icon | Property | Description |
---|---|---|
Element ID | ID for the shop item slot. This ID must be unique amongst other elements within the same widget. It is currently auto-generated but will be editable in a future update. |
You can access certain properties of an shop item 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 “test”, and the equipment slot has an ID of “0001”. If the slot is empty, its “item” property will be null.
Retrieving the item data for a shop item slot:
$item_id = widget["test"].element["0001"].item.id; $item_count = widget["test"].element["0001"].item.count
Checking if an item exists in a shop item slot:
if widget["test"].element["0001"].item == null then display_message("There isn't an item in this slot.") end