A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SDialogueActionMenu.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 "SGraphPalette.h"
6#include "GraphEditor.h"
7#include "SGraphActionMenu.h"
8
10
14{
16public:
18 DECLARE_DELEGATE_TwoParams(FDialogueActionMenuClosedReason, bool /*bActionExecuted*/, bool /*bGraphPinContext*/);
19
21 : _Graph(nullptr)
22 , _NewNodePosition(FVector2D::ZeroVector)
23 , _AutoExpandActionMenu(true)
24 {}
25
26 SLATE_ARGUMENT(UEdGraph*, Graph)
27 SLATE_ARGUMENT(FVector2D, NewNodePosition)
28 SLATE_ARGUMENT(TArray<UEdGraphPin*>, DraggedFromPins)
29 SLATE_ARGUMENT(SGraphEditor::FActionMenuClosed, OnClosedCallback)
30 SLATE_ARGUMENT(bool, AutoExpandActionMenu)
31 SLATE_EVENT(FDialogueActionMenuClosedReason, OnCloseReason)
32 SLATE_END_ARGS()
33
34 void Construct(const FArguments& InArgs);
36
37 TSharedPtr<SEditableTextBox> GetFilterTextBox() const { return GraphActionMenu->GetFilterTextBox(); }
38
39protected:
40 void OnActionSelected(const TArray<TSharedPtr<FEdGraphSchemaAction>>& SelectedAction, ESelectInfo::Type InSelectionType);
41
43 void CollectAllActions(FGraphActionListBuilderBase& OutAllActions);
44
45protected:
46 UEdGraph* Graph = nullptr;
47
49 TArray<UEdGraphPin*> DraggedFromPins;
50
52 FVector2D NewNodePosition;
53
56
58 bool bActionExecuted = false;
59
60 // Events for close
61 SGraphEditor::FActionMenuClosed OnClosedCallback;
62 FDialogueActionMenuClosedReason OnCloseReasonCallback;
63
64 // The actual menu
65 TSharedPtr<SGraphActionMenu> GraphActionMenu;
66};
DECLARE_DELEGATE_TwoParams(FDialogueActionMenuClosedReason, bool, bool)
TSharedPtr< SGraphActionMenu > GraphActionMenu
void Construct(const FArguments &InArgs)
TSharedPtr< SEditableTextBox > GetFilterTextBox() const
TArray< UEdGraphPin * > DraggedFromPins
void OnActionSelected(const TArray< TSharedPtr< FEdGraphSchemaAction > > &SelectedAction, ESelectInfo::Type InSelectionType)
SDialogueActionMenu Self
FDialogueActionMenuClosedReason OnCloseReasonCallback
void CollectAllActions(FGraphActionListBuilderBase &OutAllActions)
SGraphEditor::FActionMenuClosed OnClosedCallback