// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Input/DragAndDrop.h" #include "DragAndDrop/AssetDragDropOp.h" #include "DragAndDrop/LevelDragDropOp.h" namespace WorldHierarchy { struct IWorldTreeItem; typedef TSharedPtr FWorldTreeItemPtr; typedef TSharedRef FWorldTreeItemRef; struct FValidationInfo { FValidationInfo() : bValid(true) { } FText ValidationText; bool bValid; }; struct FDragDropPayload { /** World tree items */ TArray DraggedTreeItems; }; /** Construct a new drag and drop operation for the world hierarchy */ TSharedPtr CreateDragDropOperation(const TArray& InTreeItems); /** * Used to drag folders and level items within the world hierarchy widget */ struct FWorldBrowserDragDropOp : public FLevelDragDropOp { DRAG_DROP_OPERATOR_TYPE(FWorldBrowserDragDropOp, FLevelDragDropOp); FWorldBrowserDragDropOp(); using FLevelDragDropOp::Construct; TArray GetDraggedItems() const { return DraggedItems; } /** Initializes the operation with the specified payload */ void Init(const FDragDropPayload* Payload); virtual TSharedPtr GetDefaultDecorator() const override; /** Creates a drag and drop operation for the specified levels */ static TSharedRef New(const TArray>& Levels) { TSharedRef Op = MakeShareable(new FWorldBrowserDragDropOp); Op->LevelsToDrop.Append(Levels); Op->Init(nullptr); Op->Construct(); return Op; } /** Creates a drag and drop operation for the specified streaming levels */ static TSharedRef New(const TArray>& StreamingLevels) { TSharedRef Op = MakeShareable(new FWorldBrowserDragDropOp); Op->StreamingLevelsToDrop.Append(StreamingLevels); Op->Init(nullptr); Op->Construct(); return Op; } private: TArray DraggedItems; }; } // namespace WorldHierarchy