You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Remove duplicated implementations of DrawConnection in subclasses that draw non-curved splines, overriding ComputeSplineTangent instead Upgrade note: Any editor plugins that contain a FConnectionDrawingPolicy subclass will need to update calls to DrawSplineWithArrow, DrawConnection, and DetermineWiringStyle [CL 2402661 by Michael Noland in Main branch]
48 lines
1.7 KiB
C++
48 lines
1.7 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "GraphEditorCommon.h"
|
|
#include "MaterialGraphConnectionDrawingPolicy.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// FMaterialGraphConnectionDrawingPolicy
|
|
|
|
FMaterialGraphConnectionDrawingPolicy::FMaterialGraphConnectionDrawingPolicy(int32 InBackLayerID, int32 InFrontLayerID, float ZoomFactor, const FSlateRect& InClippingRect, FSlateWindowElementList& InDrawElements, UEdGraph* InGraphObj)
|
|
: FConnectionDrawingPolicy(InBackLayerID, InFrontLayerID, ZoomFactor, InClippingRect, InDrawElements)
|
|
, MaterialGraph(CastChecked<UMaterialGraph>(InGraphObj))
|
|
, MaterialGraphSchema(CastChecked<UMaterialGraphSchema>(InGraphObj->GetSchema()))
|
|
{
|
|
// Don't want to draw ending arrowheads
|
|
ArrowImage = nullptr;
|
|
ArrowRadius = FVector2D::ZeroVector;
|
|
|
|
// Still need to be able to perceive the graph while dragging connectors, esp over comment boxes
|
|
HoverDeemphasisDarkFraction = 0.4f;
|
|
}
|
|
|
|
void FMaterialGraphConnectionDrawingPolicy::DetermineWiringStyle(UEdGraphPin* OutputPin, UEdGraphPin* InputPin, /*inout*/ FConnectionParams& Params)
|
|
{
|
|
Params.WireColor = MaterialGraphSchema->ActivePinColor;
|
|
|
|
// Have to consider both pins as the input will be an 'output' when previewing a connection
|
|
if (OutputPin)
|
|
{
|
|
if (!MaterialGraph->IsInputActive(OutputPin))
|
|
{
|
|
Params.WireColor = MaterialGraphSchema->InactivePinColor;
|
|
}
|
|
}
|
|
if (InputPin)
|
|
{
|
|
if (!MaterialGraph->IsInputActive(InputPin))
|
|
{
|
|
Params.WireColor = MaterialGraphSchema->InactivePinColor;
|
|
}
|
|
}
|
|
|
|
const bool bDeemphasizeUnhoveredPins = HoveredPins.Num() > 0;
|
|
if (bDeemphasizeUnhoveredPins)
|
|
{
|
|
ApplyHoverDeemphasis(OutputPin, InputPin, /*inout*/ Params.WireThickness, /*inout*/ Params.WireColor);
|
|
}
|
|
}
|