Need to drive checkbox state change in a widget two levels deep in a WidgetSwitcher

I am building menu system, and have run into an issue. I have created WBP_SettingsMenu, which includes a WidgetSwitch named WidgetSwitcher_Settings. Inside the WidgetSwitcher, I have a widget named WBP_Settings_Graphics, containing a vertical box that holds hold multiple other widgets (a separate one for each graphics setting).

At the top level (WBP_SettingsMenu), I have a “Revert All” button that calls the UE “Revert to Current Settings” function. All of this works great and resets properly, but state of the checkbox inside the individual setting widget (in this case the VSync widget), is not updated along with the reset. I want to somehow force that checkbox to update along with the reset, so it reflects the actual value.

I have not found (event or otherwise) to effect change in that widget. I like the isolated component structure I have now, but need to find a way so that when I am processing on the OnClick event for the “Revert All” button, I can have the widget (3 levels deep), change the state of the checkbox. I will obviously need to do this with the other settings widgets as well, so whatever solution would need to work across them all.

I have included two screenshots (below), as my explanation above may be a bit confusing.

I appreciate any advice anyone may have.

Thanks.


Hello! You could always tackle the problem manually. For the example you’ve provided, on the On Clicked (Button_RevertAll) call, get the WBP_Settings_Graphics widget. From that widget, you should be able to find the VSync checkbox and manually set it depending on the graphics settings. Below is an example of what I mean.

To do this automatically requires a little more effort. I don’t know if it’s worth automating it (I’d have to get my hands on it). Also, let me know if I’ve completely misunderstood!

Rather then having the event set the state of the widget, can’t you just read the current value when the option is visible and set the state of the checkbox then?

You understood my issue, despite my poor description. Thank you. I was hoping to find a way to force the Widget to update its children’s children (or something like that), to avoid having to update each and every control on each widget, but I will likely have to go the route you propose. Thank you very much much. Appreciate that.

@anonymous_user_1627973e. That may work. I was trying to setup a dynamic system where each setting widget was more or less encapsulated. But setting up a data structure that I share between them, may be the next best solution. Thank you for the suggestion.

I kind of like @anonymous_user_1627973e 's solution better. It’s better on performance (but it’s just as much work or more for you). Either way, it looks good—good luck!