You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-106515, UE-112897 #rb vincent.gauthier #preflight 606f3fcd97c8220001315871 #preflight 60749a870adbfb0001f0455c [CL 15982898 by Patrick Boutot in ue5-main branch]
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "KismetNodes/SGraphNodeK2Event.h"
|
|
#include "SGraphPin.h"
|
|
#include "K2Node_Event.h"
|
|
|
|
void SGraphNodeK2Event::AddPin( const TSharedRef<SGraphPin>& PinToAdd )
|
|
{
|
|
const UEdGraphPin* PinObj = PinToAdd->GetPinObj();
|
|
const bool bDelegateOutput = (PinObj != nullptr) && (UK2Node_Event::DelegateOutputName == PinObj->PinName);
|
|
|
|
if (bDelegateOutput && TitleAreaWidget.IsValid())
|
|
{
|
|
PinToAdd->SetOwner(SharedThis(this));
|
|
|
|
bHasDelegateOutputPin = true;
|
|
PinToAdd->SetShowLabel(false);
|
|
TitleAreaWidget->AddSlot()
|
|
.HAlign(HAlign_Right)
|
|
.VAlign(VAlign_Center)
|
|
.Padding(FMargin(4))
|
|
[
|
|
PinToAdd
|
|
];
|
|
|
|
OutputPins.Add(PinToAdd);
|
|
}
|
|
else
|
|
{
|
|
SGraphNodeK2Default::AddPin(PinToAdd);
|
|
}
|
|
}
|
|
|
|
bool SGraphNodeK2Event::UseLowDetailNodeTitles() const
|
|
{
|
|
return (!bHasDelegateOutputPin) && ParentUseLowDetailNodeTitles();
|
|
}
|
|
|
|
EVisibility SGraphNodeK2Event::GetTitleVisibility() const
|
|
{
|
|
return ParentUseLowDetailNodeTitles() ? EVisibility::Hidden : EVisibility::Visible;
|
|
}
|
|
|
|
TSharedRef<SWidget> SGraphNodeK2Event::CreateTitleWidget(TSharedPtr<SNodeTitle> NodeTitle)
|
|
{
|
|
TSharedRef<SWidget> WidgetRef = SGraphNodeK2Default::CreateTitleWidget(NodeTitle);
|
|
WidgetRef->SetVisibility(MakeAttributeSP(this, &SGraphNodeK2Event::GetTitleVisibility));
|
|
if (NodeTitle.IsValid())
|
|
{
|
|
NodeTitle->SetVisibility(MakeAttributeSP(this, &SGraphNodeK2Event::GetTitleVisibility));
|
|
}
|
|
|
|
return WidgetRef;
|
|
}
|