You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
65 lines
1.9 KiB
C++
65 lines
1.9 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
#include "MVVMConversionFunctionGraphSchema.h"
|
|
#include "Bindings/MVVMConversionFunctionHelper.h"
|
|
#include "EdGraph/EdGraphNode.h"
|
|
#include "EdGraph/EdGraphPin.h"
|
|
|
|
|
|
bool UMVVMConversionFunctionGraphSchema::TryCreateConnection(UEdGraphPin* A, UEdGraphPin* B) const
|
|
{
|
|
bool bResult = Super::TryCreateConnection(A, B);
|
|
|
|
if (bResult && !A->LinkedTo.Contains(B))
|
|
{
|
|
// ConversionNode or Promotion node was created between the 2 graph pins
|
|
if (A->LinkedTo.Num() == 1)
|
|
{
|
|
if (UEdGraphNode* AutogeneratedNode = A->LinkedTo[0]->GetOwningNode())
|
|
{
|
|
for (UEdGraphPin* AutogeneratedPin : AutogeneratedNode->Pins)
|
|
{
|
|
if (AutogeneratedPin->LinkedTo.Contains(B))
|
|
{
|
|
UE::MVVM::ConversionFunctionHelper::MarkNodeAsAutoPromote(AutogeneratedNode);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
const FPinConnectionResponse UMVVMConversionFunctionGraphSchema::CanCreateConnection(const UEdGraphPin* PinA, const UEdGraphPin* PinB) const
|
|
{
|
|
check(PinA);
|
|
check(PinB);
|
|
if (PinA->PinType.PinCategory == UEdGraphSchema_K2::PC_SoftObject && PinB->PinType.PinCategory == UEdGraphSchema_K2::PC_Object)
|
|
{
|
|
FPinConnectionResponse Response(CONNECT_RESPONSE_DISALLOW, FString::Printf(TEXT("Conversion disallowed from %s to %s"), *UEdGraphSchema_K2::PC_SoftObject.ToString(), *UEdGraphSchema_K2::PC_Object.ToString()));
|
|
Response.SetFatal();
|
|
return Response;
|
|
}
|
|
|
|
return Super::CanCreateConnection(PinA, PinB);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
EGraphType UMVVMFakeTestUbergraphSchema::GetGraphType(const UEdGraph* TestEdGraph) const
|
|
{
|
|
return EGraphType::GT_Ubergraph;
|
|
}
|
|
|
|
UMVVMFakeTestUbergraph::UMVVMFakeTestUbergraph()
|
|
{
|
|
Schema = UMVVMFakeTestUbergraphSchema::StaticClass();
|
|
}
|
|
|
|
UMVVMFakeTestFunctiongraph::UMVVMFakeTestFunctiongraph()
|
|
{
|
|
Schema = UMVVMConversionFunctionGraphSchema::StaticClass();
|
|
}
|