Files
UnrealEngineUWP/Engine/Source/Editor/AudioEditor/Private/SGraphNodeSoundBase.cpp
ben marsh 2b46ba7b94 Update copyright notices to 2019.
#rb none
#lockdown Nick.Penwarden

#ROBOMERGE-OWNER: ryan.gerleve
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 4662404 in //UE4/Main/...
#ROBOMERGE-BOT: ENGINE (Main -> Dev-Networking)

[CL 4662413 by ben marsh in Dev-Networking branch]
2018-12-14 13:44:01 -05:00

57 lines
1.3 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "SGraphNodeSoundBase.h"
#include "Widgets/SBoxPanel.h"
#include "SoundCueGraph/SoundCueGraphNode.h"
#include "ScopedTransaction.h"
#include "GraphEditorSettings.h"
void SGraphNodeSoundBase::Construct(const FArguments& InArgs, class USoundCueGraphNode* InNode)
{
this->GraphNode = InNode;
this->SoundNode = InNode;
this->SetCursor(EMouseCursor::CardinalCross);
this->UpdateGraphNode();
}
void SGraphNodeSoundBase::CreateOutputSideAddButton(TSharedPtr<SVerticalBox> OutputBox)
{
TSharedRef<SWidget> AddPinButton = AddPinButtonContent(
NSLOCTEXT("SoundNode", "SoundNodeAddPinButton", "Add input"),
NSLOCTEXT("SoundNode", "SoundNodeAddPinButton_Tooltip", "Adds an input to the sound node")
);
FMargin AddPinPadding = Settings->GetOutputPinPadding();
AddPinPadding.Top += 6.0f;
OutputBox->AddSlot()
.AutoHeight()
.VAlign(VAlign_Center)
.Padding(AddPinPadding)
[
AddPinButton
];
}
EVisibility SGraphNodeSoundBase::IsAddPinButtonVisible() const
{
EVisibility ButtonVisibility = SGraphNode::IsAddPinButtonVisible();
if (ButtonVisibility == EVisibility::Visible)
{
if (!SoundNode->CanAddInputPin())
{
ButtonVisibility = EVisibility::Collapsed;
}
}
return ButtonVisibility;
}
FReply SGraphNodeSoundBase::OnAddPin()
{
SoundNode->AddInputPin();
return FReply::Handled();
}