A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SDialogueGraphNode_Base.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3
4#include "Layout/Visibility.h"
5#include "Widgets/DeclarativeSyntaxSupport.h"
6#include "SGraphNode.h"
7#include "SGraphPanel.h"
8
9#include "DialogueGraphNode.h"
10#include "DlgSystemSettings.h"
11
12class SVerticalBox;
13
18{
21
22public:
24 SLATE_END_ARGS()
25
26 void Construct(const FArguments& InArgs, UDialogueGraphNode_Base* InNode);
27
28 // Begin SGraphNode Interface
30 void CreatePinWidgets() override;
31
33 void CreateStandardPinWidget(UEdGraphPin* Pin) override;
34
36 void UpdateGraphNode() override;
37
39 void SetOwner(const TSharedRef<SGraphPanel>& OwnerPanel) override;
40 // End SGraphNode Interface
41
42 // Begin own methods
43
45 virtual EVisibility GetNodeVisibility() const { return EVisibility::Visible; }
46
47protected:
48 // SGraphNode Interface
54 void AddPin(const TSharedRef<SGraphPin>& PinToAdd) override;
55
57 TSharedPtr<SGraphPin> CreatePinWidget(UEdGraphPin* Pin) const override;
58
59private:
61 bool IsValidPin(UEdGraphPin* Pin)
62 {
63 return ensureMsgf(Pin->GetOuter() == GraphNode,
64 TEXT("Graph node ('%s' - %s) has an invalid %s pin: '%s'; (with a bad %s outer: '%s'); skiping creation of a widget for this pin."),
65 *GraphNode->GetNodeTitle(ENodeTitleType::ListView).ToString(),
66 *GraphNode->GetPathName(),
67 Pin->Direction == EEdGraphPinDirection::EGPD_Input ? TEXT("input") : TEXT("output"),
68 Pin->PinFriendlyName.IsEmpty() ? *Pin->PinName.ToString() : *Pin->PinFriendlyName.ToString(),
69 Pin->GetOuter() ? *Pin->GetOuter()->GetClass()->GetName() : TEXT("UNKNOWN"),
70 Pin->GetOuter() ? *Pin->GetOuter()->GetPathName() : TEXT("NULL"));
71 }
72
73protected:
74 // The Base dialogue node this widget represents
76
77 // Cache the Dialogue settings
78 const UDlgSystemSettings* Settings = nullptr;
79
81 TSharedPtr<SVerticalBox> PinsNodeBox;
82};
TSharedPtr< SGraphPin > CreatePinWidget(UEdGraphPin *Pin) const override
const UDlgSystemSettings * Settings
SDialogueGraphNode_Base Self
UDialogueGraphNode_Base * DialogueGraphNode_Base
void AddPin(const TSharedRef< SGraphPin > &PinToAdd) override
virtual EVisibility GetNodeVisibility() const
void SetOwner(const TSharedRef< SGraphPanel > &OwnerPanel) override
TSharedPtr< SVerticalBox > PinsNodeBox
void Construct(const FArguments &InArgs, UDialogueGraphNode_Base *InNode)
bool IsValidPin(UEdGraphPin *Pin)
void CreateStandardPinWidget(UEdGraphPin *Pin) override
UCLASS(Config = Engine, DefaultConfig, meta = (DisplayName = "Dialogue System Settings"))