2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "ReferenceViewerPrivatePCH.h"
|
|
|
|
|
#include "AssetThumbnail.h"
|
|
|
|
|
#include "ReferenceViewerActions.h"
|
|
|
|
|
#include "GlobalEditorCommonCommands.h"
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// UReferenceViewerSchema
|
|
|
|
|
|
|
|
|
|
UReferenceViewerSchema::UReferenceViewerSchema(const class FPostConstructInitializeProperties& PCIP)
|
|
|
|
|
: Super(PCIP)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UReferenceViewerSchema::GetContextMenuActions(const UEdGraph* CurrentGraph, const UEdGraphNode* InGraphNode, const UEdGraphPin* InGraphPin, class FMenuBuilder* MenuBuilder, bool bIsDebugging) const
|
|
|
|
|
{
|
|
|
|
|
MenuBuilder->AddMenuEntry(FGlobalEditorCommonCommands::Get().FindInContentBrowser);
|
2014-05-13 12:56:26 -04:00
|
|
|
MenuBuilder->AddMenuEntry(FReferenceViewerActions::Get().OpenSelectedInAssetEditor);
|
2014-03-14 14:13:41 -04:00
|
|
|
MenuBuilder->AddMenuEntry(FReferenceViewerActions::Get().ReCenterGraph);
|
|
|
|
|
MenuBuilder->AddMenuEntry(FReferenceViewerActions::Get().ListReferencedObjects);
|
|
|
|
|
MenuBuilder->AddMenuEntry(FReferenceViewerActions::Get().ListObjectsThatReference);
|
|
|
|
|
|
|
|
|
|
MenuBuilder->AddSubMenu(NSLOCTEXT("ReferenceViewerSchema","MakeCollectionWithReferencedAssetsTitle", "Make Collection with Referenced Assets"),
|
|
|
|
|
FText::GetEmpty(),
|
|
|
|
|
FNewMenuDelegate::CreateUObject(this, &UReferenceViewerSchema::GetMakeCollectionWithReferencedAssetsSubMenu )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
MenuBuilder->AddMenuEntry(FReferenceViewerActions::Get().ShowReferenceTree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FLinearColor UReferenceViewerSchema::GetPinTypeColor(const FEdGraphPinType& PinType) const
|
|
|
|
|
{
|
|
|
|
|
return FLinearColor::White;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UReferenceViewerSchema::BreakPinLinks(UEdGraphPin& TargetPin, bool bSendsNodeNotifcation) const
|
|
|
|
|
{
|
|
|
|
|
// Don't allow breaking any links
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UReferenceViewerSchema::BreakSinglePinLink(UEdGraphPin* SourcePin, UEdGraphPin* TargetPin)
|
|
|
|
|
{
|
|
|
|
|
// Don't allow breaking any links
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-23 17:47:19 -04:00
|
|
|
FPinConnectionResponse UReferenceViewerSchema::MovePinLinks(UEdGraphPin& MoveFromPin, UEdGraphPin& MoveToPin, bool bIsItermeadiateMove) const
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Don't allow moving any links
|
|
|
|
|
return FPinConnectionResponse(CONNECT_RESPONSE_DISALLOW, TEXT(""));
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-23 17:47:19 -04:00
|
|
|
FPinConnectionResponse UReferenceViewerSchema::CopyPinLinks(UEdGraphPin& CopyFromPin, UEdGraphPin& CopyToPin, bool bIsItermeadiateCopy) const
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Don't allow copying any links
|
|
|
|
|
return FPinConnectionResponse(CONNECT_RESPONSE_DISALLOW, TEXT(""));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UReferenceViewerSchema::GetMakeCollectionWithReferencedAssetsSubMenu( FMenuBuilder& MenuBuilder )
|
|
|
|
|
{
|
|
|
|
|
MenuBuilder.AddMenuEntry(FReferenceViewerActions::Get().MakeLocalCollectionWithReferencedAssets);
|
|
|
|
|
MenuBuilder.AddMenuEntry(FReferenceViewerActions::Get().MakePrivateCollectionWithReferencedAssets);
|
|
|
|
|
MenuBuilder.AddMenuEntry(FReferenceViewerActions::Get().MakeSharedCollectionWithReferencedAssets);
|
|
|
|
|
}
|