Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor/Public/LevelEditorMenuContext.h
aurel cordonnier a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00

89 lines
2.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "Elements/Framework/TypedElementHandle.h"
#include "LevelEditorMenuContext.generated.h"
class SLevelEditor;
class ILevelEditor;
class UActorComponent;
class SLevelViewport;
class SLevelViewportToolBar;
class FLevelEditorViewportClient;
class UTypedElementSelectionSet;
UCLASS()
class LEVELEDITOR_API ULevelEditorMenuContext : public UObject
{
GENERATED_BODY()
public:
TWeakPtr<SLevelEditor> LevelEditor;
};
/** Enum to describe what a level editor context menu should be built for */
UENUM()
enum class ELevelEditorMenuContext : uint8
{
/** This context menu is applicable to a viewport (limited subset of entries) */
Viewport,
/** This context menu is applicable to the Scene Outliner (disables click-position-based menu items) */
SceneOutliner,
/** This is the replica of the context menu that appears in the main menu bar (lists all entries) */
MainMenu,
};
UCLASS()
class LEVELEDITOR_API ULevelEditorContextMenuContext : public UObject
{
GENERATED_BODY()
public:
TWeakPtr<ILevelEditor> LevelEditor;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
ELevelEditorMenuContext ContextType;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
TObjectPtr<const UTypedElementSelectionSet> CurrentSelection;
/** If the ContextType is Viewport this property can be set to the HitProxy element that triggered the ContextMenu. */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
FTypedElementHandle HitProxyElement;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
FVector CursorWorldLocation;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
TArray<TObjectPtr<UActorComponent>> SelectedComponents;
/** If the ContextType is Viewport this property can be set to the HitProxy actor that triggered the ContextMenu. */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
TObjectPtr<AActor> HitProxyActor = nullptr;
};
UCLASS()
class LEVELEDITOR_API ULevelViewportToolBarContext : public UObject
{
GENERATED_BODY()
public:
TWeakPtr<SLevelViewportToolBar> LevelViewportToolBarWidget;
TWeakPtr<const SLevelViewportToolBar> LevelViewportToolBarWidgetConst;
FLevelEditorViewportClient* GetLevelViewportClient();
};
UCLASS()
class LEVELEDITOR_API UQuickActionMenuContext : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
TObjectPtr<const UTypedElementSelectionSet> CurrentSelection;
};