Files
UnrealEngineUWP/Engine/Source/Editor/BlueprintGraph/Classes/K2Node_SetFieldsInStruct.h
Michael Schoell 663fc7445f Improvements to the usability of PostProcessSettings structure in Blueprints.
Make/Break/Set nodes will no longer show the overrides variables that are used as conditionals for other variables.

These values will automatically be set to true when their corresponding variable is made visible in the node and false if they are not visible.

Added a tooltip for the checkbox to enable these pins to explain the situation.

This feature changes the functionality of existing nodes, all affected cases will give a Warning until the Blueprint is recompiled.

#jira UE-18268 - Post process settings blueprint polish

[CL 2667807 by Michael Schoell in Main branch]
2015-08-25 12:43:09 -04:00

65 lines
2.3 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "K2Node_MakeStruct.h"
#include "EdGraph/EdGraphNodeUtils.h" // for FNodeTextCache
#include "K2Node_SetFieldsInStruct.generated.h"
// Pure kismet node that creates a struct with specified values for each member
UCLASS(MinimalAPI)
class UK2Node_SetFieldsInStruct : public UK2Node_MakeStruct
{
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;
// 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 FText GetTooltipText() const override;
virtual FName GetPaletteIcon(FLinearColor& OutColor) const override;
virtual void ValidateNodeDuringCompilation(class FCompilerResultsLog& MessageLog) const override;
virtual void ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph);
virtual void PostPlacedNewNode() override;
// End UEdGraphNode interface
// Begin K2Node interface
virtual bool IsNodePure() const override { return false; }
virtual class FNodeHandlingFunctor* CreateNodeHandler(class FKismetCompilerContext& CompilerContext) const override;
// End K2Node interface
BLUEPRINTGRAPH_API static bool ShowCustomPinActions(const UEdGraphPin* InGraphPin, bool bIgnorePinsNum);
enum EPinsToRemove
{
GivenPin,
AllOtherPins
};
BLUEPRINTGRAPH_API void RemoveFieldPins(const UEdGraphPin* InGraphPin, EPinsToRemove Selection);
BLUEPRINTGRAPH_API bool AllPinsAreShown() const;
BLUEPRINTGRAPH_API void RestoreAllPins();
protected:
struct FSetFieldsInStructPinManager : public FMakeStructPinManager
{
public:
FSetFieldsInStructPinManager(const uint8* InSampleStructMemory) : FMakeStructPinManager(InSampleStructMemory)
{}
virtual void GetRecordDefaults(UProperty* TestProperty, FOptionalPinFromProperty& Record) const override;
};
private:
/** Constructing FText strings can be costly, so we cache the node's title/tooltip */
FNodeTextCache CachedTooltip;
FNodeTextCache CachedNodeTitle;
};