A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
FDialogueEditorUtilities Class Reference

#include <DialogueEditorUtilities.h>

Static Public Member Functions

static bool AreDialogueNodesInSyncWithGraphNodes (const UDlgDialogue *Dialogue)
 
static void AutoPositionGraphNodes (UDialogueGraphNode *RootNode, const TArray< UDialogueGraphNode * > &GraphNodes, int32 OffsetBetweenColumnsX, int32 OffsetBetweenRowsY, bool bIsDirectionVertical)
 
static UEdGraphNode_Comment * BlueprintAddComment (UBlueprint *Blueprint, const FString &CommentString, FVector2D Location=FVector2D::ZeroVector)
 
static UK2Node_Event * BlueprintGetEvent (UBlueprint *Blueprint, FName EventName, UClass *EventClassSignature)
 
static UEdGraphBlueprintGetFunction (UBlueprint *Blueprint, FName FunctionName, UClass *FunctionClassSignature)
 
static UK2Node_Event * BlueprintGetOrAddEvent (UBlueprint *Blueprint, FName EventName, UClass *EventClassSignature)
 
static UEdGraphBlueprintGetOrAddFunction (UBlueprint *Blueprint, FName FunctionName, UClass *FunctionClassSignature)
 
static bool CanConvertSpeechNodesToSpeechSequence (const TSet< UObject * > &SelectedNodes)
 
static bool CanConvertSpeechNodesToSpeechSequence (const TSet< UObject * > &SelectedNodes, TArray< UDialogueGraphNode * > &OutSelectedGraphNodes)
 
static bool CanConvertSpeechSequenceNodeToSpeechNodes (const TSet< UObject * > &SelectedNodes)
 
static bool CheckAndTryToFixDialogue (UDlgDialogue *Dialogue, bool bDisplayWarning=true)
 
static void CloseOtherEditors (UObject *Asset, IAssetEditorInstance *OnlyEditor)
 
static void CopyNodeChildren (const UDialogueGraphNode *FromNode, UDialogueGraphNode *ToNode)
 
static UEdGraphCreateNewGraph (UObject *ParentScope, FName GraphName, TSubclassOf< UEdGraph > GraphClass, TSubclassOf< UEdGraphSchema > SchemaClass)
 
static bool DeleteAllDialoguesTextFiles ()
 
static IAssetEditorInstance * FindEditorForAsset (UObject *Asset, bool bFocusIfOpen)
 
static bool GetBoundsForSelectedNodes (const UEdGraph *Graph, FSlateRect &Rect, float Padding=0.0f)
 
static UDlgNodeGetClosestNodeFromGraphNode (UEdGraphNode *GraphNode)
 
static UDlgDialogueGetDialogueForGraph (const UEdGraph *Graph)
 
static UDlgDialogueGetDialogueFromGraphNode (const UEdGraphNode *GraphNode)
 
static UDialogueGraphNode_EdgeGetLastTargetGraphEdgeBeforeDrag (const UEdGraph *Graph)
 
static const TSet< UObject * > GetSelectedNodes (const UEdGraph *Graph)
 
static bool IsPointInsideGeometry (const FVector2D &TestPoint, const FGeometry &Geometry)
 
static bool JumpToGraphNode (const UEdGraphNode *GraphNode)
 
static bool JumpToGraphNodeIndex (const UDlgDialogue *Dialogue, int32 NodeIndex)
 
static void LoadAllDialoguesAndCheckGUIDs ()
 
static bool OpenBlueprintEditor (UBlueprint *Blueprint, EDialogueBlueprintOpenType OpenType=EDialogueBlueprintOpenType::None, FName FunctionNameToOpen=NAME_None, bool bForceFullEditor=true, bool bAddBlueprintFunctionIfItDoesNotExist=false)
 
static bool OpenEditorAndJumpToGraphNode (const UEdGraphNode *GraphNode, bool bFocusIfOpen=false)
 
static bool OpenEditorForAsset (const UObject *Asset)
 
static bool PickChildrenOfClass (const FText &TitleText, UClass *&OutChosenClass, UClass *Class)
 
static void Refresh (const UEdGraph *Graph, bool bRestorePreviousSelection)
 
static void RefreshDetailsView (const UEdGraph *Graph, bool bRestorePreviousSelection)
 
static void RemapOldIndicesWithNewAndUpdateGUID (const TArray< UDialogueGraphNode * > &GraphNodes, const TMap< int32, int32 > &OldToNewIndexMap)
 
static bool RemoveNode (UEdGraphNode *NodeToRemove)
 
static void ReplaceParentConnectionsToNode (const UDialogueGraphNode *OldNode, const UDialogueGraphNode *NewNode)
 
static bool SaveAllDialogues ()
 
