2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __LevelViewportContextMenu_h__
|
|
|
|
|
#define __LevelViewportContextMenu_h__
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2014-04-23 17:50:29 -04:00
|
|
|
/** Enum to describe what a menu should be built for */
|
|
|
|
|
enum class LevelEditorMenuContext
|
|
|
|
|
{
|
|
|
|
|
/** This context menu is applicable to a viewport */
|
|
|
|
|
Viewport,
|
|
|
|
|
/** This context menu is applicable to an external UI or dialog (disables click-position-based menu items) */
|
|
|
|
|
NonViewport,
|
|
|
|
|
};
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
2014-04-23 17:50:29 -04:00
|
|
|
* Context menu construction class
|
2014-03-14 14:13:41 -04:00
|
|
|
*/
|
2014-04-23 17:50:29 -04:00
|
|
|
class FLevelEditorContextMenu
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Summons the level viewport context menu
|
2014-04-23 17:50:29 -04:00
|
|
|
* @param LevelEditor The level editor using this menu.
|
|
|
|
|
* @param ContextType The context we should use to specialize this menu
|
2014-03-14 14:13:41 -04:00
|
|
|
*/
|
2014-04-23 17:50:29 -04:00
|
|
|
static void SummonMenu( const TSharedRef< class SLevelEditor >& LevelEditor, LevelEditorMenuContext ContextType );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a widget for the context menu that can be inserted into a pop-up window
|
|
|
|
|
*
|
|
|
|
|
* @param LevelEditor The level editor using this menu.
|
2014-04-23 17:50:29 -04:00
|
|
|
* @param ContextType The context we should use to specialize this menu
|
2014-03-14 14:13:41 -04:00
|
|
|
* @param Extender Allows extension of this menu based on context.
|
|
|
|
|
* @return Widget for this context menu
|
|
|
|
|
*/
|
2014-04-23 17:50:29 -04:00
|
|
|
static TSharedPtr< SWidget > BuildMenuWidget(TWeakPtr< SLevelEditor > LevelEditor, LevelEditorMenuContext ContextType, TSharedPtr<FExtender> Extender = TSharedPtr<FExtender>());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-04-23 16:39:22 -04:00
|
|
|
/**
|
|
|
|
|
* Populates the specified menu builder for the context menu that can be inserted into a pop-up window
|
|
|
|
|
*
|
|
|
|
|
* @param MenuBuilder The menu builder to fill the menu with
|
|
|
|
|
* @param LevelEditor The level editor using this menu.
|
2014-04-23 17:50:29 -04:00
|
|
|
* @param ContextType The context we should use to specialize this menu
|
2014-04-23 16:39:22 -04:00
|
|
|
* @param Extender Allows extension of this menu based on context.
|
|
|
|
|
*/
|
2014-04-23 17:50:29 -04:00
|
|
|
static void FillMenu(FMenuBuilder& MenuBuilder, TWeakPtr< SLevelEditor > LevelEditor, LevelEditorMenuContext ContextType, TSharedPtr<FExtender> Extender);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Builds the actor group menu
|
|
|
|
|
*
|
|
|
|
|
* @param MenuBuilder The menu builder to add items to.
|
|
|
|
|
* @param SelectedActorInfo Information about the selected actors.
|
|
|
|
|
*/
|
|
|
|
|
static void BuildGroupMenu( FMenuBuilder& MenuBuilder, const struct FSelectedActorInfo& SelectedActorInfo );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // __LevelViewportContextMenu_h__
|