Okay I managed to get some actual progress !!!
for your question, I had the menu hold a submenu page.
The Inventory was a submenu page and I think because of that it did not update properly.
I decided to just carry the code from the inventory submenu page over to the main in-game menu page and have it update the inventory submenu page from there.
This was the setup I got based on the tutorial:
And here is the In-game menu widget setup; this one is more makeshift, and loosely based on several other tutorials:
I had a feeling with the layers of widgets put up updating the UI information wouldn’t happen as fast as expected if at all.
So elements were being added / inserted into the array, but what information did the elements contain? sadly nothing.
Next was to update the elements of the UI inventory from the inventory component and the base items and containers.
Basically the inventory component is an actor component, and that function for adding to inventory would house the functioning for any item that uses that function. ie if the base item is being collected, it will tell the actor component to perform the function of adding the item to the player inventory and set the elements based on the details of the item itself.
The setup went as followed:
Basically both the item and Container share the same function of collecting items, don’t worry, they don’t both perform it at the same time
(Not that important): Get component of class was attached to another add to inventory function that was from the tutorial series. After the progress I was making I wanted to see if my setup was in some way compatible with tutorials’ design and it wasn’t, so I stuck with what I got for now.
NOTE: I noticed the item appears twice in my inventory; not sure why. The only thing I can thing of is that the function of setting array elements is being called more than once somewhere or there is an extra loop being run somewhere.
Another issue is that the items repeat. By this I mean that every item in the inventory is the same one item.
I’m not really sure what may cause this one …
This is in game capture, before the function:
Now there are only two items present in this menu:
The following is the after; as you can see, the items from the container are in the inventory, however, sometime they will repeat, and it’s only after a second or third press of the button:
Edit: Wouldn’t you know it I just managed to fix the repeated items issue!: So in the main tutorial I just plugged in the index into the Get of code I put in the in-game menu:
(This is where the setup separates itself from the other one).
I am so very close to completing this; All that’s left is the repeating of the items, and then other features like stacking items and adding items for crafting, and removing them.
ONE LAST NOTE I SWEAR FR THIS TIME: Okay so the items do appear, the function does are being carried over to the array/ list. however, the items still repeat, and despite there being nothing in the items’ array list, the action can still repeat, creating an infinite number of entries in the inventory list. Aside from that, there is also the items not appearing until the proper input is pressed another few more times.