Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Classes/AnimationStateMachineSchema.h
Michael Schoell 0a41fb741e #summary Can search for nodes in the palette menu in Blueprints with both the native name and the localized name.
#add Added UEdGraphNode::GetNodeNativeTitle to return a native title for a node.
#add Added UEdGraphNode::GetNodeSearchTitle to return the native and localized title for a node, together, for searching.
#add Can hold "alt" over a node (in the graph panel, or the palette) to see the native name of the node.

#ttp 331252 - Blueprints: Editor: L10N: Blueprints need to consistently show localized node names and when searching need to search both the localized name and the native name

#codereview justin.sargent

[CL 2044506 by Michael Schoell in Main branch]
2014-04-23 18:30:37 -04:00

83 lines
3.7 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "AnimationStateMachineSchema.generated.h"
/** Action to add a node to the graph */
USTRUCT()
struct ANIMGRAPH_API FEdGraphSchemaAction_NewStateNode : public FEdGraphSchemaAction
{
GENERATED_USTRUCT_BODY()
UEdGraphNode* NodeTemplate;
FEdGraphSchemaAction_NewStateNode()
: FEdGraphSchemaAction()
, NodeTemplate(NULL)
{}
FEdGraphSchemaAction_NewStateNode(const FString& InNodeCategory, const FText& InMenuDesc, const FString& InToolTip, const int32 InGrouping)
: FEdGraphSchemaAction(InNodeCategory, InMenuDesc, InToolTip, InGrouping)
, NodeTemplate(NULL)
{}
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) OVERRIDE;
virtual void AddReferencedObjects( FReferenceCollector& Collector ) OVERRIDE;
template <typename NodeType>
static NodeType* SpawnNodeFromTemplate(class UEdGraph* ParentGraph, NodeType* InTemplateNode, const FVector2D Location = FVector2D(0.0f, 0.0f))
{
FEdGraphSchemaAction_NewStateNode Action;
Action.NodeTemplate = InTemplateNode;
return Cast<NodeType>(Action.PerformAction(ParentGraph, NULL, Location));
}
};
/** Action to create new comment */
USTRUCT()
struct ANIMGRAPH_API FEdGraphSchemaAction_NewStateComment : public FEdGraphSchemaAction
{
GENERATED_USTRUCT_BODY();
FEdGraphSchemaAction_NewStateComment()
: FEdGraphSchemaAction()
{}
FEdGraphSchemaAction_NewStateComment(const FString& InNodeCategory, const FText& InMenuDesc, const FString& InToolTip, const int32 InGrouping)
: FEdGraphSchemaAction(InNodeCategory, InMenuDesc, InToolTip, InGrouping)
{}
// FEdGraphSchemaAction interface
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) OVERRIDE;
// End of FEdGraphSchemaAction interface
};
UCLASS(MinimalAPI)
class UAnimationStateMachineSchema : public UEdGraphSchema
{
GENERATED_UCLASS_BODY()
UPROPERTY()
FString PC_Exec;
// Begin UEdGraphSchema interface
virtual void CreateDefaultNodesForGraph(UEdGraph& Graph) const;
virtual const FPinConnectionResponse CanCreateConnection(const UEdGraphPin* A, const UEdGraphPin* B) const OVERRIDE;
virtual bool TryCreateConnection(UEdGraphPin* A, UEdGraphPin* B) const OVERRIDE;
virtual bool CreateAutomaticConversionNodeAndConnections(UEdGraphPin* PinA, UEdGraphPin* PinB) const;
virtual void GetGraphContextActions(FGraphContextMenuBuilder& ContextMenuBuilder) const OVERRIDE;
virtual EGraphType GetGraphType(const UEdGraph* TestEdGraph) const OVERRIDE;
virtual void GetContextMenuActions(const UEdGraph* CurrentGraph, const UEdGraphNode* InGraphNode, const UEdGraphPin* InGraphPin, FMenuBuilder* MenuBuilder, bool bIsDebugging) const OVERRIDE;
virtual FLinearColor GetPinTypeColor(const FEdGraphPinType& PinType) const OVERRIDE;
virtual void GetGraphDisplayInformation(const UEdGraph& Graph, /*out*/ FGraphDisplayInfo& DisplayInfo) const OVERRIDE;
virtual void DroppedAssetsOnGraph(const TArray<FAssetData>& Assets, const FVector2D& GraphPosition, UEdGraph* Graph) const OVERRIDE;
virtual void DroppedAssetsOnNode(const TArray<FAssetData>& Assets, const FVector2D& GraphPosition, UEdGraphNode* Node) const OVERRIDE;
virtual void DroppedAssetsOnPin(const TArray<FAssetData>& Assets, const FVector2D& GraphPosition, UEdGraphPin* Pin) const OVERRIDE;
virtual void GetAssetsNodeHoverMessage(const TArray<FAssetData>& Assets, const UEdGraphNode* HoverNode, FString& OutTooltipText, bool& OutOkIcon) const OVERRIDE;
virtual void GetAssetsPinHoverMessage(const TArray<FAssetData>& Assets, const UEdGraphPin* HoverPin, FString& OutTooltipText, bool& OutOkIcon) const OVERRIDE;
// End UEdGraphSchema interface
};