How to best share custom settings widget with main menu and in-game

I have created a new custom User Widget in UMG to display and manage game settings. and I want to use that same widget from the main menu, and from in-game. I assume that in order to do this, I need to obtain a reference to the active widget (if there is one), and restore it when the setting widget is removed.

I have created a new level for the main menu, and loaded the main menu in the level blueprint. Because it looks hideous to leave the main menu in background (even when blurred), I am removing it while the setting menu is displayed. I suppose I could set the visibility instead, but either way, I need a reference to the widget in order to do so. Because I am loading the main menu in the level blueprint, I have not found a good way to save a reference to the main menu when I first create it.

Here is an illustration of the desired workflow.

Wondering if anyone has any advice on how best to structure this type of workflow? I have found plenty of examples online, but most of them only address opening the settings widget from the main menu, or in-game, not both.

Any advice is appreciated.

Thanks.

I realized my post is rather confusing. Thought I would simplify it a bit.

I have a UMG settings widget that I would like to share in my main menu, and in-game. What is the best way to achieve this? The issue I am running into, is how to return to the previous widget when the settings widget is closed. Because the main menu is loaded by the Level Blueprint, I do not have a reference to it to return to when settings is closed.

If anyone has any advice on how to best handle this, I would appreciate it.

If you need to preserve data across level changes, the Game Instance should be helpful for you. Storing data in the Game Instance will survive level changes

Great suggestion. I will look into it. Thank you very much.