9#include "DialogueGraphNode_Edge.generated.h"
30 void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
41 bool Modify(
bool bAlwaysMarkDirty = true) override;
47 bool SuperModify(
bool bAlwaysMarkDirty = true) {
return Super::Modify(bAlwaysMarkDirty); }
51 void AllocateDefaultPins()
override;
54 FText GetNodeTitle(ENodeTitleType::Type TitleType)
const override;
57 FText GetTooltipText()
const override;
60 void PinConnectionListChanged(UEdGraphPin* Pin)
override;
63 void PostPasteNode()
override;
66 FSlateIcon GetIconAndTint(FLinearColor& OutColor)
const override
68 static const FSlateIcon Icon = FSlateIcon(FEditorStyle::GetStyleSetName(),
"Graph.TransitionNode.Icon");
69 OutColor = GetNodeBackgroundColor();
75 FLinearColor GetNodeBackgroundColor()
const override {
return FColorList::White; }
79 bool HasParentNode()
const
83 UEdGraphPin* InputPin = GetInputPin();
84 return InputPin->LinkedTo.Num() == 1 && InputPin->LinkedTo[0] !=
nullptr &&
85 InputPin->LinkedTo[0]->GetOwningNodeUnchecked() !=
nullptr;
92 bool HasChildNode()
const
96 UEdGraphPin* OutputPin = GetOutputPin();
97 return OutputPin->LinkedTo.Num() == 1 && OutputPin->LinkedTo[0] !=
nullptr &&
98 OutputPin->LinkedTo[0]->GetOwningNodeUnchecked() !=
nullptr;
107 check(HasParentNode());
108 return CastChecked<UDialogueGraphNode>(GetInputPin()->LinkedTo[0]->GetOwningNode());
114 check(HasChildNode());
115 return CastChecked<UDialogueGraphNode>(GetOutputPin()->LinkedTo[0]->GetOwningNode());
123 const FDlgEdge& GetDialogueEdge()
const {
return DialogueEdge; }
124 FDlgEdge& GetDialogueEdge() {
return DialogueEdge; }
127 void SetDialogueEdge(
const FDlgEdge& InEdge) { DialogueEdge = InEdge; }
130 void SetDialogueEdgeTargetIndex(int32 InIndex) { DialogueEdge.
TargetIndex = InIndex; }
133 void SetDialogueEdgeText(
const FText& InText)
135 DialogueEdge.SetText(InText);
139 bool HasConditions()
const {
return DialogueEdge.Conditions.Num() > 0; }
142 FLinearColor GetEdgeColor(
bool bIsHovered)
const;
145 bool IsPrimaryEdge()
const {
return bIsPrimaryEdge; }
148 void SetIsPrimaryEdge(
bool bValue) { bIsPrimaryEdge = bValue; }
151 bool ShouldDrawEdge()
const
154 if (HasInputPin() && HasOutputPin())
156 if (!GetParentNode()->ShouldDrawNode() || !GetChildNode()->ShouldDrawNode())
175 void CreateInputPin()
override
177 static const FName PinName(TEXT(
"Input"));
178 static const FName CategoryName(TEXT(
"Transition"));
179 FCreatePinParams PinParams;
180 PinParams.Index = INDEX_PIN_Input;
181 CreatePin(EGPD_Input, CategoryName, PinName, PinParams);
185 void CreateOutputPin()
override
187 static const FName PinName(TEXT(
"Output"));
188 static const FName CategoryName(TEXT(
"Transition"));
189 FCreatePinParams PinParams;
190 PinParams.Index = INDEX_PIN_Output;
191 CreatePin(EGPD_Output, CategoryName, PinName, PinParams);
197 FDlgEdge* GetMutableDialogueEdgeFromParentNode()
const;
201 UPROPERTY(EditAnywhere, Category = DialogueGraphNode, Meta = (ShowOnlyInnerProperties))
209 bool bIsPrimaryEdge = true;
static constexpr int32 INDEX_PIN_Output
bool HasOutputPin() const
UEdGraphPin * GetOutputPin() const
UEdGraphPin * GetInputPin() const
static constexpr int32 INDEX_PIN_Input
bool Modify(bool bAlwaysMarkDirty=true) override
UDialogueGraphNode * GetChildNode() const
bool HasChildNode() const
const FDlgEdge & GetDialogueEdge() const
void PinConnectionListChanged(UEdGraphPin *Pin) override
bool bIsPrimaryEdge
UPROPERTY()
UDialogueGraphNode * GetParentNode() const
void CreateOutputPin() override
FDlgEdge DialogueEdge
UPROPERTY(EditAnywhere, Category = DialogueGraphNode, Meta = (ShowOnlyInnerProperties))
bool SuperModify(bool bAlwaysMarkDirty=true)
void CreateConnections(UDialogueGraphNode *ParentNode, UDialogueGraphNode *ChildNode)
FText GetNodeTitle(ENodeTitleType::Type TitleType) const override
void PostEditChangeProperty(FPropertyChangedEvent &PropertyChangedEvent) override
void SetDialogueEdgeTargetIndex(int32 InIndex)
bool ShouldDrawEdge() const
bool HasConditions() const
FLinearColor GetNodeBackgroundColor() const override
FSlateIcon GetIconAndTint(FLinearColor &OutColor) const override
bool HasParentNode() const
FDlgEdge & GetDialogueEdge()
FLinearColor GetEdgeColor(bool bIsHovered) const
void PostPasteNode() override
FText GetTooltipText() const override
bool IsPrimaryEdge() const
void SetDialogueEdgeText(const FText &InText)
FDlgEdge * GetMutableDialogueEdgeFromParentNode() const
void SetIsPrimaryEdge(bool bValue)
void CreateInputPin() override
void SetDialogueEdge(const FDlgEdge &InEdge)
void AllocateDefaultPins() override
UCLASS(Config = Engine, DefaultConfig, meta = (DisplayName = "Dialogue System Settings"))
bool bShowPrimarySecondaryEdges
UPROPERTY(Category = "Graph Edge", Config, EditAnywhere)
bool bDrawPrimaryEdges
UPROPERTY(Category = "Graph Edge", Config, EditAnywhere)
bool bDrawSecondaryEdges
UPROPERTY(Category = "Graph Edge", Config, EditAnywhere)
TArray< FDlgCondition > Conditions
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Edge")
int32 TargetIndex
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Dialogue|Edge", Meta = (ClampMin = -1))
void SetText(const FText &NewText)