The easiest solution is, to set the Focusable Switch of the Widget to false, and only make the Slots focusable.
This prevents the Game from giving the Widget itself focus anyway…
The next is, that you delay the construct… Don’t do that… It is not important.
What you want to do is, to Force a Prepass here… So the Widgets Contents get a wake up call.
I would recomment not to do this stuff in the construct anyways… Ryan is doing some of that… yes… But it makes more problems later, especially when it comes to updates of slots in a dragdrop operation… I’ve done his Tuts around 20 times… And build my own system with the knowledge of Errors, Problems and Solutions i learned of that time…
So… Here are my Top 3 Tier List of “Things to not do like Ryan”:
1st: Splitting Structs.
Never ever in the Future do Struct Splitting!! It’s the Devil or worse!! Always use Breaks!
You can still split Vectors and such… But not custom made Structs…!
The Reason is, that the Reflection of a split on a struct can not be updated properly. I dunno why… Perhaps it is caused of shifting of the pink or such…
If you update a strict later… The split won’t update correctly… And you get a hell ton of errors to fix those splits…
So… Breaks are of no problem here… Do Breaks!!
2nd: Push all Widget initialisation into Construct.
You can push setText, setValue and such there… But step away from doing reference, cast and other stuff via the Construct Event. Always create a Custom Event or Function, that you can call when it really is needed! This prevents of Ref and cast errors, caused by not valid objects.
3rd: Keeps it as it is.
On my 3rd run of his tuts, i realized that many things he is doing, are just a waste of memory, operations or performance.
Yes… Really… He is very very skilled… But that doesn’t mean you can’t do things better. His Tuts are just a Hint on how to start… Not the ready Procuct.
The Reason to catch those Tuts is not to copy them 1:1 to your Project, but to learn how one guy is doing this for his one Situation and Needings.
To the Problem:
When toggling an Inventory to be visible, you set the Game Input Mode to UI. That’s OK.
You really should set the first slot of this inventory as “In Widget to Focus”.
This will automatically set the first slot as focused to interact with it via Gamepad.
If you followed Ryan’s Tuts, the way to get the first slot is simply:
Get Inventory Component > Get Inventory Widget > Get Grid Box > get children > first > get widget