I know how to add buttons to existing (marked as variable) vertical or horizontal box. However, how to create horizontal box with blueprint and then add it to vertical box?
Whole idea is to add few buttons to horizontal box and then add that new horizontal box to vertical box. Specifically I need this to list saved games where one button is save name and another button to delete that save and there could be many saves.
You can just create premade widget with buttons, set them and then add them to the list.
I did this, but now I have issue with propagating variables. For example:
Save game widget:
How it looks:
Blueprint that sets variables in Create Widget:
FileItem widget:

Variables:
Blueprint:
Actual button:

Variables:
Blueprint:
Button’s title was replaced until I added SaveItem (basically horizontal box with two buttons) widget.
Parent of CUI_FileItem widget
Did I use wrong parent widget?
Ok, let me guess, you don’t know how to get file name on click.
On BTN_Filename Clicked! event suppose to trigger save game event, on BTN_Delete, it triggers save file deletion. Funny enough, deletion works and it has correct file name which is set in buttonText. This is how deletion event is binded:
Same BTN_Filename button is used directly in load game widget and it works perfectly:
My issue is unchanged button title when using widget with horizontal box.
So what is the problem exactly?
If you look on Save widget screenshot, you will see 4 buttons with Test
titles. When they suppose to be the same as on load widget: ship1
, ship2
, ship3
and ship4
Are they named ship1.sav, ship2.sav and so on?
Right, there are 4 files: ship1.sav, ship2.sav, ship3.sav and ship4.sav and blueprint of save and load widgets lists those files with button per file. Each button suppose to change its title to filename.
Try this:
Instead of using construct use bind.
Go to layout, to your text. There should be “bind”. Use it.
I spoke too soon, it seems to work. Let me check more.
I removed setvariable from button blueprint, now it works in game but does not work in editor:
Updated button blueprint:
In Editor:
In PIE:
I guess, I can live with it for now, but it would be nice to find why is this strange behavior.
Two constructs run in parallel. The text is set before the variable is set.
And bind works on tick, so it won’t work in editor.
Thank you for your help! I marked this question as solved.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.