Files
UnrealEngineUWP/Engine/Source/Editor/BlueprintGraph/Classes/K2Node_BreakStruct.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

71 lines
2.9 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Textures/SlateIcon.h"
#include "EdGraph/EdGraphNodeUtils.h"
#include "K2Node_StructMemberGet.h"
#include "K2Node_BreakStruct.generated.h"
class FBlueprintActionDatabaseRegistrar;
class UEdGraph;
UCLASS(MinimalAPI)
class UK2Node_BreakStruct : public UK2Node_StructMemberGet
{
GENERATED_UCLASS_BODY()
/** Helper property to handle upgrades from an old system of displaying pins for
* the override values that properties referenced as a conditional of being set in a struct */
UPROPERTY()
bool bMadeAfterOverridePinRemoval;
/**
* Returns false if:
* 1. The Struct has a 'native break' method
* Returns true if:
* 1. The Struct is tagged as BlueprintType
* or
* 2. The Struct has any property that is tagged as CPF_BlueprintVisible
* or
* 3. The Struct has any property that is tagged as CPF_Edit and bIncludeEditAnywhere is true
*
* When constructing the context menu we do not allow the presence of the EditAnywhere flag to result in
* a creation of a break node, although we could do so in the future. There are legacy break nodes that
* rely on expansion of structs that neither have BlueprintVisible properties nor are tagged as BlueprintType
*/
static bool CanBeBroken(const UScriptStruct* Struct, bool bIncludeEditAnywhere = true, bool bMustHaveValidProperties = false);
// UObject interface
virtual void Serialize(FArchive& Ar) override;
// End of UObject interface
//~ Begin UEdGraphNode Interface
virtual void AllocateDefaultPins() override;
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
virtual FLinearColor GetNodeTitleColor() const override;
virtual FText GetTooltipText() const override;
virtual void ValidateNodeDuringCompilation(class FCompilerResultsLog& MessageLog) const override;
virtual FSlateIcon GetIconAndTint(FLinearColor& OutColor) const override;
//~ End UEdGraphNode Interface
//~ Begin K2Node Interface
virtual bool NodeCausesStructuralBlueprintChange() const override { return false; }
virtual bool IsNodePure() const override { return true; }
virtual bool DrawNodeAsVariable() const override { return false; }
virtual ERedirectType DoPinsMatchForReconstruction(const UEdGraphPin* NewPin, int32 NewPinIndex, const UEdGraphPin* OldPin, int32 OldPinIndex) const override;
virtual class FNodeHandlingFunctor* CreateNodeHandler(class FKismetCompilerContext& CompilerContext) const override;
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
virtual FText GetMenuCategory() const override;
virtual void ConvertDeprecatedNode(UEdGraph* Graph, bool bOnlySafeChanges) override;
//~ End K2Node Interface
private:
/** Constructing FText strings can be costly, so we cache the node's title/tooltip */
FNodeTextCache CachedTooltip;
FNodeTextCache CachedNodeTitle;
};