Files
UnrealEngineUWP/Engine/Source/Editor/EnvironmentQueryEditor/Classes/EdGraphSchema_EnvironmentQuery.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

96 lines
4.0 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "EdGraphSchema_EnvironmentQuery.generated.h"
/** Action to add a node to the graph */
USTRUCT()
struct FEnvironmentQuerySchemaAction_NewNode : public FEdGraphSchemaAction
{
GENERATED_USTRUCT_BODY();
/** Template of node we want to create */
UPROPERTY()
class UEnvironmentQueryGraphNode* NodeTemplate;
FEnvironmentQuerySchemaAction_NewNode()
: FEdGraphSchemaAction()
, NodeTemplate(NULL)
{}
FEnvironmentQuerySchemaAction_NewNode(const FString& InNodeCategory, const FText& InMenuDesc, const FString& InToolTip, const int32 InGrouping)
: FEdGraphSchemaAction(InNodeCategory, InMenuDesc, InToolTip, InGrouping)
, NodeTemplate(NULL)
{}
// FEdGraphSchemaAction interface
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) OVERRIDE;
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, TArray<UEdGraphPin*>& FromPins, const FVector2D Location, bool bSelectNewNode = true) OVERRIDE;
virtual void AddReferencedObjects( FReferenceCollector& Collector ) OVERRIDE;
// End of FEdGraphSchemaAction interface
template <typename NodeType>
static NodeType* SpawnNodeFromTemplate(class UEdGraph* ParentGraph, NodeType* InTemplateNode, const FVector2D Location)
{
FEnvironmentQuerySchemaAction_NewNode Action;
Action.NodeTemplate = InTemplateNode;
return Cast<NodeType>(Action.PerformAction(ParentGraph, NULL, Location));
}
};
/** Action to add a subnode to the selected node */
USTRUCT()
struct FEnvironmentQuerySchemaAction_NewSubNode : public FEdGraphSchemaAction
{
GENERATED_USTRUCT_BODY();
/** Template of node we want to create */
UPROPERTY()
class UEnvironmentQueryGraphNode_Test* NodeTemplate;
/** parent node */
UPROPERTY()
class UEnvironmentQueryGraphNode_Option* ParentNode;
FEnvironmentQuerySchemaAction_NewSubNode()
: FEdGraphSchemaAction()
, NodeTemplate(NULL)
{}
FEnvironmentQuerySchemaAction_NewSubNode(const FString& InNodeCategory, const FText& InMenuDesc, const FString& InToolTip, const int32 InGrouping)
: FEdGraphSchemaAction(InNodeCategory, InMenuDesc, InToolTip, InGrouping)
, NodeTemplate(NULL)
{}
// FEdGraphSchemaAction interface
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) OVERRIDE;
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, TArray<UEdGraphPin*>& FromPins, const FVector2D Location, bool bSelectNewNode = true) OVERRIDE;
virtual void AddReferencedObjects( FReferenceCollector& Collector ) OVERRIDE;
// End of FEdGraphSchemaAction interface
};
UCLASS(MinimalAPI)
class UEdGraphSchema_EnvironmentQuery : public UEdGraphSchema
{
GENERATED_UCLASS_BODY()
void GetBreakLinkToSubMenuActions(class FMenuBuilder& MenuBuilder, class UEdGraphPin* InGraphPin);
// Begin EdGraphSchema interface
virtual void CreateDefaultNodesForGraph(UEdGraph& Graph) const OVERRIDE;
virtual void GetGraphContextActions(FGraphContextMenuBuilder& ContextMenuBuilder) const OVERRIDE;
virtual void GetContextMenuActions(const UEdGraph* CurrentGraph, const UEdGraphNode* InGraphNode, const UEdGraphPin* InGraphPin, class FMenuBuilder* MenuBuilder, bool bIsDebugging) const OVERRIDE;
virtual const FPinConnectionResponse CanCreateConnection(const UEdGraphPin* A, const UEdGraphPin* B) const OVERRIDE;
virtual const FPinConnectionResponse CanMergeNodes(const UEdGraphNode* A, const UEdGraphNode* B) const OVERRIDE;
virtual FLinearColor GetPinTypeColor(const FEdGraphPinType& PinType) const OVERRIDE;
virtual bool ShouldHidePinDefaultValue(UEdGraphPin* Pin) const OVERRIDE;
virtual class FConnectionDrawingPolicy* CreateConnectionDrawingPolicy(int32 InBackLayerID, int32 InFrontLayerID, float InZoomFactor, const FSlateRect& InClippingRect, class FSlateWindowElementList& InDrawElements, class UEdGraph* InGraphObj) const OVERRIDE;
// End EdGraphSchema interface
void GetGraphNodeContextActions(FGraphContextMenuBuilder& ContextMenuBuilder) const;
};