static void SetLastTargetGraphEdgeBeforeDrag (const UEdGraph *Graph, UDialogueGraphNode_Edge *InEdge)
 
static EAppReturnType::Type ShowMessageBox (EAppMsgType::Type MsgType, const FString &Text, const FString &Caption)
 
template<typename GraphNodeType >
static GraphNodeType * SpawnGraphNodeFromTemplate (UEdGraph *ParentGraph, const FIntPoint &Location, bool bSelectNewNode=true)
 
static void TryToCreateDefaultGraph (UDlgDialogue *Dialogue, bool bPrompt=true)
 

Private Member Functions

 FDialogueEditorUtilities ()=delete
 

Static Private Member Functions

static TSharedPtr< class IDialogueEditorGetDialogueEditorForGraph (const UEdGraph *Graph)
 

Detailed Description

Definition at line 29 of file DialogueEditorUtilities.h.

Constructor & Destructor Documentation

◆ FDialogueEditorUtilities()

FDialogueEditorUtilities::FDialogueEditorUtilities ( )
privatedelete

Member Function Documentation

◆ AreDialogueNodesInSyncWithGraphNodes()

bool FDialogueEditorUtilities::AreDialogueNodesInSyncWithGraphNodes ( const UDlgDialogue * Dialogue)
static

Tells us if the number of dialogue nodes matches with the number of graph nodes (corresponding to dialogues).

Definition at line 355 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ AutoPositionGraphNodes()

void FDialogueEditorUtilities::AutoPositionGraphNodes ( UDialogueGraphNode * RootNode,
const TArray< UDialogueGraphNode * > & GraphNodes,
int32 OffsetBetweenColumnsX,
int32 OffsetBetweenRowsY,
bool bIsDirectionVertical )
static

Automatically reposition all the nodes in the graph.

Parameters
RootNodeThe Node that is considered the node
GraphNodesThe rest of the graph nodes
OffsetBetweenColumnsXThe offset between nodes on the X axis
OffsetBetweenRowsYThe offset between nodes on the Y axis
bIsDirectionVerticalIs direction vertical? If false it is horizontal

Definition at line 393 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BlueprintAddComment()

UEdGraphNode_Comment * FDialogueEditorUtilities::BlueprintAddComment ( UBlueprint * Blueprint,
const FString & CommentString,
FVector2D Location = FVector2D::ZeroVector )
static

Definition at line 1119 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ BlueprintGetEvent()

UK2Node_Event * FDialogueEditorUtilities::BlueprintGetEvent ( UBlueprint * Blueprint,
FName EventName,
UClass * EventClassSignature )
static

Definition at line 1099 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ BlueprintGetFunction()

UEdGraph * FDialogueEditorUtilities::BlueprintGetFunction ( UBlueprint * Blueprint,
FName FunctionName,
UClass * FunctionClassSignature )
static

Definition at line 1035 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ BlueprintGetOrAddEvent()

UK2Node_Event * FDialogueEditorUtilities::BlueprintGetOrAddEvent ( UBlueprint * Blueprint,
FName EventName,
UClass * EventClassSignature )
static

Definition at line 1066 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BlueprintGetOrAddFunction()

UEdGraph * FDialogueEditorUtilities::BlueprintGetOrAddFunction ( UBlueprint * Blueprint,
FName FunctionName,
UClass * FunctionClassSignature )
static

Definition at line 1015 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CanConvertSpeechNodesToSpeechSequence() [1/2]

static bool FDialogueEditorUtilities::CanConvertSpeechNodesToSpeechSequence ( const TSet< UObject * > & SelectedNodes)
inlinestatic

Definition at line 145 of file DialogueEditorUtilities.h.

Here is the call graph for this function:

◆ CanConvertSpeechNodesToSpeechSequence() [2/2]

bool FDialogueEditorUtilities::CanConvertSpeechNodesToSpeechSequence ( const TSet< UObject * > & SelectedNodes,
TArray< UDialogueGraphNode * > & OutSelectedGraphNodes )
static

Tells us if the selected nodes can be converted to a speech sequence node.

Parameters
SelectedNodesThe selected graph nodes we do the checking on.
OutSelectedGraphNodesThe result graph nodes if the we can do the conversion.
Returns
bool If true, the selected graph nodes (filtered and sorted) will be in set in the OutSelectedGraphNodes array. If false, the OutSelectedGraphNodes will be empty

Definition at line 552 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CanConvertSpeechSequenceNodeToSpeechNodes()

bool FDialogueEditorUtilities::CanConvertSpeechSequenceNodeToSpeechNodes ( const TSet< UObject * > & SelectedNodes)
static

Tells us if the selected nodes (should be only one) can be converted from a speech sequence to speech nodes

Parameters
SelectedNodesThe selected graph nodes we do the checking on.
Returns
bool If we can do the conversion

