2019-12-26 15:33:43 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2019-09-10 11:35:20 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "UObject/Object.h"
|
2021-03-05 20:06:48 -04:00
|
|
|
#include "Elements/Framework/TypedElementHandle.h"
|
2019-09-10 11:35:20 -04:00
|
|
|
|
|
|
|
|
#include "LevelEditorMenuContext.generated.h"
|
|
|
|
|
|
|
|
|
|
class SLevelEditor;
|
2021-09-28 17:41:37 -04:00
|
|
|
class ILevelEditor;
|
2019-09-10 11:35:20 -04:00
|
|
|
class UActorComponent;
|
2020-02-18 15:40:24 -05:00
|
|
|
class SLevelViewport;
|
|
|
|
|
class SLevelViewportToolBar;
|
2020-03-18 12:29:22 -04:00
|
|
|
class FLevelEditorViewportClient;
|
2021-01-11 09:19:43 -04:00
|
|
|
class UTypedElementSelectionSet;
|
2019-09-10 11:35:20 -04:00
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
|
class LEVELEDITOR_API ULevelEditorMenuContext : public UObject
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
|
|
|
|
TWeakPtr<SLevelEditor> LevelEditor;
|
|
|
|
|
};
|
|
|
|
|
|
2020-08-11 01:36:57 -04:00
|
|
|
|
2019-09-10 11:35:20 -04:00
|
|
|
/** Enum to describe what a level editor context menu should be built for */
|
2021-06-16 14:16:49 -04:00
|
|
|
UENUM()
|
|
|
|
|
enum class ELevelEditorMenuContext : uint8
|
2019-09-10 11:35:20 -04:00
|
|
|
{
|
2021-09-28 17:41:37 -04:00
|
|
|
/** This context menu is applicable to a viewport (limited subset of entries) */
|
2019-09-10 11:35:20 -04:00
|
|
|
Viewport,
|
|
|
|
|
/** This context menu is applicable to the Scene Outliner (disables click-position-based menu items) */
|
|
|
|
|
SceneOutliner,
|
2021-09-28 17:41:37 -04:00
|
|
|
/** This is the replica of the context menu that appears in the main menu bar (lists all entries) */
|
|
|
|
|
MainMenu,
|
2019-09-10 11:35:20 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
|
class LEVELEDITOR_API ULevelEditorContextMenuContext : public UObject
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
2021-09-28 17:41:37 -04:00
|
|
|
TWeakPtr<ILevelEditor> LevelEditor;
|
2021-03-05 20:06:48 -04:00
|
|
|
|
2021-06-16 14:16:49 -04:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
|
2019-09-10 11:35:20 -04:00
|
|
|
ELevelEditorMenuContext ContextType;
|
2020-08-11 01:36:57 -04:00
|
|
|
|
2021-03-05 20:06:48 -04:00
|
|
|
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. */
|
|
|
|
|
FTypedElementHandle HitProxyElement;
|
|
|
|
|
|
2021-06-16 14:16:49 -04:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
|
|
|
|
|
FVector CursorWorldLocation;
|
|
|
|
|
|
2021-10-27 15:14:40 -04:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
|
2021-01-27 17:40:25 -04:00
|
|
|
TArray<TObjectPtr<UActorComponent>> SelectedComponents;
|
2020-08-11 01:36:57 -04:00
|
|
|
|
|
|
|
|
/** If the ContextType is Viewport this property can be set to the HitProxy actor that triggered the ContextMenu. */
|
2021-10-27 15:14:40 -04:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
|
2021-01-27 17:40:25 -04:00
|
|
|
TObjectPtr<AActor> HitProxyActor = nullptr;
|
2022-02-02 07:40:00 -05:00
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "LevelEditor | Menu", DisplayName="Get Hit Proxy Element", meta=(ScriptName="GetHitProxyElement"))
|
|
|
|
|
FScriptTypedElementHandle GetScriptHitProxyElement();
|
2019-09-10 11:35:20 -04:00
|
|
|
};
|
|
|
|
|
|
2020-02-18 15:40:24 -05:00
|
|
|
UCLASS()
|
|
|
|
|
class LEVELEDITOR_API ULevelViewportToolBarContext : public UObject
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
|
|
|
|
TWeakPtr<SLevelViewportToolBar> LevelViewportToolBarWidget;
|
|
|
|
|
TWeakPtr<const SLevelViewportToolBar> LevelViewportToolBarWidgetConst;
|
2020-03-18 11:30:24 -04:00
|
|
|
|
|
|
|
|
FLevelEditorViewportClient* GetLevelViewportClient();
|
2020-02-18 15:40:24 -05:00
|
|
|
};
|
2021-01-11 09:19:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
|
class LEVELEDITOR_API UQuickActionMenuContext : public UObject
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
2021-10-27 15:14:40 -04:00
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="LevelEditor|Menu")
|
2021-01-27 17:40:25 -04:00
|
|
|
TObjectPtr<const UTypedElementSelectionSet> CurrentSelection;
|
2021-01-11 09:19:43 -04:00
|
|
|
};
|