2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "GraphEditorCommon.h"
|
|
|
|
|
#include "SGraphPinText.h"
|
|
|
|
|
#include "SGraphPinMaterialInput.h"
|
|
|
|
|
|
|
|
|
|
void SGraphPinMaterialInput::Construct(const FArguments& InArgs, UEdGraphPin* InGraphPinObj)
|
|
|
|
|
{
|
|
|
|
|
SGraphPin::Construct(SGraphPin::FArguments().UsePinColorForText(true), InGraphPinObj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FSlateColor SGraphPinMaterialInput::GetPinColor() const
|
|
|
|
|
{
|
2015-04-29 05:45:13 -04:00
|
|
|
check(GraphPinObj);
|
|
|
|
|
UMaterialGraph* MaterialGraph = CastChecked<UMaterialGraph>(GraphPinObj->GetOwningNode()->GetGraph());
|
|
|
|
|
const UMaterialGraphSchema* Schema = CastChecked<UMaterialGraphSchema>(MaterialGraph->GetSchema());
|
|
|
|
|
|
|
|
|
|
if (MaterialGraph->IsInputActive(GraphPinObj))
|
|
|
|
|
{
|
|
|
|
|
return Schema->ActivePinColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Schema->InactivePinColor;
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|