Shopping Widget

You need to make an intermediate storage for the items you want to sell.

Add to the widget (but strictly speaking it is better to create an additional actor that will do all the work, especially if you are planning a multiplayer mode) another variable map Name-Int, where the items from the inventory will be moved, and another Vertical Box.

In the item widget, override the On Mouse Button Double Click function.


Connect this to the Return Node to avoid the compilation warning.

In it, you need to remove one item from your inventory, and add this item to the intermediate storage. Then you need to refill both Vertical Boxes (for items in the inventory, and for items for sale).
Now, when you click the “Sell” button, you need to run a Loop on your intermediate variable, and calculate how much gold you should receive, and add it to your account.

Note that in this case, using only Name as an object identifier will not be enough.
You will need to create a structure that will contain a Reference to the Data Table and a Name.