// 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 UActorComponent; class SLevelViewport; class SLevelViewportToolBar; class FLevelEditorViewportClient; class UTypedElementSelectionSet; UCLASS() class LEVELEDITOR_API ULevelEditorMenuContext : public UObject { GENERATED_BODY() public: TWeakPtr 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 */ Viewport, /** This context menu is applicable to the Scene Outliner (disables click-position-based menu items) */ SceneOutliner, }; UCLASS() class LEVELEDITOR_API ULevelEditorContextMenuContext : public UObject { GENERATED_BODY() public: TWeakPtr LevelEditor; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu") ELevelEditorMenuContext ContextType; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu") TObjectPtr 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() TArray> SelectedComponents; /** If the ContextType is Viewport this property can be set to the HitProxy actor that triggered the ContextMenu. */ UPROPERTY() TObjectPtr HitProxyActor = nullptr; }; UCLASS() class LEVELEDITOR_API ULevelViewportToolBarContext : public UObject { GENERATED_BODY() public: TWeakPtr LevelViewportToolBarWidget; TWeakPtr LevelViewportToolBarWidgetConst; FLevelEditorViewportClient* GetLevelViewportClient(); }; UCLASS() class LEVELEDITOR_API UQuickActionMenuContext : public UObject { GENERATED_BODY() public: UPROPERTY(Transient) TObjectPtr CurrentSelection; };