Files
UnrealEngineUWP/Engine/Plugins/Runtime/Metasound/Source/MetasoundEditor/Private/SMetasoundGraphNode.h
rob gay fd33c39c6e - Drag/Drop/Double-Click Add/JumpTo Member Support
- Fix another spot for when member is removed from the editor views on next tick, don't show garbage member in details panel
- Variable node body fix-ups
#rb helen.yang
#rnx
#jira UE-143288
#preflight 62102b6a406b34de07e846ae

#ROBOMERGE-AUTHOR: rob.gay
#ROBOMERGE-SOURCE: CL 19082391 in //UE5/Release-5.0/... via CL 19097086
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19140792 by rob gay in ue5-main branch]
2022-02-24 23:29:50 -05:00

87 lines
3.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Input/Reply.h"
#include "Layout/Visibility.h"
#include "Misc/Attribute.h"
#include "SGraphNode.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SOverlay.h"
// Forward Declarations
class SAudioInputWidget;
class SGraphPin;
class SVerticalBox;
class UMetasoundEditorGraphMember;
class UMetasoundEditorGraphMemberDefaultLiteral;
class UMetasoundEditorGraphMemberNode;
class UMetasoundEditorGraphNode;
namespace Metasound
{
namespace Editor
{
class SMetaSoundGraphNode : public SGraphNode
{
public:
SLATE_BEGIN_ARGS(SMetaSoundGraphNode)
{
}
SLATE_END_ARGS()
virtual ~SMetaSoundGraphNode();
void Construct(const FArguments& InArgs, class UEdGraphNode* InNode);
protected:
bool IsVariableAccessor() const;
bool IsVariableMutator() const;
// SGraphNode Interface
virtual const FSlateBrush* GetShadowBrush(bool bSelected) const override;
virtual void CreateInputSideAddButton(TSharedPtr<SVerticalBox> InputBox) override;
virtual void CreateOutputSideAddButton(TSharedPtr<SVerticalBox> OutputBox) override;
virtual TSharedPtr<SGraphPin> CreatePinWidget(UEdGraphPin* InPin) const override;
virtual void CreateStandardPinWidget(UEdGraphPin* InPin) override;
virtual TSharedRef<SWidget> CreateNodeContentArea() override;
virtual TSharedRef<SWidget> CreateTitleWidget(TSharedPtr<SNodeTitle> NodeTitle) override;
virtual const FSlateBrush* GetNodeBodyBrush() const override;
virtual TSharedRef<SWidget> CreateTitleRightWidget() override;
virtual EVisibility IsAddPinButtonVisible() const override;
virtual FReply OnAddPin() override;
virtual void MoveTo(const FVector2D& NewPosition, FNodeSet& NodeFilter, bool bMarkDirty = true) override;
virtual void SetDefaultTitleAreaWidget(TSharedRef<SOverlay> DefaultTitleAreaWidget) override;
virtual void GetOverlayBrushes(bool bSelected, const FVector2D WidgetSize, TArray<FOverlayBrushInfo>& Brushes) const override;
FLinearColor GetNodeTitleColorOverride() const;
FName GetLiteralDataType() const;
UMetasoundEditorGraphNode& GetMetaSoundNode();
const UMetasoundEditorGraphNode& GetMetaSoundNode() const;
public:
static void ExecuteTrigger(UMetasoundEditorGraphMemberDefaultLiteral& Literal);
static TSharedRef<SWidget> CreateTriggerSimulationWidget(UMetasoundEditorGraphMemberDefaultLiteral& Literal, TAttribute<EVisibility>&& InVisibility, TAttribute<bool>&& InEnablement, const FText* InToolTip = nullptr);
private:
// If this node represents a graph member node, returns corresponding member.
UMetasoundEditorGraphMember* GetMetaSoundMember();
// If this node represents a graph member node, returns cast node.
UMetasoundEditorGraphMemberNode* GetMetaSoundMemberNode();
TAttribute<EVisibility> GetSimulationVisibilityAttribute() const;
// Slider widget for float input
TSharedPtr<SAudioInputWidget> InputWidget;
// Handle for on value changed delegate for input slider
FDelegateHandle InputSliderOnValueChangedDelegateHandle;
// Handle for on input slider range changed
FDelegateHandle InputSliderOnRangeChangedDelegateHandle;
};
} // namespace Editor
} // namespace Metasound