I have some controls which aren’t attached to parameters but which I’d like to return to their default states when the user hits my plugin’s Reset button. I’ve currently implemented this with the following line:
GetUI()->GetControlWithTag(MyControlTag)->SetValue(MyDefaultValue);
However, the proper execution of this line hinges upon GetUI()
not returning nullptr
. I do have a conditional statement to check that the UI pointer is not null, and it’s probably impossible anyway for the reset function (which is triggered by user input) to execute without the UI being visible, but for other use-cases, I was hoping that there’s some function that would allow me to set a control’s value regardless of whether the UI is visible or not, or at least put the request to change the value in a queue, to be executed once the UI is displayed. Is there a better way to go about this? Thanks!