Definition at line 663 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:

◆ CheckAndTryToFixDialogue()

bool FDialogueEditorUtilities::CheckAndTryToFixDialogue ( UDlgDialogue * Dialogue,
bool bDisplayWarning = true )
static

Helper function that checks if the data is valid in the Dialogue/Graph and tries to fix the data.

Definition at line 232 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CloseOtherEditors()

void FDialogueEditorUtilities::CloseOtherEditors ( UObject * Asset,
IAssetEditorInstance * OnlyEditor )
static

Close any editor which is not this one

Definition at line 678 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CopyNodeChildren()

void FDialogueEditorUtilities::CopyNodeChildren ( const UDialogueGraphNode * FromNode,
UDialogueGraphNode * ToNode )
static

Copy all children of the FromNode to be also the children of ToNode.

Parameters
FromNodeSource Node
ToNodeDestination Node

Definition at line 777 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateNewGraph()

UEdGraph * FDialogueEditorUtilities::CreateNewGraph ( UObject * ParentScope,
FName GraphName,
TSubclassOf< UEdGraph > GraphClass,
TSubclassOf< UEdGraphSchema > SchemaClass )
static

Creates a new empty graph.

Parameters
ParentScopeThe outer of the new graph (typically a blueprint).
GraphNameName of the graph to add.
SchemaClassSchema to use for the new graph.
Returns
nullptr if it fails, else ther new created graph

Definition at line 188 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ DeleteAllDialoguesTextFiles()

bool FDialogueEditorUtilities::DeleteAllDialoguesTextFiles ( )
static

Definition at line 927 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindEditorForAsset()

IAssetEditorInstance * FDialogueEditorUtilities::FindEditorForAsset ( UObject * Asset,
bool bFocusIfOpen )
static

Returns the primary editor if one is already open for the specified asset. If there is one open and bFocusIfOpen is true, that editor will be brought to the foreground and focused if possible.

Definition at line 706 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBoundsForSelectedNodes()

bool FDialogueEditorUtilities::GetBoundsForSelectedNodes ( const UEdGraph * Graph,
FSlateRect & Rect,
float Padding = 0.0f )
static

Get the bounding area for the currently selected nodes

Parameters
GraphThe Graph we are finding bounds for
RectFinal output bounding area, including padding
PaddingAn amount of padding to add to all sides of the bounds
Returns
false if nothing is selected

Definition at line 95 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetClosestNodeFromGraphNode()

UDlgNode * FDialogueEditorUtilities::GetClosestNodeFromGraphNode ( UEdGraphNode * GraphNode)
static

Definition at line 367 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ GetDialogueEditorForGraph()

TSharedPtr< class IDialogueEditor > FDialogueEditorUtilities::GetDialogueEditorForGraph ( const UEdGraph * Graph)
staticprivate

Definition at line 144 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDialogueForGraph()

static UDlgDialogue * FDialogueEditorUtilities::GetDialogueForGraph ( const UEdGraph * Graph)
inlinestatic

Gets the Dialogue from the Graph

Definition at line 109 of file DialogueEditorUtilities.h.

Here is the caller graph for this function:

◆ GetDialogueFromGraphNode()

UDlgDialogue * FDialogueEditorUtilities::GetDialogueFromGraphNode ( const UEdGraphNode * GraphNode)
static

Definition at line 888 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ GetLastTargetGraphEdgeBeforeDrag()

UDialogueGraphNode_Edge * FDialogueEditorUtilities::GetLastTargetGraphEdgeBeforeDrag ( const UEdGraph * Graph)
static

Useful for setting the last target edge on drap operations.

Definition at line 124 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSelectedNodes()

const TSet< UObject * > FDialogueEditorUtilities::GetSelectedNodes ( const UEdGraph * Graph)
static

Gets the nodes that are currently selected

Definition at line 84 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsPointInsideGeometry()

static bool FDialogueEditorUtilities::IsPointInsideGeometry ( const FVector2D & TestPoint,
const FGeometry & Geometry )
inlinestatic

Definition at line 205 of file DialogueEditorUtilities.h.

Here is the caller graph for this function:

◆ JumpToGraphNode()

bool FDialogueEditorUtilities::JumpToGraphNode ( const UEdGraphNode * GraphNode)
static

Definition at line 744 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ JumpToGraphNodeIndex()

bool FDialogueEditorUtilities::JumpToGraphNodeIndex ( const UDlgDialogue * Dialogue,
int32 NodeIndex )
static

Definition at line 761 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadAllDialoguesAndCheckGUIDs()

void FDialogueEditorUtilities::LoadAllDialoguesAndCheckGUIDs ( )
static

Definition at line 37 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenBlueprintEditor()

