Files
UnrealEngineUWP/Engine/Source/Editor/AudioEditor/Classes/SoundClassGraph/SoundClassGraphSchema.h
Rex Hill 44507f764d Graph Editor Context Menus refactored as ToolMenus
#rb lauren.ridge
#jira UETOOL-1497

[CL 7886478 by Rex Hill in Dev-Editor branch]
2019-08-08 12:51:48 -04:00

65 lines
2.8 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "EdGraph/EdGraphSchema.h"
#include "SoundClassGraphSchema.generated.h"
class UEdGraph;
/** Action to add a node to the graph */
USTRUCT()
struct AUDIOEDITOR_API FSoundClassGraphSchemaAction_NewNode : public FEdGraphSchemaAction
{
GENERATED_USTRUCT_BODY();
// Simple type info
static FName StaticGetTypeId() {static FName Type("FSoundClassGraphSchemaAction_NewNode"); return Type;}
FSoundClassGraphSchemaAction_NewNode()
: FEdGraphSchemaAction()
, NewSoundClassName(TEXT("ClassName"))
{}
FSoundClassGraphSchemaAction_NewNode(FText InNodeCategory, FText InMenuDesc, FText InToolTip, const int32 InGrouping)
: FEdGraphSchemaAction(MoveTemp(InNodeCategory), MoveTemp(InMenuDesc), MoveTemp(InToolTip), InGrouping)
, NewSoundClassName(TEXT("ClassName"))
{}
//~ Begin FEdGraphSchemaAction Interface
virtual FName GetTypeId() const override { return StaticGetTypeId(); }
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) override;
//~ End FEdGraphSchemaAction Interface
/** Name for the new SoundClass */
FString NewSoundClassName;
};
UCLASS(MinimalAPI)
class USoundClassGraphSchema : public UEdGraphSchema
{
GENERATED_UCLASS_BODY()
/** Check whether connecting these pins would cause a loop */
bool ConnectionCausesLoop(const UEdGraphPin* InputPin, const UEdGraphPin* OutputPin) const;
/** Get menu for breaking links to specific nodes*/
void GetBreakLinkToSubMenuActions(class UToolMenu* Menu, class UEdGraphPin* InGraphPin);
//~ Begin EdGraphSchema Interface
virtual void GetGraphContextActions(FGraphContextMenuBuilder& ContextMenuBuilder) const override;
virtual void GetContextMenuActions(class UToolMenu* Menu, class UGraphNodeContextMenuContext* Context) const override;
virtual FName GetParentContextMenuName() const override { return NAME_None; }
virtual const FPinConnectionResponse CanCreateConnection(const UEdGraphPin* PinA, const UEdGraphPin* PinB) const override;
virtual bool TryCreateConnection(UEdGraphPin* PinA, UEdGraphPin* PinB) const override;
virtual bool ShouldHidePinDefaultValue(UEdGraphPin* Pin) const override;
virtual FLinearColor GetPinTypeColor(const FEdGraphPinType& PinType) const override;
virtual void BreakNodeLinks(UEdGraphNode& TargetNode) const override;
virtual void BreakPinLinks(UEdGraphPin& TargetPin, bool bSendsNodeNotifcation) const override;
virtual void BreakSinglePinLink(UEdGraphPin* SourcePin, UEdGraphPin* TargetPin) const override;
virtual void DroppedAssetsOnGraph(const TArray<struct FAssetData>& Assets, const FVector2D& GraphPosition, UEdGraph* Graph) const override;
//~ End EdGraphSchema Interface
};