You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added the FScriptTypedElementHandle. These handles are disarmed when the element they pointing to is destroyed instead of crashing the engine. They do have a performance overhead so using these should be restricted to exposing stuff to blueprint/python. Reworked the TypedElementList to be a template so that we have both a FTypedElementList and a FScriptTypedElementList from the same source code. Changed the api of the interfaces so that can now accept and use the scripted version of the handle and list instead of the native ones. #jira UE-133667 #rb Brooke.Hubert #preflight 61f89bfaf657e25a5908db48 #ROBOMERGE-AUTHOR: julien.stjean #ROBOMERGE-SOURCE: CL 18816318 in //UE5/Release-5.0/... via CL 18816336 via CL 18822818 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042) [CL 18824371 by julien stjean in ue5-main branch]
90 lines
2.7 KiB
C++
90 lines
2.7 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. */
|
|
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;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "LevelEditor | Menu", DisplayName="Get Hit Proxy Element", meta=(ScriptName="GetHitProxyElement"))
|
|
FScriptTypedElementHandle GetScriptHitProxyElement();
|
|
};
|
|
|
|
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;
|
|
};
|