User Tools

Site Tools


shop_item_slot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
shop_item_slot [2020/12/02 18:31] justinshop_item_slot [2022/05/11 15:59] justin
Line 7: Line 7:
 ^Icon^Property^Description^ ^Icon^Property^Description^
 |{{:wiki:tag_id.png?nolink|}}|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.| |{{:wiki:tag_id.png?nolink|}}|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.|
 +|{{:wiki:item.png?nolink|}}|Item|[[Item]] that will be available for purchase from this slot.|
 +|{{:wiki:item_stack.png?nolink|}}|Count|How many of the [[item]] that will be available for purchase (0 = unlimited).|
  
 =====Scripting===== =====Scripting=====
-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.+You can access certain properties of 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 shop item 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:** **Retrieving the item data for a shop item slot:**
Line 15: Line 17:
 $item_id = widget["test"].element["0001"].item.id; $item_id = widget["test"].element["0001"].item.id;
 $item_count = widget["test"].element["0001"].item.count $item_count = widget["test"].element["0001"].item.count
 +</code>
 +
 +**Setting the item's cost for a shop item slot:**
 +<code bauxite>
 +widget["test"].element["0001"].cost = 100;
 </code> </code>
  
shop_item_slot.txt · Last modified: 2022/05/11 16:00 by justin