Custom button widget A updated after clicking on a button from widget B

Hello !

I need your help on a project ! :smiley:

I spent days on it, and I cannot find a solution.

What I want:

  • I have a widget A, with 3 buttons.
  • Each button of the widget A has the face of the characters I can play with (it is a crew of 3 characters and I can switch from one to another)
  • I have a widget B, with many buttons.
  • Each button of widget B has the face of characters that I can select to be part of the playable crew that is shown on widget A. (So playable character indicated on widget A depend on the one selected from widget B)
  • Therefore, after I quit the widget B, the 3 buttons on widget A should be updated to show the faces of the character selected to be part of the crew, thanks to widget B.

The problem:

It is the last step. Right now, after selecting on widget B the characters to be part of my crew, the pictures do not update.
As an example : I first played with characters 1, 2 and 3. Then I wanted to change the crew, so I opened widget B, replaced everyone by characters 4, 5 and 6. But when I close widget B, the pictures still show the faces of character 1, 2 and 3 instead of 4, 5 and 6.

Does anyone have a solution to update the pictures (including the style for normal, hovered and pressed) ?

Little bonus, I am not using normal buttons, but custom ones, as shown here : Buttons can only be rectangular?

So a compatible solution to these buttons would be the best ha ha !

Thank you in advance ! I really need your help :smiley:

you need to get a reference to widget A, then get a reference to the image slots. im assuming you make widget B inside widget A, so you should be able to get a reference to widget A really easily if thats the case.
update those 3 from the corresponding pictures in your Widget B. its probably a good idea to update them at the same time as you update widget B.

if you are still confused, i can remake your setup, but its a bit of a pain and pollutes my current project with widgets ill have to delete after.

Hello !

Thank you for your feedback.

I think I have already tried this, but it did not really work as I wanted, as it was not automatically updating the pictures.

What I had if I remember correclty was:

  1. Buttons from widget B were setting variables in widget B
  2. Buttons pictures of widget A were linked to the variables from widget B. (Lot of branch with condition like "variable = … / true then / false then. And each brench was setting pictures)

My problem is that the event defining and updating the pictures was not running automatically. But I know it was working as I used a keyboard event to run it manually and it was updating the pictures.

Any idea on how to run it automatically ?

I was thinking at some point that the best way would be that when I click on a button from widget B it called the uptaded event from widget A, but I did not succeed :confused:

Update:

I did it again. And it seems that it is not compatible with the custom button.

I tried the method (using a event dispatcher to call the update) and it works but only for UE5 standard button, not the custom one.

Any idea ?