2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
2014-05-29 17:11:10 -04:00
|
|
|
#include "EdGraph/EdGraphNode.h"
|
2014-09-03 18:17:44 -04:00
|
|
|
#include "EdGraph/EdGraphNodeUtils.h" // for FNodeTextCache
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "EdGraphNode_Comment.generated.h"
|
|
|
|
|
|
|
|
|
|
typedef TArray<class UObject*> FCommentNodeSet;
|
|
|
|
|
|
|
|
|
|
UENUM()
|
|
|
|
|
namespace ECommentBoxMode
|
|
|
|
|
{
|
|
|
|
|
enum Type
|
|
|
|
|
{
|
2015-06-10 12:54:31 -04:00
|
|
|
/** This comment box will move any fully contained nodes when it moves. */
|
2014-03-14 14:13:41 -04:00
|
|
|
GroupMovement UMETA(DisplayName="Group Movement"),
|
|
|
|
|
|
2015-06-10 12:54:31 -04:00
|
|
|
/** This comment box has no effect on nodes contained inside it. */
|
2014-03-14 14:13:41 -04:00
|
|
|
NoGroupMovement UMETA(DisplayName="Comment")
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UCLASS(MinimalAPI)
|
|
|
|
|
class UEdGraphNode_Comment : public UEdGraphNode
|
|
|
|
|
{
|
2015-03-06 13:53:53 -05:00
|
|
|
public:
|
2015-03-17 05:38:32 -04:00
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
UEdGraphNode_Comment(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Color to style comment with */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Comment)
|
|
|
|
|
FLinearColor CommentColor;
|
|
|
|
|
|
|
|
|
|
/** Whether to use Comment Color to color the background of the comment bubble shown when zoomed out. */
|
2014-04-24 15:44:17 -04:00
|
|
|
UPROPERTY(EditAnywhere, Category=Comment, meta=(DisplayName="Color Bubble"))
|
2014-03-14 14:13:41 -04:00
|
|
|
uint32 bColorCommentBubble:1;
|
|
|
|
|
|
|
|
|
|
/** Whether the comment should move any fully enclosed nodes around when it is moved */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Comment)
|
|
|
|
|
TEnumAsByte<ECommentBoxMode::Type> MoveMode;
|
|
|
|
|
|
2014-12-05 05:33:22 -05:00
|
|
|
/** comment Depth */
|
2015-04-08 14:54:52 -04:00
|
|
|
UPROPERTY()
|
2014-12-05 05:33:22 -05:00
|
|
|
int32 CommentDepth;
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// Begin UObject Interface
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API static void AddReferencedObjects(UObject* InThis, FReferenceCollector& Collector);
|
2014-03-14 14:13:41 -04:00
|
|
|
// End UObject Interface
|
|
|
|
|
|
|
|
|
|
// Begin UEdGraphNode interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void AllocateDefaultPins() override {}
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API virtual FText GetTooltipText() const override;
|
|
|
|
|
UNREALED_API virtual FLinearColor GetNodeCommentColor() const override;
|
|
|
|
|
UNREALED_API virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool ShouldOverridePinNames() const override { return true; }
|
2015-01-07 09:52:40 -05:00
|
|
|
UNREALED_API virtual FText GetPinNameOverride(const UEdGraphPin& Pin) const override;
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API virtual void ResizeNode(const FVector2D& NewSize) override;
|
|
|
|
|
UNREALED_API virtual void PostPlacedNewNode() override;
|
|
|
|
|
UNREALED_API virtual void OnRenameNode(const FString& NewName) override;
|
|
|
|
|
UNREALED_API virtual TSharedPtr<class INameValidatorInterface> MakeNameValidator() const override;
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool ShouldDrawNodeAsComment() const override { return true; }
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API virtual FString GetDocumentationLink() const override;
|
|
|
|
|
UNREALED_API virtual FString GetDocumentationExcerptName() const override;
|
|
|
|
|
UNREALED_API virtual FName GetPaletteIcon(FLinearColor& OutColor) const override;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End UEdGraphNode interface
|
|
|
|
|
|
|
|
|
|
/** Add a node that will be dragged when this comment is dragged */
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API void AddNodeUnderComment(UObject* Object);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Clear all of the nodes which are currently being dragged with this comment */
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API void ClearNodesUnderComment();
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Set the Bounds for the comment node */
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API void SetBounds(const class FSlateRect& Rect);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Return the set of nodes underneath the comment */
|
2014-10-07 16:39:44 -04:00
|
|
|
UNREALED_API const FCommentNodeSet& GetNodesUnderComment() const;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/** Nodes currently within the region of the comment */
|
|
|
|
|
FCommentNodeSet NodesUnderComment;
|
2014-09-03 18:17:44 -04:00
|
|
|
|
|
|
|
|
/** Constructing FText strings can be costly, so we cache the node's tooltip */
|
|
|
|
|
FNodeTextCache CachedTooltip;
|
2014-03-14 14:13:41 -04:00
|
|
|
};
|
|
|
|
|
|