UE5: Prevent Menu Anchor creating new Window

Table of Contents

Small but useful tip:
Somewhere along the parent hierachy of the Menu Anchor, one of the Parent’s should override OnQueryPopupMethod and reply with CurrentWindow:



				
						/**
	 * Popups can manifest in a NEW OS WINDOW or via an OVERLAY in an existing window.
	 * This can be set explicitly on SMenuAnchor, or can be determined by a scoping widget.
	 * A scoping widget can reply to OnQueryPopupMethod() to drive all its descendants'
	 * poup methods.
	 *
	 * e.g. Fullscreen games cannot summon a new window, so game SViewports will reply with
	 *      EPopupMethod::UserCurrentWindow. This makes all the menu anchors within them
	 *      use the current window.
	 */
	virtual FPopupMethodReply OnQueryPopupMethod() const override
	{
	    //EG:
	    return FPopupMethodReply::UseMethod(EPopupMethod::UseCurrentWindow);
	}
				
			
5/5

Gamechanger plugin for notehighway rhythm games and music visualizers

5/5

Add Text and 2D UMG widgets to Level Sequences

5/5

Simplify your Plugin Development with the Unreal Projects Manager

5/5

Learn how to create unreal engine plugins from scratch and sell them on Fab.com.