4#include "Toolkits/IToolkit.h"
5#include "Toolkits/ToolkitManager.h"
6#include "Templates/Casts.h"
7#include "Containers/Queue.h"
8#include "EdGraphNode_Comment.h"
9#include "FileHelpers.h"
10#include "Kismet2/BlueprintEditorUtils.h"
11#include "Kismet2/SClassPickerDialog.h"
20#include "Kismet2/KismetEditorUtilities.h"
21#include "K2Node_Event.h"
43 UE_LOG(LogDlgSystemEditor, Log, TEXT(
"UDlgManager::LoadAllDialoguesIntoMemory loaded %d Dialogues into Memory"), NumLoadedDialogues);
55 TEXT(
"Dialogue = `%s`, GUID = `%s` has a Duplicate GUID. Regenerating."),
71 TEXT(
"Dialogue = `%s`, GUID = `%s`"),
78 TEXT(
"(╯°□°)╯︵ ┻━┻ Congrats, you just broke the universe, are you even human? Now please go and proove an NP complete problem."
79 "The chance of generating two equal random FGuid (picking 4, uint32 numbers) is p = 9.3132257 * 10^(-10) % (or something like this)")
87 if (DialogueEditor.IsValid())
89 return DialogueEditor->GetSelectedNodes();
98 if (DialogueEditor.IsValid())
100 return DialogueEditor->GetBoundsForSelectedNodes(Rect, Padding);
109 if (DialogueEditor.IsValid())
111 DialogueEditor->RefreshDetailsView(bRestorePreviousSelection);
118 if (DialogueEditor.IsValid())
120 DialogueEditor->Refresh(bRestorePreviousSelection);
127 if (DialogueEditor.IsValid())
129 return DialogueEditor->GetLastTargetGraphEdgeBeforeDrag();
138 if (DialogueEditor.IsValid())
140 DialogueEditor->SetLastTargetGraphEdgeBeforeDrag(InEdge);
148 TSharedPtr<IDialogueEditor> DialogueEditor;
151 TSharedPtr<IToolkit> FoundAssetEditor = FToolkitManager::Get().FindEditorForAsset(
Dialogue);
152 if (FoundAssetEditor.IsValid())
154 DialogueEditor = StaticCastSharedPtr<IDialogueEditor>(FoundAssetEditor);
157 return DialogueEditor;
162 if (!IsValid(NodeToRemove))
167 UDialogueGraph* Graph = CastChecked<UDialogueGraph>(NodeToRemove->GetGraph());
176 UE_LOG(LogDlgSystemEditor, Fatal, TEXT(
"FDialogueEditorUtilities::RemoveNode No transaction was declared before calling this method, aborting!"));
179 if (!NodeToRemove->Modify())
181 UE_LOG(LogDlgSystemEditor, Fatal, TEXT(
"FDialogueEditorUtilities::RemoveNode No transaction was declared before calling this method, aborting!"));
191 TSubclassOf<UEdGraph> GraphClass,
192 TSubclassOf<UEdGraphSchema> SchemaClass
197 bool bRename =
false;
200 if (GraphName != NAME_None)
202 UEdGraph* ExistingGraph = FindObject<UEdGraph>(ParentScope, *(GraphName.ToString()));
203 ensureMsgf(!ExistingGraph, TEXT(
"Graph %s already exists: %s"), *GraphName.ToString(), *ExistingGraph->GetFullName());
208 ExistingGraph->Rename(
nullptr, ExistingGraph->GetOuter(), REN_DoNotDirty | REN_ForceNoResetLoaders);
212 NewGraph = NewObject<UEdGraph>(ParentScope, GraphClass, NAME_None, RF_Transactional);
218 NewGraph = NewObject<UEdGraph>(ParentScope, GraphClass, NAME_None, RF_Transactional);
221 NewGraph->Schema = SchemaClass;
226 NewGraph->Rename(*GraphName.ToString(), ParentScope, REN_DoNotDirty | REN_ForceNoResetLoaders);
234 bool bIsDataValid =
true;
236 const TArray<UDlgNode*>& DialogueNodes =
Dialogue->GetNodes();
238 auto checkIfMultipleEdgesToSameNode = [DialogueNodes, bDisplayWarning](
UDlgNode* Node)
245 TSet<int32> NodeEdgesFound;
246 TSet<int32> EdgesToRemove;
248 const TArray<FDlgEdge>& NodeChildren = Node->GetNodeChildren();
249 for (int32 EdgeIndex = 0, EdgesNum = NodeChildren.Num(); EdgeIndex < EdgesNum; EdgeIndex++)
251 const FDlgEdge& Edge = NodeChildren[EdgeIndex];
260 EdgesToRemove.Add(EdgeIndex);
262 if (!bDisplayWarning)
269 int32 IndexFromNode = DialogueNodes.Find(Node);
270 if (IndexFromNode == INDEX_NONE)
275 const FString Message = FString::Printf(
276 TEXT(
"Node with index = `%d` connects multiple times to destination Node with index = `%d`. One of the Edges will be removed."),
277 IndexFromNode, IndexToNode);
278 ShowMessageBox(EAppMsgType::Ok, Message, TEXT(
"Invalid Dialogue data"));
287 for (int32 EdgeIndex : EdgesToRemove)
289 Node->RemoveChildAt(EdgeIndex);
292 return EdgesToRemove.Num() == 0;
295 bIsDataValid = bIsDataValid && checkIfMultipleEdgesToSameNode(
Dialogue->GetMutableStartNode());
296 for (
UDlgNode* Node : DialogueNodes)
298 bIsDataValid = bIsDataValid && checkIfMultipleEdgesToSameNode(Node);
318 Dialogue->InitialSyncWithTextFile();
326 const EAppReturnType::Type Response =
ShowMessageBox(EAppMsgType::YesNo,
327 FString::Printf(TEXT(
"Initial sync the Dialogues nodes of `%s` from the text file with the same name?"), *
Dialogue->GetName()),
328 TEXT(
"Get Dialogue nodes from the text file"));
330 if (Response == EAppReturnType::Yes)
332 Dialogue->InitialSyncWithTextFile();
339 const int32 NumGraphNodes = CastChecked<UDialogueGraph>(
Dialogue->GetGraph())->GetAllDialogueGraphNodes().Num();
340 const int32 NumDialogueNodes =
Dialogue->GetNodes().Num() + 1;
341 const FString Message = FString::Printf(TEXT(
"Dialogue with name = `%s` has number of graph nodes (%d) != number dialogue nodes (%d)."),
342 *
Dialogue->GetName(), NumGraphNodes, NumDialogueNodes);
343 const EAppReturnType::Type Response =
ShowMessageBox(EAppMsgType::YesNo,
344 FString::Printf(TEXT(
"%s%s"), *Message, TEXT(
"\nWould you like to autogenerate the graph nodes from the dialogue nodes?\n WARNING: Graph nodes will be lost")),
345 TEXT(
"Autogenerate graph nodes from dialogue nodes?"));
348 if (Response == EAppReturnType::Yes)
357 const int32 NumGraphNodes = CastChecked<UDialogueGraph>(
Dialogue->GetGraph())->GetAllDialogueGraphNodes().Num();
358 const int32 NumDialogueNodes =
Dialogue->GetNodes().Num() + 1;
359 if (NumGraphNodes == NumDialogueNodes)
378 return Node->GetMutableDialogueNode();
384 if (EdgeNode->HasParentNode())
385 return EdgeNode->GetParentNode()->GetMutableDialogueNode();
386 if (EdgeNode->HasChildNode())
387 return EdgeNode->GetChildNode()->GetMutableDialogueNode();
395 const TArray<UDialogueGraphNode*>& GraphNodes,
396 int32 OffsetBetweenColumnsX,
397 int32 OffsetBetweenRowsY,
398 bool bIsDirectionVertical
401 TSet<UDialogueGraphNode*> VisitedNodes;
402 VisitedNodes.Add(RootNode);
403 TQueue<NodeWithParentPosition> Queue;
410 while (Index < GraphNodes.Num() && Node->
GetOutputPin()->LinkedTo.Num() == 0)
412 Node = GraphNodes[Index];
415 if (Node != RootNode)
418 if (bIsDirectionVertical)
427 verify(Queue.Enqueue(ParentPosition));
432 while (!Queue.IsEmpty())
435 verify(Queue.Dequeue(NodeWithPosition));
438 if (bIsDirectionVertical)
450 NodeWithPosition.
ParentNodeX + OffsetBetweenColumnsX,
456 TArray<UDialogueGraphNode*> ChildNodesUnvisited;
460 if (!VisitedNodes.Contains(ChildNode))
462 ChildNodesUnvisited.Add(ChildNode);
467 int32 ChildOffsetPos;
468 if (bIsDirectionVertical)
471 int32 ChildOffsetPosX = Node->NodePosX;
472 if (ChildNodesUnvisited.Num() > 1)
474 ChildOffsetPosX -= OffsetBetweenColumnsX * ChildNodesUnvisited.Num() / 2;
477 ChildOffsetPos = ChildOffsetPosX;
482 int32 ChildOffsetPosY = Node->NodePosY;
483 if (ChildNodesUnvisited.Num() > 1)
485 ChildOffsetPosY -= OffsetBetweenRowsY * ChildNodesUnvisited.Num() / 2;
488 ChildOffsetPos = ChildOffsetPosY;
492 for (int32 ChildIndex = 0, ChildNum = ChildNodesUnvisited.Num(); ChildIndex < ChildNum; ChildIndex++)
495 if (bIsDirectionVertical)
497 ChildNode->
SetPosition(ChildOffsetPos, Node->NodePosY);
501 ChildNode->
SetPosition(Node->NodePosX, ChildOffsetPos);
504 VisitedNodes.Add(ChildNode);
507 if (bIsDirectionVertical)
517 ChildOffsetPos += OffsetBetweenRowsY;
520 Queue.Enqueue(ParentPosition);
525 if (GraphNodes.Num() != VisitedNodes.Num())
527 TSet<UDialogueGraphNode*> NodesSet(GraphNodes);
529 TSet<UDialogueGraphNode*> OrphanedNodes = NodesSet.Difference(VisitedNodes);
533 const FVector2D NodePos = Node->GetGraph()->GetGoodPlaceForNewNode();
534 if (bIsDirectionVertical)
538 NodePos.Y + OffsetBetweenRowsY
544 NodePos.X + OffsetBetweenColumnsX,
553 const TSet<UObject*>& SelectedNodes,
554 TArray<UDialogueGraphNode*>& OutSelectedGraphNodes
557 OutSelectedGraphNodes.Empty();
558 if (SelectedNodes.Num() == 0)
564 const auto returnFailure = [&OutSelectedGraphNodes]() ->
bool
566 OutSelectedGraphNodes.Empty();
572 for (
UObject* Node : SelectedNodes)
575 if (Node->IsA(UDialogueGraphNode_Edge::StaticClass()))
582 if (!IsValid(GraphNode))
584 return returnFailure();
590 return returnFailure();
596 return returnFailure();
599 OutSelectedGraphNodes.Add(GraphNode);
601 if (OutSelectedGraphNodes.Num() == 0)
603 return returnFailure();
614 for (int32 NodeIndex = 0, NodesNum = OutSelectedGraphNodes.Num(); NodeIndex < NodesNum; NodeIndex++)
616 const bool bIsFirstNode = NodeIndex == 0;
617 const bool bIsLastNode = NodeIndex == NodesNum - 1;
624 const TArray<UDialogueGraphNode*> ParentNodes = CurrentGraphNode->
GetParentNodes();
625 if (ParentNodes.Num() > 1)
627 return returnFailure();
631 if (ParentNodes.Num() == 1 &&
632 ParentNodes[0] != OutSelectedGraphNodes[NodeIndex - 1])
634 return returnFailure();
643 const TArray<UDialogueGraphNode*> ChildNodes = CurrentGraphNode->
GetChildNodes();
644 if (ChildNodes.Num() > 1)
646 return returnFailure();
650 if (ChildNodes.Num() == 1 &&
651 ChildNodes[0] != OutSelectedGraphNodes[NodeIndex + 1])
653 return returnFailure();
666 if (SelectedNodes.Num() == 1)
670 return SelectedNode->IsSpeechSequenceNode() &&
680 if (!IsValid(Asset) || !GEditor)
685#if ENGINE_MINOR_VERSION >= 24
686 GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->
CloseOtherEditors(Asset, OnlyEditor);
688 FAssetEditorManager::Get().CloseOtherEditors(Asset, OnlyEditor);
694 if (!IsValid(Asset) || !GEditor)
699#if ENGINE_MINOR_VERSION >= 24
702 return FAssetEditorManager::Get().OpenEditorForAsset(
const_cast<UObject*
>(Asset));
708 if (!IsValid(Asset) || !GEditor)
713#if ENGINE_MINOR_VERSION >= 24
714 return GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->
FindEditorForAsset(Asset, bFocusIfOpen);
716 return FAssetEditorManager::Get().FindEditorForAsset(Asset, bFocusIfOpen);
722 if (!IsValid(GraphNode))
737 EditorInstance->FocusWindow(
const_cast<UEdGraphNode*
>(GraphNode));
746 if (!IsValid(GraphNode))
752 if (DialogueEditor.IsValid())
754 DialogueEditor->JumpToObject(GraphNode);
779 check(FromNode != ToNode);
781 const TArray<UDialogueGraphNode*> ChildNodes = FromNode->
GetChildNodes();
788 verify(GraphSchema->TryCreateConnection(ToNodeOutputPin, ChildNode->GetInputPin()));
797 check(OldNode != NewNode);
799 const TArray<UDialogueGraphNode_Edge*> ParentEdgeNodes = OldNode->
GetParentEdgeNodes();
800 UEdGraphPin* NewNodeInputPin = NewNode->
GetInputPin();
807 verify(GraphSchema->TryCreateConnection(ParentEdgeConnection->GetOutputPin(), NewNodeInputPin));
813 UE_LOG(LogDlgSystemEditor,
Warning, TEXT(
"%s\n%s"), *Caption, *Text);
814 return FPlatformMisc::MessageBoxExt(MsgType, *Text, *Caption);
818 const TArray<UDialogueGraphNode*>& GraphNodes,
819 const TMap<int32, int32>& OldToNewIndexMap
822 if (GraphNodes.Num() == 0)
831 auto UpdateConditionIndex = [&OldToNewIndexMap](
FDlgCondition* ModifiedCondition) ->
bool
833 const int32* NewIndex = OldToNewIndexMap.Find(ModifiedCondition->IntValue);
835 if (NewIndex ==
nullptr)
840 if (ModifiedCondition->IntValue != *NewIndex)
842 ModifiedCondition->IntValue = *NewIndex;
852 UDlgNode* DialogueNode = GraphNode->GetMutableDialogueNode();
853 const TArray<UDialogueGraphNode_Edge*> ChildEdgeNodes = GraphNode->GetChildEdgeNodes();
856 for (int32 ConditionIndex = 0, ConditionNum = DialogueNode->
GetNodeEnterConditions().Num(); ConditionIndex < ConditionNum; ConditionIndex++)
861 UpdateConditionIndex(EnterCondition);
862 EnterCondition->
GUID = Nodes[EnterCondition->
IntValue]->GetGUID();
867 for (int32 EdgeIndex = 0, EdgesNum = DialogueNode->
GetNodeChildren().Num(); EdgeIndex < EdgesNum; EdgeIndex++)
881 ChildEdgeNodes[EdgeIndex]->SetDialogueEdge(*DialogueEdge);
884 GraphNode->CheckDialogueNodeSyncWithGraphNode(
true);
892 return DialogueBaseNode->GetDialogue();
896 if (
const UDialogueGraph* DialogueGraph = Cast<UDialogueGraph>(GraphNode->GetGraph()))
898 return DialogueGraph->GetDialogue();
907 TArray<UPackage*> PackagesToSave;
908 const bool bBatchOnlyInGameDialogues = GetDefault<UDlgSystemSettings>()->bBatchOnlyInGameDialogues;
913 if (bBatchOnlyInGameDialogues && !
Dialogue->IsInProjectDirectory())
919 PackagesToSave.Add(
Dialogue->GetOutermost());
922 static constexpr bool bCheckDirty =
false;
923 static constexpr bool bPromptToSave =
false;
924 return FEditorFileUtils::PromptForCheckoutAndSave(PackagesToSave, bCheckDirty, bPromptToSave) == FEditorFileUtils::EPromptReturnCode::PR_Success;
930 const bool bBatchOnlyInGameDialogues = GetDefault<UDlgSystemSettings>()->bBatchOnlyInGameDialogues;
934 if (bBatchOnlyInGameDialogues && !
Dialogue->IsInProjectDirectory())
949 Filter->AllowedChildrenOfClasses.Add(Class);
952 FClassViewerInitializationOptions Options;
953 Options.Mode = EClassViewerMode::ClassPicker;
956 Options.DisplayMode = Settings->GetUnrealClassPickerDisplayMode();
957 Options.ClassFilter = Filter;
958 Options.bShowUnloadedBlueprints =
true;
959 Options.bExpandRootNodes =
true;
960 Options.NameTypeToDisplay = EClassViewerNameTypeToDisplay::Dynamic;
962 return SClassPickerDialog::PickClass(TitleText, Options, OutChosenClass, Class);
966 UBlueprint* Blueprint,
968 FName FunctionNameToOpen,
969 bool bForceFullEditor,
970 bool bAddBlueprintFunctionIfItDoesNotExist
978 Blueprint->bForceFullEditor = bForceFullEditor;
981 UObject* ObjectToFocusOn =
nullptr;
984 UClass* Class = Blueprint->GeneratedClass;
989 ObjectToFocusOn = bAddBlueprintFunctionIfItDoesNotExist
995 ObjectToFocusOn = bAddBlueprintFunctionIfItDoesNotExist
1002 if (ObjectToFocusOn ==
nullptr)
1004 ObjectToFocusOn = Blueprint->GetLastEditedUberGraph();
1006 if (ObjectToFocusOn)
1008 FKismetEditorUtilities::BringKismetToFocusAttentionOnObject(ObjectToFocusOn);
1017 if (!Blueprint || Blueprint->BlueprintType != BPTYPE_Normal)
1025 return GraphFunction;
1029 UEdGraph* NewGraph = FBlueprintEditorUtils::CreateNewGraph(Blueprint, FunctionName, UEdGraph::StaticClass(), UEdGraphSchema_K2::StaticClass());
1030 FBlueprintEditorUtils::AddFunctionGraph(Blueprint, NewGraph,
false, FunctionClassSignature);
1031 Blueprint->LastEditedDocuments.Add(NewGraph);
1037 if (!Blueprint || Blueprint->BlueprintType != BPTYPE_Normal)
1043 for (
UEdGraph* GraphFunction : Blueprint->FunctionGraphs)
1045 if (FunctionName == GraphFunction->GetFName())
1047 return GraphFunction;
1052 for (
const FBPInterfaceDescription& Interface : Blueprint->ImplementedInterfaces)
1054 for (
UEdGraph* GraphFunction : Interface.Graphs)
1056 if (FunctionName == GraphFunction->GetFName())
1058 return GraphFunction;
1068 if (!Blueprint || Blueprint->BlueprintType != BPTYPE_Normal)
1074 if (UK2Node_Event* EventNode =
BlueprintGetEvent(Blueprint, EventName, EventClassSignature))
1080 if (Blueprint->UbergraphPages.Num())
1082 int32 NodePositionY = 0;
1083 UK2Node_Event* NodeEvent = FKismetEditorUtilities::AddDefaultEventNode(
1085 Blueprint->UbergraphPages[0],
1087 EventClassSignature,
1090 NodeEvent->SetEnabledState(ENodeEnabledState::Enabled);
1091 NodeEvent->NodeComment =
"";
1092 NodeEvent->bCommentBubbleVisible =
false;
1101 if (!Blueprint || Blueprint->BlueprintType != BPTYPE_Normal)
1106 TArray<UK2Node_Event*> AllEvents;
1107 FBlueprintEditorUtils::GetAllNodesOfClass<UK2Node_Event>(Blueprint, AllEvents);
1108 for (UK2Node_Event* EventNode : AllEvents)
1110 if (EventNode->bOverrideFunction && EventNode->EventReference.GetMemberName() == EventName)
1121 if (!Blueprint || Blueprint->BlueprintType != BPTYPE_Normal || Blueprint->UbergraphPages.Num() == 0)
1126 UEdGraph* Graph = Blueprint->UbergraphPages[0];
1127 TSharedPtr<FEdGraphSchemaAction> Action = Graph->GetSchema()->GetCreateCommentAction();
1128 if (!Action.IsValid())
1133 UEdGraphNode* GraphNode = Action->PerformAction(Graph,
nullptr, Location);
1134 if (UEdGraphNode_Comment* CommentNode = Cast<UEdGraphNode_Comment>(GraphNode))
1136 CommentNode->NodeComment = CommentString;
EDialogueBlueprintOpenType
static bool OpenEditorAndJumpToGraphNode(const UEdGraphNode *GraphNode, bool bFocusIfOpen=false)
static bool DeleteAllDialoguesTextFiles()
static void CopyNodeChildren(const UDialogueGraphNode *FromNode, UDialogueGraphNode *ToNode)
static IAssetEditorInstance * FindEditorForAsset(UObject *Asset, bool bFocusIfOpen)
static void RemapOldIndicesWithNewAndUpdateGUID(const TArray< UDialogueGraphNode * > &GraphNodes, const TMap< int32, int32 > &OldToNewIndexMap)
static bool AreDialogueNodesInSyncWithGraphNodes(const UDlgDialogue *Dialogue)
static bool JumpToGraphNodeIndex(const UDlgDialogue *Dialogue, int32 NodeIndex)
static UDialogueGraphNode_Edge * GetLastTargetGraphEdgeBeforeDrag(const UEdGraph *Graph)
static UK2Node_Event * BlueprintGetOrAddEvent(UBlueprint *Blueprint, FName EventName, UClass *EventClassSignature)
static UEdGraph * BlueprintGetFunction(UBlueprint *Blueprint, FName FunctionName, UClass *FunctionClassSignature)
static void TryToCreateDefaultGraph(UDlgDialogue *Dialogue, bool bPrompt=true)
static bool PickChildrenOfClass(const FText &TitleText, UClass *&OutChosenClass, UClass *Class)
static UDlgDialogue * GetDialogueFromGraphNode(const UEdGraphNode *GraphNode)
static UEdGraph * CreateNewGraph(UObject *ParentScope, FName GraphName, TSubclassOf< UEdGraph > GraphClass, TSubclassOf< UEdGraphSchema > SchemaClass)
static TSharedPtr< class IDialogueEditor > GetDialogueEditorForGraph(const UEdGraph *Graph)
static void SetLastTargetGraphEdgeBeforeDrag(const UEdGraph *Graph, UDialogueGraphNode_Edge *InEdge)
static void CloseOtherEditors(UObject *Asset, IAssetEditorInstance *OnlyEditor)
static bool CanConvertSpeechNodesToSpeechSequence(const TSet< UObject * > &SelectedNodes, TArray< UDialogueGraphNode * > &OutSelectedGraphNodes)
static void ReplaceParentConnectionsToNode(const UDialogueGraphNode *OldNode, const UDialogueGraphNode *NewNode)
static bool SaveAllDialogues()
static bool CheckAndTryToFixDialogue(UDlgDialogue *Dialogue, bool bDisplayWarning=true)
static UEdGraphNode_Comment * BlueprintAddComment(UBlueprint *Blueprint, const FString &CommentString, FVector2D Location=FVector2D::ZeroVector)
static bool OpenBlueprintEditor(UBlueprint *Blueprint, EDialogueBlueprintOpenType OpenType=EDialogueBlueprintOpenType::None, FName FunctionNameToOpen=NAME_None, bool bForceFullEditor=true, bool bAddBlueprintFunctionIfItDoesNotExist=false)
static UK2Node_Event * BlueprintGetEvent(UBlueprint *Blueprint, FName EventName, UClass *EventClassSignature)
static bool OpenEditorForAsset(const UObject *Asset)
static void AutoPositionGraphNodes(UDialogueGraphNode *RootNode, const TArray< UDialogueGraphNode * > &GraphNodes, int32 OffsetBetweenColumnsX, int32 OffsetBetweenRowsY, bool bIsDirectionVertical)
static bool GetBoundsForSelectedNodes(const UEdGraph *Graph, FSlateRect &Rect, float Padding=0.0f)
static bool RemoveNode(UEdGraphNode *NodeToRemove)
static const TSet< UObject * > GetSelectedNodes(const UEdGraph *Graph)
static bool CanConvertSpeechSequenceNodeToSpeechNodes(const TSet< UObject * > &SelectedNodes)
static EAppReturnType::Type ShowMessageBox(EAppMsgType::Type MsgType, const FString &Text, const FString &Caption)
static void Refresh(const UEdGraph *Graph, bool bRestorePreviousSelection)
static UEdGraph * BlueprintGetOrAddFunction(UBlueprint *Blueprint, FName FunctionName, UClass *FunctionClassSignature)
static UDlgDialogue * GetDialogueForGraph(const UEdGraph *Graph)
static void LoadAllDialoguesAndCheckGUIDs()
static UDlgNode * GetClosestNodeFromGraphNode(UEdGraphNode *GraphNode)
static void RefreshDetailsView(const UEdGraph *Graph, bool bRestorePreviousSelection)
static bool JumpToGraphNode(const UEdGraphNode *GraphNode)
static TCopyQualifiersFromTo< SetType, typenameSetType::ElementType >::Type * GetFirstSetElement(SetType &Set)
bool RemoveGraphNode(UEdGraphNode *NodeToRemove)
bool Modify(bool bAlwaysMarkDirty=true) override
UEdGraphPin * GetOutputPin() const
virtual void SetPosition(int32 X, int32 Y)
UEdGraphPin * GetInputPin() const
int32 EstimateNodeWidth() const
virtual int32 GetDialogueNodeIndex() const
TArray< UDialogueGraphNode * > GetChildNodes() const
TArray< UDialogueGraphNode * > GetParentNodes() const
const DlgNodeType & GetDialogueNode() const
virtual bool IsRootNode() const
TArray< UDialogueGraphNode_Edge * > GetParentEdgeNodes(bool bCheckChild=true) const
bool IsSpeechNode() const
void SetEdges(const TArray< FDlgEdge > &InEdges)
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
const TArray< UDlgNode * > & GetNodes() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
static int32 LoadAllDialoguesIntoMemory(bool bAsync=false)
static TArray< UDlgDialogue * > GetDialoguesWithDuplicateGUIDs()
static TArray< UDlgDialogue * > GetAllDialoguesFromMemory()
UCLASS(BlueprintType, ClassGroup = "Dialogue")
UCLASS(BlueprintType, Abstract, EditInlineNew, ClassGroup = "Dialogue")
virtual FDlgEdge * GetSafeMutableNodeChildAt(int32 EdgeIndex)
virtual const TArray< FDlgEdge > & GetNodeChildren() const
Gets this nodes children (edges) as a const/mutable array.
virtual FDlgCondition * GetMutableEnterConditionAt(int32 EnterConditionIndex)
virtual const TArray< FDlgCondition > & GetNodeEnterConditions() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UCLASS(Config = Engine, DefaultConfig, meta = (DisplayName = "Dialogue System Settings"))
static bool HasNodeIndex(EDlgConditionType ConditionType)
FGuid GUID
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
int32 IntValue
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
EDlgConditionType ConditionType
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
TArray< FDlgCondition > Conditions
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Edge")
int32 TargetIndex
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Dialogue|Edge", Meta = (ClampMin = -1))
NodeWithParentPosition(UDialogueGraphNode *InNode, const int32 InParentNodeX, const int32 InParentNodeY)
UDialogueGraphNode * Node