the finishing touches
Now create "Function" object. This will help us to control events easier.
Add one function "inv_open" for the algorithm, about which I wrote earlier.
When this function is called, we need to reset old data about our actions.
Now go back to the On object clicked "slot" event and do the same as in the screenshot:
And dont forget to call this function in the startup, to create first objects with which you will be working:
And that's all! You just created basic inventory "engine".
Try to play with it: make inventory bigger, add new items, add some visual effects (drag and drop or something) and so on.
If you liked my tutorial I will not deny myself in making additions to it :)
Also, you can check this inventory efficiency here.
Thank you for attention.