fael097
(fael097)
April 23, 2021, 7:55pm
1
I’m implementing a simple save/load game functionality, and this is what I have so far:
It does display the correct number of save game entries, but there’s no data on them, and they don’t do anything. This is what it looks right now:
So how do I retrieve data from each entry, to display on those buttons?
fael097
(fael097)
April 23, 2021, 10:45pm
2
Here’s a small update, I’ve added functionality to save a user input string as savegame name, so it can be displayed in the savegame list later, but I still can’t dynamically generate a list of savegame entries, my issue persists.
I have a loop to add children to the savegame list, but I can’t get or send savegame ID to that widget to retrieve the savegame name from each different entry
How can I do so?
Everynone
(Everynone)
April 23, 2021, 11:12pm
3
There are many, may ways of piping the data into the widget.
Have a custom event in the widget taking your save game data (or just variables that you need):
And call it after creating the widget:
Alternatively, expose the save game (or pertinent data) in the widget:
Use the extra node pin to pipe in the data.
The widget can configure itself using it.
1 Like
fael097
(fael097)
April 24, 2021, 3:31am
4
I used the exposed variable and it works great, thank you
now, I wanted to do the opposite and from the child widget button, send a custom event to my main widget to load a save, however it won’t work.
any workarounds?
Everynone
(Everynone)
April 24, 2021, 7:03am
5
Create a dispatcher with Save Data input and call it onClick above. When the main widget creates save game widgets, bind their calls.
And that’s not even a workaround, that’s like the proper way to do it.