You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Engine source (Main branch up to CL 2026164)
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
// 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 FString& 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 FString& 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;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
#include "EnvironmentQueryFactory.generated.h"
|
||||
|
||||
UCLASS(hidecategories=Object)
|
||||
class UEnvironmentQueryFactory : public UFactory
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
// Begin UFactory Interface
|
||||
virtual UObject* FactoryCreateNew(UClass* Class,UObject* InParent,FName Name,EObjectFlags Flags,UObject* Context,FFeedbackContext* Warn) OVERRIDE;
|
||||
// Begin UFactory Interface
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
#pragma once
|
||||
#include "EnvironmentQueryGraph.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class UEnvironmentQueryGraph : public UEdGraph
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
UPROPERTY()
|
||||
int32 GraphVersion;
|
||||
|
||||
void UpdateVersion();
|
||||
void MarkVersion();
|
||||
|
||||
void CalculateAllWeights();
|
||||
void UpdateAsset();
|
||||
void CreateEnvQueryFromGraph(class UEnvironmentQueryGraphNode* RootEdNode);
|
||||
|
||||
protected:
|
||||
|
||||
void UpdateVersion_NestedNodes();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
#include "EnvironmentQueryGraphNode.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class UEnvironmentQueryGraphNode : public UEdGraphNode
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
UPROPERTY()
|
||||
UObject* NodeInstance;
|
||||
|
||||
/** subnode index assigned during copy operation to connect nodes again on paste */
|
||||
UPROPERTY()
|
||||
int32 CopySubNodeIndex;
|
||||
|
||||
/** Get the BT graph that owns this node */
|
||||
virtual class UEnvironmentQueryGraph* GetEnvironmentQueryGraph();
|
||||
|
||||
virtual void AutowireNewNode(UEdGraphPin* FromPin) OVERRIDE;
|
||||
virtual void PostEditImport() OVERRIDE;
|
||||
virtual void PrepareForCopying() OVERRIDE;
|
||||
virtual void PostCopyNode();
|
||||
|
||||
// @return the input pin for this state
|
||||
virtual UEdGraphPin* GetInputPin(int32 InputIndex=0) const;
|
||||
// @return the output pin for this state
|
||||
virtual UEdGraphPin* GetOutputPin(int32 InputIndex=0) const;
|
||||
//
|
||||
virtual UEdGraph* GetBoundGraph() const { return NULL; }
|
||||
|
||||
virtual FString GetNodeTitle(ENodeTitleType::Type TitleType) const OVERRIDE;
|
||||
virtual FString GetDescription() const;
|
||||
|
||||
virtual void NodeConnectionListChanged() OVERRIDE;
|
||||
|
||||
virtual bool CanCreateUnderSpecifiedSchema(const UEdGraphSchema* DesiredSchema) const OVERRIDE;
|
||||
|
||||
virtual bool IsSubNode() const { return false; }
|
||||
|
||||
UClass* EnvQueryNodeClass;
|
||||
|
||||
protected:
|
||||
|
||||
void ResetNodeOwner();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
#include "EnvironmentQueryGraphNode_Option.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class UEnvironmentQueryGraphNode_Option : public UEnvironmentQueryGraphNode
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
UPROPERTY()
|
||||
TArray<class UEnvironmentQueryGraphNode_Test*> Tests;
|
||||
|
||||
virtual void AllocateDefaultPins() OVERRIDE;
|
||||
virtual void PostPlacedNewNode() OVERRIDE;
|
||||
virtual void GetContextMenuActions(const FGraphNodeContextMenuBuilder& Context) const OVERRIDE;
|
||||
virtual FString GetNodeTitle(ENodeTitleType::Type TitleType) const OVERRIDE;
|
||||
virtual FString GetDescription() const OVERRIDE;
|
||||
|
||||
void AddSubNode(class UEnvironmentQueryGraphNode_Test* NodeTemplate, class UEdGraph* ParentGraph);
|
||||
void CreateAddTestSubMenu(class FMenuBuilder& MenuBuilder, UEdGraph* Graph) const;
|
||||
|
||||
void CalculateWeights();
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
#pragma once
|
||||
#include "EnvironmentQueryGraphNode_Root.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class UEnvironmentQueryGraphNode_Root : public UEnvironmentQueryGraphNode
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
virtual void AllocateDefaultPins() OVERRIDE;
|
||||
virtual bool CanUserDeleteNode() const OVERRIDE { return false; }
|
||||
virtual FString GetNodeTitle(ENodeTitleType::Type TitleType) const OVERRIDE;
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
#include "EnvironmentQueryGraphNode_Test.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class UEnvironmentQueryGraphNode_Test : public UEnvironmentQueryGraphNode
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** weight percent for display */
|
||||
UPROPERTY()
|
||||
float TestWeightPct;
|
||||
|
||||
/** weight is passed as named param */
|
||||
UPROPERTY()
|
||||
uint32 bHasNamedWeight : 1;
|
||||
|
||||
/** toggles test */
|
||||
UPROPERTY()
|
||||
uint32 bTestEnabled : 1;
|
||||
|
||||
UPROPERTY()
|
||||
class UEnvironmentQueryGraphNode_Option* ParentNode;
|
||||
|
||||
virtual void PostPlacedNewNode() OVERRIDE;
|
||||
virtual void DestroyNode() OVERRIDE;
|
||||
virtual bool IsSubNode() const OVERRIDE { return true; }
|
||||
virtual FString GetNodeTitle(ENodeTitleType::Type TitleType) const OVERRIDE;
|
||||
virtual FString GetDescription() const OVERRIDE;
|
||||
|
||||
void SetDisplayedWeight(float Pct, bool bNamed);
|
||||
};
|
||||
Reference in New Issue
Block a user