2015-03-17 05:38:32 -04:00
|
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include "K2Node_FormatText.generated.h"
|
|
|
|
|
|
|
|
|
|
|
|
UCLASS(MinimalAPI)
|
|
|
|
|
|
class UK2Node_FormatText : public UK2Node
|
|
|
|
|
|
{
|
2015-03-17 05:38:32 -04:00
|
|
|
|
GENERATED_UCLASS_BODY()
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
// UObject interface
|
2014-07-14 19:41:38 -04:00
|
|
|
|
virtual void PostLoad() override;
|
2014-06-13 06:14:46 -04:00
|
|
|
|
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
// End of UObject interface
|
|
|
|
|
|
|
|
|
|
|
|
// Begin UEdGraphNode interface.
|
2014-06-13 06:14:46 -04:00
|
|
|
|
virtual void AllocateDefaultPins() override;
|
|
|
|
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
|
|
|
|
virtual bool ShouldShowNodeProperties() const override { return true; }
|
|
|
|
|
|
virtual void PinConnectionListChanged(UEdGraphPin* Pin) override;
|
|
|
|
|
|
virtual void PinDefaultValueChanged(UEdGraphPin* Pin) override;
|
2014-09-03 18:14:09 -04:00
|
|
|
|
virtual FText GetTooltipText() const override;
|
2015-01-07 09:52:40 -05:00
|
|
|
|
virtual FText GetPinDisplayName(const UEdGraphPin* Pin) const override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
// End UEdGraphNode interface.
|
|
|
|
|
|
|
|
|
|
|
|
// Begin UK2Node interface.
|
2015-02-13 15:32:38 -05:00
|
|
|
|
virtual bool IsNodePure() const override { return true; }
|
2014-06-13 06:14:46 -04:00
|
|
|
|
virtual bool NodeCausesStructuralBlueprintChange() const override { return true; }
|
|
|
|
|
|
virtual void ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph) override;
|
|
|
|
|
|
virtual ERedirectType DoPinsMatchForReconstruction(const UEdGraphPin* NewPin, int32 NewPinIndex, const UEdGraphPin* OldPin, int32 OldPinIndex) const override;
|
2014-08-23 20:16:29 -04:00
|
|
|
|
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
|
2014-07-14 16:05:25 -04:00
|
|
|
|
virtual FText GetMenuCategory() const override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
// End UK2Node interface.
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
/** Adds a new pin to the node */
|
|
|
|
|
|
BLUEPRINTGRAPH_API void AddArgumentPin();
|
|
|
|
|
|
|
|
|
|
|
|
/** Returns the number of arguments currently available in the node */
|
|
|
|
|
|
int32 GetArgumentCount() const { return PinNames.Num(); }
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Returns argument name based on argument index
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param InIndex The argument's index to find the name for
|
|
|
|
|
|
* @return Returns the argument's name if available
|
|
|
|
|
|
*/
|
|
|
|
|
|
BLUEPRINTGRAPH_API FText GetArgumentName(int32 InIndex) const;
|
|
|
|
|
|
|
|
|
|
|
|
/** Removes the argument at a given index */
|
|
|
|
|
|
BLUEPRINTGRAPH_API void RemoveArgument(int32 InIndex);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Sets an argument name
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param InIndex The argument's index to find the name for
|
|
|
|
|
|
* @param InName Name to set the argument to
|
|
|
|
|
|
*/
|
|
|
|
|
|
BLUEPRINTGRAPH_API void SetArgumentName(int32 InIndex, FText InName);
|
|
|
|
|
|
|
|
|
|
|
|
/** Swaps two arguments by index */
|
|
|
|
|
|
BLUEPRINTGRAPH_API void SwapArguments(int32 InIndexA, int32 InIndexB);
|
|
|
|
|
|
|
2014-04-23 20:18:55 -04:00
|
|
|
|
/** returns Format pin */
|
|
|
|
|
|
BLUEPRINTGRAPH_API UEdGraphPin* GetFormatPin() const;
|
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
/** Returns TRUE if the arguments are allowed to be edited */
|
2014-04-23 20:18:55 -04:00
|
|
|
|
bool CanEditArguments() const { return GetFormatPin()->LinkedTo.Num() > 0; }
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Finds an argument pin by name, checking strings in a strict, case sensitive fashion
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param InPinName The pin name to check for
|
|
|
|
|
|
* @return NULL if the pin was not found, otherwise the found pin.
|
|
|
|
|
|
*/
|
|
|
|
|
|
BLUEPRINTGRAPH_API UEdGraphPin* FindArgumentPin(const FText& InPinName) const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
/** Returns a unique pin name to use for a pin */
|
|
|
|
|
|
FText GetUniquePinName();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
/** When adding arguments to the node, their names are placed here and are generated as pins during construction */
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
|
TArray<FText> PinNames;
|
|
|
|
|
|
|
|
|
|
|
|
/** The "Format" input pin, always available on the node */
|
2014-04-23 20:18:55 -04:00
|
|
|
|
UEdGraphPin* CachedFormatPin;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
/** Tooltip text for this node. */
|
2014-09-03 18:14:09 -04:00
|
|
|
|
FText NodeTooltip;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
};
|
|
|
|
|
|
|