Widget Blueprint Button Enable

I’m looking for a better method to activate and deactivate the buttons. I want to deactivate by pressing one button and this means that the option is selected but to be activated by pressing another option.
here is a link to my temporary solution.

My suggestion would be to think about using arrays.

One option would be during OnConstruct you build your own array of all those related buttons and then use a ForEach node to enable them all before disabling the one that was just clicked.

Another option assumes they are all child widgets of the same parent widget since in that case you don’t need to build your own array but could ForEach over the children of that parent widget. The possible downside here is that you either assume everything is meant to be enabled/disabled or you need some way to skip children. It’s not a terrible assumption to make though since both the layout and this logic are part of the same data.

There are a few other things you could do that would provide some small improvements, but treating those buttons as a collection will provide the biggest and most dramatic improvement to that graph.

1 Like

Thank you for the info.At the end went with Enums.

here is my new graph this is the Function.

and in action.

thank you for thq quick respons have nice day

That’s an improvement for sure, but it’s still going to be a maintenance problem.

Compare to this:

Setting up the array can be an issue, but if each row of buttons are children of the same container you can just grab the array from that widget instead of keeping it yourself.

Something to think about.

Oh, another option would be to swap completely to a different widget type. The drop down inherently functions this way to select a single option from a group. No special functionality needed.

1 Like

Will try for shure Thank you

Cool i se now how i can disable many buttons from the start orclicking particular one thank you for the help.
PS: did not find the Drop down that you are referring to.