Tips for switching between widgets?

Say I have a few widgets open at once. How do I swap between them correctly while not recreating the widgets every time, and all the “data” on each one is safe from being erased?

There’s so many ways you can go about this!

A few off the top of my head: Sending the data to either the player, Player Controller or Game state and loading it everytime, Using a master BP to tell the game which Widget should be in focus [If using multiple UMGs] (Or by using “Set Input Mode”)

I haven’t tried this, but maybe changing the widgets zOrder in Blueprints might be the answer you’re looking for.

Tried using the “Set Input Mode” thing in my main menu widget to make the options menu widget come into focus (used the button for my options as the OnClicked button), and it didn’t work :confused:

FYI I would prefer if all the widgets were open (they never close and I didn’t have to recreate them every time I wanted to see them) and everything stayed where it was, but if it’s more that much more complicated versus just storing variables, I will just go with storing variables.
Basically, I want to go from Menu A to Menu B, change some stuff in Menu B, go back to Menu A, and then go back again to Menu B and everything is the same.

Edit: I think I’ve done it. For each Menu I simply say after you press the button leading to the other menu, remove the current widget from the parent and add the other one to the viewport (I get the other widget through GetAllWidgetsofClass). Everything seems to work fine now.

Update: I thought my system would work well with just swapping between widgets without changing anything, but now I know it doesn’t work so well. I set my Options Menu up so that when it is created, it checks off two boxes by default (as any normal game would do), and I set up my Main Menu widget so that I thought that it wouldn’t create a new Options Menu each time, but just put the one that already exists on the front of the screen (see my Blueprinting below). Except now every time it Adds it to the viewport (not creating the widget, just Adding it to Viewport), it checks the top two boxes again, and even leaves my old checkboxes the way they were. Any help?