Files
UnrealEngineUWP/Engine/Source/Editor/AudioEditor/Private/SGraphNodeSoundBase.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

57 lines
1.4 KiB
C++

// Copyright 1998-2017 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 = Cast<UEdGraphNode>(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();
}