ToneGodGui get inventory element

I followed a tutorial using tonegodgui and created an inventory of 40 elements which I am using as my slots. During creation, I set the text of the element to “empty”. What I want to do is click on an item, and then check which slot is empty and add the item to that slot. Is there a method to do this using tonegodgui? Or do I have to create a separate array for the slots and loop through the array looking for the first empty slot?

As far I know you gona need to code it. But, if you are sure you have only 40 slots you could use a table and it should be pretty easy. Like Boolean[40] and set at the value if its occupy or not,

Hm I see a design problem here,
you mix your model and your view.

Your data classes should already know everything, and just use the gui for display and interaction.

Basically can you inventory work without any visual components if you add a few console commands? If not you have a unclean design.