bool FDialogueEditorUtilities::OpenBlueprintEditor ( UBlueprint * Blueprint,
EDialogueBlueprintOpenType OpenType = EDialogueBlueprintOpenType::None,
FName FunctionNameToOpen = NAME_None,
bool bForceFullEditor = true,
bool bAddBlueprintFunctionIfItDoesNotExist = false )
static

Definition at line 965 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenEditorAndJumpToGraphNode()

bool FDialogueEditorUtilities::OpenEditorAndJumpToGraphNode ( const UEdGraphNode * GraphNode,
bool bFocusIfOpen = false )
static

Tries to open an Dialogue editor for the GraphNode and jumps to it. Returns true if the asset is opened in an editor. If the file is already open in an editor, it will not create another editor window but instead bring it to front

Definition at line 720 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenEditorForAsset()

bool FDialogueEditorUtilities::OpenEditorForAsset ( const UObject * Asset)
static

Tries to open the editor for the specified asset. Returns true if the asset is opened in an editor. If the file is already open in an editor, it will not create another editor window but instead bring it to front

Definition at line 692 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PickChildrenOfClass()

bool FDialogueEditorUtilities::PickChildrenOfClass ( const FText & TitleText,
UClass *& OutChosenClass,
UClass * Class )
static

Definition at line 945 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ Refresh()

void FDialogueEditorUtilities::Refresh ( const UEdGraph * Graph,
bool bRestorePreviousSelection )
static

Definition at line 115 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:

◆ RefreshDetailsView()

void FDialogueEditorUtilities::RefreshDetailsView ( const UEdGraph * Graph,
bool bRestorePreviousSelection )
static

Refreshes the details panel for the editor of the specified Graph.

Definition at line 106 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:

◆ RemapOldIndicesWithNewAndUpdateGUID()

void FDialogueEditorUtilities::RemapOldIndicesWithNewAndUpdateGUID ( const TArray< UDialogueGraphNode * > & GraphNodes,
const TMap< int32, int32 > & OldToNewIndexMap )
static

Replaces all references to old Node indices from the provided GraphNodes with new indices. This can happen inside Conditions of type WasNodeVisited and HasSatisfiedChild because the NodeIndex is a weak reference. Also sets the correct GUID to nodes that reference the GUID

Parameters
GraphNodesThe nodes we are replacing the old references
OldToNewIndexMapMap that tells us the mapping from old index to new index. Maps from old index -> new index

Definition at line 817 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveNode()

bool FDialogueEditorUtilities::RemoveNode ( UEdGraphNode * NodeToRemove)
static

Helper function to remove the provided node from it's graph. Returns true on success, false otherwise.

Definition at line 160 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReplaceParentConnectionsToNode()

void FDialogueEditorUtilities::ReplaceParentConnectionsToNode ( const UDialogueGraphNode * OldNode,
const UDialogueGraphNode * NewNode )
static

Replace all connection to the OldNode, so that they point to the NewNode. Make all parents of the OldNode point to NewNode instead.

Parameters
OldNodeThe old child node that will have its conections from its parents removed and replaced to point to NewNode.
NewNodeThe new child node that will have the connections to the parents of OldNode

Definition at line 795 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveAllDialogues()

bool FDialogueEditorUtilities::SaveAllDialogues ( )
static

Definition at line 904 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetLastTargetGraphEdgeBeforeDrag()

void FDialogueEditorUtilities::SetLastTargetGraphEdgeBeforeDrag ( const UEdGraph * Graph,
UDialogueGraphNode_Edge * InEdge )
static

Definition at line 135 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowMessageBox()

EAppReturnType::Type FDialogueEditorUtilities::ShowMessageBox ( EAppMsgType::Type MsgType,
const FString & Text,
const FString & Caption )
static

Definition at line 811 of file DialogueEditorUtilities.cpp.

Here is the caller graph for this function:

◆ SpawnGraphNodeFromTemplate()

template<typename GraphNodeType >
static GraphNodeType * FDialogueEditorUtilities::SpawnGraphNodeFromTemplate ( UEdGraph * ParentGraph,
const FIntPoint & Location,
bool bSelectNewNode = true )
inlinestatic

Spawns a GraphNode in the specified ParentGraph and at Location.

Definition at line 34 of file DialogueEditorUtilities.h.

◆ TryToCreateDefaultGraph()

void FDialogueEditorUtilities::TryToCreateDefaultGraph ( UDlgDialogue * Dialogue,
bool bPrompt = true )
static

Tries to create the default graph for the Dialogue if the number of nodes differ from the dialogue data and the graph data

Parameters
DialogueThe Dialogue we want to create the default graph for.
bPromptIndicates if we should prompt the user for a response.

Definition at line 306 of file DialogueEditorUtilities.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: