You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-130755 #rb trivial #rnx #preflight 61df10146a076ddb53ecd68e #preflight 61df40836a16a18acf8741e8 #ROBOMERGE-AUTHOR: ben.hoffman #ROBOMERGE-SOURCE: CL 18589393 in //UE5/Release-5.0/... via CL 18589401 via CL 18589406 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669) [CL 18589423 by ben hoffman in ue5-main branch]
75 lines
2.0 KiB
C++
75 lines
2.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "SGraphNodePromotableOperator.h"
|
|
#include "EdGraphSchema_K2.h"
|
|
#include "GraphEditorSettings.h"
|
|
#include "SGraphPin.h"
|
|
#include "SPinTypeSelector.h"
|
|
#include "Widgets/Images/SLayeredImage.h"
|
|
#include "GraphEditorSettings.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "SGraphNodePromotableOperator"
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// SGraphNodePromotableOperator
|
|
|
|
void SGraphNodePromotableOperator::Construct(const FArguments& InArgs, UK2Node_PromotableOperator* InNode)
|
|
{
|
|
SGraphNodeK2Sequence::Construct(SGraphNodeK2Sequence::FArguments(), InNode);
|
|
|
|
LoadCachedIcons();
|
|
}
|
|
|
|
void SGraphNodePromotableOperator::CreatePinWidgets()
|
|
{
|
|
SGraphNodeK2Sequence::CreatePinWidgets();
|
|
|
|
TSet<TSharedRef<SWidget>> AllPins;
|
|
GetPins(AllPins);
|
|
|
|
LoadCachedIcons();
|
|
|
|
for(TSharedRef<SWidget>& Widget : AllPins)
|
|
{
|
|
|
|
if(TSharedPtr<SGraphPin> Pin = StaticCastSharedRef<SGraphPin>(Widget))
|
|
{
|
|
UEdGraphPin* SourcePin = Pin->GetPinObj();
|
|
|
|
// Split pins should be drawn as normal pins, the inner properties are not promotable
|
|
if(!SourcePin || SourcePin->ParentPin)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if(TSharedPtr<SLayeredImage> PinImage = StaticCastSharedPtr<SLayeredImage>(Pin->GetPinImageWidget()))
|
|
{
|
|
// Set the image to use the outer icon, which will be the connect pin type color
|
|
PinImage->SetLayerBrush(0, CachedOuterIcon);
|
|
|
|
// Set the inner image to be wildcard color, which is grey by default
|
|
PinImage->AddLayer(CachedInnerIcon, GetDefault<UGraphEditorSettings>()->WildcardPinTypeColor);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void SGraphNodePromotableOperator::LoadCachedIcons()
|
|
{
|
|
static const FName PromotableTypeOuterName("Kismet.VariableList.PromotableTypeOuterIcon");
|
|
static const FName PromotableTypeInnerName("Kismet.VariableList.PromotableTypeInnerIcon");
|
|
|
|
// Outer ring icons
|
|
if(!CachedOuterIcon)
|
|
{
|
|
CachedOuterIcon = FEditorStyle::GetBrush(PromotableTypeOuterName);
|
|
}
|
|
|
|
if(!CachedInnerIcon)
|
|
{
|
|
CachedInnerIcon = FEditorStyle::GetBrush(PromotableTypeInnerName);
|
|
}
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|