A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SDialogueGraphPin.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3
4#include "Widgets/DeclarativeSyntaxSupport.h"
5#include "Widgets/SCompoundWidget.h"
6#include "SGraphPin.h"
7
8#include "DlgSystemSettings.h"
10
13{
16
17public:
19 SLATE_END_ARGS()
20
21 void Construct(const FArguments& InArgs, UEdGraphPin* InPin);
22
23 // Begin SGraphPin Interface
28 FReply OnPinMouseDown(const FGeometry& SenderGeometry, const FPointerEvent& MouseEvent) override;
29
30 // SWidget interface
38 FReply OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
39
47 FReply OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
48
55 void OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
56
62 void OnMouseLeave(const FPointerEvent& MouseEvent) override;
63
64 //
65 // DRAG AND DROP (DragDrop)
66 //
84 void OnDragEnter(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
85
91 void OnDragLeave(const FDragDropEvent& DragDropEvent) override;
92
100 FReply OnDragOver(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
101
109 FReply OnDrop(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
110 // End of SWidget interface
111
112protected:
113 // Begin SGraphPin Interface
115 TSharedRef<SWidget> GetDefaultValueWidget() override
116 {
117 return SNew(STextBlock);
118 }
119
121 FSlateColor GetPinColor() const override
122 {
123 const UDlgSystemSettings* Settings = GetDefault<UDlgSystemSettings>();
124 return IsHovered() ? Settings->BorderHoveredBackgroundColor : Settings->BorderBackgroundColor;
125 }
126
127 // Begin own functions
129 FReply OnAltAndLeftMouseButtonDown(const FGeometry& SenderGeometry, const FPointerEvent& MouseEvent);
130
132 FReply OnCtrlAndLeftMouseButtonDown(const FGeometry& SenderGeometry, const FPointerEvent& MouseEvent);
133
135 FText GetTooltipText() const;
136
138 UEdGraphPin* GetBestLinkedToPinFromSplineMousePosition(const FVector2D& MousePosition) const;
139
141 const FSlateBrush* GetPinBorder() const
142 {
143 return FEditorStyle::GetBrush(TEXT("Graph.StateNode.Body"));
144 }
145};
TSharedRef< SWidget > GetDefaultValueWidget() override
FReply OnDrop(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
SDialogueGraphPin Self
FText GetTooltipText() const
void OnDragLeave(const FDragDropEvent &DragDropEvent) override
void OnMouseEnter(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
FReply OnCtrlAndLeftMouseButtonDown(const FGeometry &SenderGeometry, const FPointerEvent &MouseEvent)
FReply OnMouseButtonUp(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
void OnMouseLeave(const FPointerEvent &MouseEvent) override
const FSlateBrush * GetPinBorder() const
FReply OnDragOver(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
FSlateColor GetPinColor() const override
FReply OnPinMouseDown(const FGeometry &SenderGeometry, const FPointerEvent &MouseEvent) override
FReply OnMouseMove(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
UEdGraphPin * GetBestLinkedToPinFromSplineMousePosition(const FVector2D &MousePosition) const
void Construct(const FArguments &InArgs, UEdGraphPin *InPin)
FReply OnAltAndLeftMouseButtonDown(const FGeometry &SenderGeometry, const FPointerEvent &MouseEvent)
void OnDragEnter(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
UCLASS(Config = Engine, DefaultConfig, meta = (DisplayName = "Dialogue System Settings"))
FLinearColor BorderBackgroundColor
UPROPERTY(Category = "Graph Node Color", Config, EditAnywhere)
FLinearColor BorderHoveredBackgroundColor
UPROPERTY(Category = "Graph Node Color", Config, EditAnywhere)