Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor/Private/LevelEditorContextMenu.h
jamie dale 0f54e84773 Minimal context menu for static mesh instance elements
Currently only delete and delta transform are enabled/available

#rb Brooke.Hubert

#ROBOMERGE-SOURCE: CL 15631470 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v777-15581079)

[CL 15631487 by jamie dale in ue5-main branch]
2021-03-05 20:06:48 -04:00

82 lines
3.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Editor/UnrealEdTypes.h"
#include "LevelEditorMenuContext.h"
class FExtender;
class UToolMenu;
class UTypedElementSelectionSet;
struct FToolMenuContext;
class SLevelEditor;
class SWidget;
/**
* Context menu construction class
*/
class FLevelEditorContextMenu
{
public:
/**
* Summons the level viewport context menu
* @param LevelEditor The level editor using this menu.
* @param ContextType The context we should use to specialize this menu
* @param HitProxyActor The hitproxy actor in the case the ContextType is Viewport
*/
static void SummonMenu( const TSharedRef< class SLevelEditor >& LevelEditor, ELevelEditorMenuContext ContextType, const FTypedElementHandle& HitProxyElement = FTypedElementHandle());
/**
* Summons the viewport view option menu
* @param LevelEditor The level editor using this menu.
*/
static void SummonViewOptionMenu( const TSharedRef< class SLevelEditor >& LevelEditor, const ELevelViewportType ViewOption );
/**
* Creates a widget for the context menu that can be inserted into a pop-up window
*
* @param LevelEditor The level editor using this menu.
* @param ContextType The context we should use to specialize this menu
* @param Extender Allows extension of this menu based on context.
* @param HitProxyActor The hitproxy actor in the case the ContextType is Viewport
* @return Widget for this context menu
*/
static TSharedPtr< SWidget > BuildMenuWidget(TWeakPtr< SLevelEditor > LevelEditor, ELevelEditorMenuContext ContextType, TSharedPtr<FExtender> Extender = TSharedPtr<FExtender>(), const FTypedElementHandle& HitProxyElement = FTypedElementHandle());
/**
* Populates the specified menu builder for the context menu that can be inserted into a pop-up window
*
* @param Menu The menu to fill
* @param LevelEditor The level editor using this menu.
* @param ContextType The context we should use to specialize this menu
* @param Extender Allows extension of this menu based on context.
* @param HitProxyActor The hitproxy actor in the case the ContextType is Viewport
*/
static UToolMenu* GenerateMenu(TWeakPtr< SLevelEditor > LevelEditor, ELevelEditorMenuContext ContextType, TSharedPtr<FExtender> Extender = TSharedPtr<FExtender>(), const FTypedElementHandle& HitProxyElement = FTypedElementHandle());
/* Adds required information to Context for build menu based on current selection */
static FName InitMenuContext(FToolMenuContext& Context, TWeakPtr<SLevelEditor> LevelEditor, ELevelEditorMenuContext ContextType, const FTypedElementHandle& HitProxyElement = FTypedElementHandle());
/* Returns name of menu to display based on current selection */
static FName GetContextMenuName(ELevelEditorMenuContext ContextType, const UTypedElementSelectionSet* InSelectionSet);
private:
static void RegisterComponentContextMenu();
static void RegisterActorContextMenu();
static void RegisterElementContextMenu();
static void RegisterSceneOutlinerContextMenu();
static void RegisterEmptySelectionContextMenu();
/**
* Builds the actor group menu
*
* @param Menu The menu to add items to.
* @param SelectedActorInfo Information about the selected actors.
*/
static void BuildGroupMenu(UToolMenu* Menu, const struct FSelectedActorInfo& SelectedActorInfo);
};