Finishing the inventory screen

Navigate to the Pause_Inventory Event Graph. While Context Sensitive is off, bring in the Get Array Item from the Actions window by navigating to Class | Field Player:

Finishing the inventory screen

Once done, connect the Target pin of Array Item to GET so that you can get every item that is sent to that array once we populate the array in the Items Blueprint:

Finishing the inventory screen

Now that we have the array of items in the player's inventory, we will now loop through each element, and create an item from every element in the array. To do this, create a ForEachLoop by navigating to Utilities | Array. Link Array Item from your arrayItem variable to the Array tab in the ForEachLoop. Then, have SET Inventory Screen activate the ForEachLoop:

Finishing the inventory screen

Just like what we did when populating the buttons for the shop, we would want this for loop to be responsible for adding buttons from the Items Widget Blueprint. So, in the body of the for loop, we need to create the Item widget by first navigating to User Interface | Create Widget in the Actions window:

Finishing the inventory screen

Then, we need to change the Class dropdown to Item, and link it to Loop Body in the ForEachLoop:

Finishing the inventory screen

You will then need to set the text for each element in the array. So, open the Actions window and with Context Sensitive off, bring in Set Item by navigating to Class | Item.

Link the Item pin to the Array Element pin from the ForEachLoop. Then, set the Target pin of Set Item to the Return Value of Create Item Widget and have Create Item Widget activate the Set Item:

Finishing the inventory screen

Lastly, we will need to add the Item widget to the Scroll Box that we created in Pause_Inventory. Simply create an Add Child node that is located at Panels under Widget. Then, link ScrollBox_Inventory from your variables to the Target pin of Add Child (if you do not see ScrollBox_Inventory as a default variable, make sure you go back into the Designer View of Pause_Inventory, select the ScrollBox_Inventory, and check is variable, then have the Content pin of Add Child be the Return Value of Create Item Widget). Finally, have the Set Item node start up the Add Child node:

Finishing the inventory screen

When you are done, your Pause_Inventory Blueprint will look like this:

Finishing the inventory screen
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.156.235