5#include "SSingleObjectDetailsPanel.h"
6#include "Widgets/Docking/SDockTab.h"
7#include "ScopedTransaction.h"
8#include "Framework/Application/SlateApplication.h"
9#include "PropertyEditorModule.h"
10#include "GraphEditor.h"
11#include "Toolkits/IToolkitHost.h"
12#include "IDetailsView.h"
13#include "Framework/Commands/GenericCommands.h"
14#include "GraphEditorActions.h"
15#include "Modules/ModuleManager.h"
16#include "Framework/MultiBox/MultiBoxBuilder.h"
17#include "EdGraphUtilities.h"
18#include "HAL/PlatformApplicationMisc.h"
35#define LOCTEXT_NAMESPACE "DialogueEditor"
48 GEditor->RegisterForUndo(
this);
53 GEditor->UnregisterForUndo(
this);
60 WorkspaceMenuCategory = TabManager->AddLocalWorkspaceMenuCategory(LOCTEXT(
"WorkspaceMenu_DialogueEditor",
"Dialogue Editor"));
61 const TSharedRef<FWorkspaceItem> WorkspaceMenuCategoryRef = WorkspaceMenuCategory.ToSharedRef();
63 FAssetEditorToolkit::RegisterTabSpawners(InTabManager);
66 InTabManager->RegisterTabSpawner(
70 .SetDisplayName(LOCTEXT(
"GraphCanvasTab",
"Viewport"))
71 .SetGroup(WorkspaceMenuCategoryRef)
72 .SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(),
"GraphEditor.EventGraph_16x"));
74 InTabManager->RegisterTabSpawner(
78 .SetDisplayName(LOCTEXT(
"DetailsTabLabel",
"Details"))
79 .SetGroup(WorkspaceMenuCategoryRef)
80 .SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(),
"LevelEditor.Tabs.Details"));
82 InTabManager->RegisterTabSpawner(
86 .SetDisplayName(LOCTEXT(
"PaletteTab",
"Palette"))
87 .SetGroup(WorkspaceMenuCategoryRef)
88 .SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(),
"Kismet.Tabs.Palette"));
90 InTabManager->RegisterTabSpawner(
94 .SetDisplayName(LOCTEXT(
"FindInDialogueTab",
"Find Results"))
95 .SetGroup(WorkspaceMenuCategoryRef)
96 .SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(),
"Kismet.Tabs.FindResults"));
101 FAssetEditorToolkit::UnregisterTabSpawners(InTabManager);
111 return LOCTEXT(
"DialogueEditorAppLabel",
"Dialogue Editor");
118 FFormatNamedArguments Args;
120 Args.Add(TEXT(
"DirtyState"), bDirtyState ? FText::FromString(TEXT(
"*")) : FText::GetEmpty());
121 return FText::Format(LOCTEXT(
"DialogueEditorToolkitName",
"{DialogueName}{DirtyState}"), Args);
130 FAssetEditorToolkit::SaveAsset_Execute();
135 FAssetEditorToolkit::SaveAssetAs_Execute();
144 BringToolkitToFront();
190 if (bRestorePreviousSelection)
196 for (
const TWeakObjectPtr<UObject>& WeakObj : ArrayCopy)
198 if (!WeakObj.IsValid(
false))
210 if (!IsValid(GraphNode))
225 FSlateApplication::Get().DismissAllMenus();
237 if (!IsValid(GraphNode))
256 static constexpr bool bRequestRename =
false;
257 static constexpr bool bSelectNode =
true;
272 TSharedPtr<SFindInDialogues> FindResultsToUse;
273 if (bSetFindWithinDialogue)
285 if (FindResultsToUse.IsValid())
289 FindResultsToUse->FocusForUse(bSetFindWithinDialogue, Filter, bSelectFirstResult);
294 EToolkitMode::Type Mode,
295 const TSharedPtr<IToolkitHost>& InitToolkitHost,
299 Settings = GetMutableDefault<UDlgSystemSettings>();
316 FGraphEditorCommands::Register();
317 FDialogueCommands::Register();
322 const TSharedRef<FTabManager::FLayout> StandaloneDefaultLayout =
323 FTabManager::NewLayout(
"Standalone_DialogueEditor_Layout_v1")
326 FTabManager::NewPrimaryArea()
327 ->SetOrientation(Orient_Vertical)
331 FTabManager::NewStack()
332 ->SetSizeCoefficient(0.1f)
333 ->AddTab(GetToolbarTabId(), ETabState::OpenedTab)
334 ->SetHideTabWell(
true)
339 FTabManager::NewSplitter()
340 ->SetOrientation(Orient_Horizontal)
341 ->SetSizeCoefficient(0.9f)
346 FTabManager::NewStack()
347 ->SetSizeCoefficient(0.3f)
353 FTabManager::NewSplitter()
354 ->SetOrientation(Orient_Vertical)
355 ->SetSizeCoefficient(0.6f)
360 FTabManager::NewStack()
361 ->SetSizeCoefficient(0.8f)
362 ->SetHideTabWell(
true)
369 FTabManager::NewStack()
370 ->SetSizeCoefficient(0.2f)
379 FTabManager::NewStack()
380 ->SetSizeCoefficient(0.1f)
388 constexpr bool bCreateDefaultStandaloneMenu =
true;
389 constexpr bool bCreateDefaultToolbar =
true;
390 constexpr bool bInIsToolbarFocusable =
false;
391 FAssetEditorToolkit::InitAssetEditor(Mode, InitToolkitHost,
DialogueEditorAppName, StandaloneDefaultLayout,
392 bCreateDefaultStandaloneMenu, bCreateDefaultToolbar, InitDialogue, bInIsToolbarFocusable);
397 RegenerateMenusAndToolbars();
416 GraphNode->CheckAll();
436 RemoveEditingObject(OldDialogue);
437 AddEditingObject(NewDialogue);
444 if (
GraphEditorView.IsValid() && PropertyChangedEvent.ChangeType != EPropertyChangeType::Interactive)
456 FDetailsViewArgs DetailsViewArgs;
457 DetailsViewArgs.bUpdatesFromSelection =
false;
458 DetailsViewArgs.bLockable =
false;
459 DetailsViewArgs.bAllowSearch =
true;
460 DetailsViewArgs.NotifyHook =
this;
461 DetailsViewArgs.NameAreaSettings = FDetailsViewArgs::ObjectsUseNameArea;
462 DetailsViewArgs.bHideSelectionTip =
false;
464 FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>(
"PropertyEditor");
465 DetailsView = PropertyEditorModule.CreateDetailView(DetailsViewArgs);
479 FGraphAppearanceInfo AppearanceInfo;
481 AppearanceInfo.CornerText = LOCTEXT(
"AppearanceCornerText_DlgDialogue",
"DIALOGUE");
482 AppearanceInfo.InstructionText = LOCTEXT(
"AppearanceInstructionText_DlgDialogue",
"Right Click to add new nodes.");
485 SGraphEditor::FGraphEditorEvents InEvents;
490 return SNew(SGraphEditor)
493 .Appearance(AppearanceInfo)
495 .GraphEvents(InEvents)
496 .ShowGraphStateOverlay(
false);
511 FGraphEditorCommands::Get().CreateComment,
512 FExecuteAction::CreateLambda([
this]
520 FGenericCommands::Get().SelectAll,
521 FExecuteAction::CreateLambda([
this] {
GraphEditorView->SelectAllNodes(); } ),
522 FCanExecuteAction::CreateLambda([] {
return true; })
526 const auto DialogueCommands = FDialogueCommands::Get();
528 DialogueCommands.ConvertSpeechSequenceNodeToSpeechNodes,
530 FCanExecuteAction::CreateLambda([
this]
532 return FDialogueEditorUtilities::CanConvertSpeechSequenceNodeToSpeechNodes(GetSelectedNodes());
537 DialogueCommands.ConvertSpeechNodesToSpeechSequence,
539 FCanExecuteAction::CreateLambda([
this]
541 return FDialogueEditorUtilities::CanConvertSpeechNodesToSpeechSequence(GetSelectedNodes());
546 FGenericCommands::Get().Delete,
552 FGenericCommands::Get().Copy,
558 FGenericCommands::Get().Paste,
565 DialogueCommands.HideNodes,
570 DialogueCommands.UnHideAllNodes,
576 ToolkitCommands->MapAction(
577 FGenericCommands::Get().Undo,
581 ToolkitCommands->MapAction(
582 FGenericCommands::Get().Redo,
587 ToolkitCommands->MapAction(
588 DialogueCommands.DialogueReloadData,
590 FCanExecuteAction::CreateLambda([
this]
592 return GetSettings().DialogueTextFormat != EDlgDialogueTextFormat::None;
597 ToolkitCommands->MapAction(
598 DialogueCommands.ToggleShowPrimarySecondaryEdges,
599 FExecuteAction::CreateLambda([
this]
601 Settings->SetShowPrimarySecondaryEdges(!GetSettings().bShowPrimarySecondaryEdges);
602 if (GetSettings().bShowPrimarySecondaryEdges)
604 DialogueBeingEdited->InitialCompileDialogueNodesFromGraphNodes();
607 FCanExecuteAction::CreateLambda([] {
return true; } ),
608 FIsActionChecked::CreateLambda([
this] {
return GetSettings().bShowPrimarySecondaryEdges; })
611 ToolkitCommands->MapAction(
612 DialogueCommands.ToggleDrawPrimaryEdges,
613 FExecuteAction::CreateLambda([
this] { Settings->SetDrawPrimaryEdges(!GetSettings().bDrawPrimaryEdges); }),
614 FCanExecuteAction::CreateLambda([
this] {
return GetSettings().bShowPrimarySecondaryEdges; }),
615 FIsActionChecked::CreateLambda([
this] {
return GetSettings().bDrawPrimaryEdges; })
618 ToolkitCommands->MapAction(
619 DialogueCommands.ToggleDrawSecondaryEdges,
620 FExecuteAction::CreateLambda([
this] { Settings->SetDrawSecondaryEdges(!GetSettings().bDrawSecondaryEdges); }),
621 FCanExecuteAction::CreateLambda([
this] {
return GetSettings().bShowPrimarySecondaryEdges; }),
622 FIsActionChecked::CreateLambda([
this] {
return GetSettings().bDrawSecondaryEdges; })
626 ToolkitCommands->MapAction(
627 FDialogueCommands::Get().FindInAllDialogues,
628 FExecuteAction::CreateLambda([
this] { SummonSearchUI(
false); })
632 ToolkitCommands->MapAction(
633 FDialogueCommands::Get().FindInDialogue,
634 FExecuteAction::CreateLambda([
this] { SummonSearchUI(
true); })
641 ToolkitCommands->MapAction(
642 FDialogueCommands::Get().DeleteCurrentDialogueTextFiles,
643 FExecuteAction::CreateLambda([
this]
645 check(DialogueBeingEdited);
646 const FString Text = TEXT(
"Delete All text files for this Dialogue?");
647 const EAppReturnType::Type Response = FPlatformMisc::MessageBoxExt(EAppMsgType::YesNo, *Text, *Text);
648 if (Response == EAppReturnType::Yes)
650 DialogueBeingEdited->DeleteAllTextFiles();
658 TSharedPtr<FExtender> MenuExtender = MakeShared<FExtender>();
661 MenuExtender->AddMenuExtension(
663 EExtensionHook::After,
665 FMenuExtensionDelegate::CreateLambda([
this](FMenuBuilder& MenuBuilder)
667 MenuBuilder.BeginSection(
"EditSearch", LOCTEXT(
"EditMenu_SearchHeading",
"Search") );
669 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().FindInDialogue);
670 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().FindInAllDialogues);
672 MenuBuilder.EndSection();
676 AddMenuExtender(MenuExtender);
681 {FDialogueCommands::Get().DeleteCurrentDialogueTextFiles}
689 constexpr bool bShouldCloseWindowAfterMenuSelection =
true;
690 FMenuBuilder MenuBuilder(bShouldCloseWindowAfterMenuSelection, ToolkitCommands, {});
691 MenuBuilder.BeginSection(
"ViewingOptions", LOCTEXT(
"PrimarySecondaryEdgesMenu",
"Viewing Options"));
693 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().ToggleDrawPrimaryEdges);
694 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().ToggleDrawSecondaryEdges);
696 MenuBuilder.EndSection();
698 return MenuBuilder.MakeWidget();
703 constexpr bool bShouldCloseWindowAfterMenuSelection =
true;
704 FMenuBuilder MenuBuilder(bShouldCloseWindowAfterMenuSelection, ToolkitCommands, {});
705 MenuBuilder.BeginSection(
"OtherURls", LOCTEXT(
"OtherURLsMenu",
"Other URLs"));
707 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().OpenMarketplace);
708 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().OpenWiki);
709 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().OpenDiscord);
710 MenuBuilder.AddMenuEntry(FDialogueCommands::Get().OpenForum);
712 MenuBuilder.EndSection();
714 return MenuBuilder.MakeWidget();
721 TSharedPtr<FExtender> ToolbarExtender = MakeShared<FExtender>();
722 ToolbarExtender->AddToolBarExtension(
724 EExtensionHook::After,
726 FToolBarExtensionDelegate::CreateLambda([
this](FToolBarBuilder& ToolbarBuilder)
728 ToolbarBuilder.BeginSection(
"Dialogue");
730 ToolbarBuilder.AddToolBarButton(FDialogueCommands::Get().DialogueReloadData);
731 ToolbarBuilder.AddToolBarButton(FDialogueCommands::Get().FindInDialogue);
733 ToolbarBuilder.AddToolBarButton(FDialogueCommands::Get().ToggleShowPrimarySecondaryEdges);
734 ToolbarBuilder.AddComboButton(
737 FCanExecuteAction::CreateLambda([
this] {
743 LOCTEXT(
"PrimarySecondaryEdges",
"Viewing Options"),
744 LOCTEXT(
"PrimarySecondaryEdges_ToolTip",
"Viewing settings"),
749 ToolbarBuilder.EndSection();
752 AddToolbarExtender(ToolbarExtender);
758 TSharedPtr<FExtender> ExternalToolbarExtender = MakeShared<FExtender>();
759 ExternalToolbarExtender->AddToolBarExtension(
761 EExtensionHook::After,
763 FToolBarExtensionDelegate::CreateLambda([
this](FToolBarBuilder& ToolbarBuilder)
765 ToolbarBuilder.BeginSection(
"DialogueExternal");
767 ToolbarBuilder.AddToolBarButton(
768 FDialogueCommands::Get().OpenNotYetPlugins,
770 LOCTEXT(
"NotYetPlugins",
"Not Yet: Plugins"),
774 ToolbarBuilder.AddComboButton(
777 LOCTEXT(
"OtherURLs",
"Other URLs"),
778 LOCTEXT(
"OtherURLs_ToolTip",
"Other URLs"),
783 ToolbarBuilder.EndSection();
786 AddToolbarExtender(ExternalToolbarExtender);
793 return SNew(SDockTab)
795 .Icon(FEditorStyle::GetBrush(
"GenericEditor.Tabs.Properties"))
796 .Label(LOCTEXT(
"DialogueDetailsTitle",
"Details"))
797 .TabColorScale(GetTabColorScale())
806 return SNew(SDockTab)
807 .Label(LOCTEXT(
"DialogueGraphCanvasTiele",
"Viewport"))
816 return SNew(SDockTab)
817 .Icon(FEditorStyle::GetBrush(
"Kismet.Tabs.Palette"))
818 .Label(LOCTEXT(
"DialoguePaletteTitle",
"Palette"))
827 return SNew(SDockTab)
828 .Icon(FEditorStyle::GetBrush(
"Kismet.Tabs.FindResults"))
829 .Label(LOCTEXT(
"FindResultsView",
"Find Results"))
837 constexpr bool bCanRedo =
true;
838 if (!GEditor->UndoTransaction(bCanRedo))
840 const FText TransactionName = GEditor->Trans->GetUndoContext(
true).Title;
841 UE_LOG(LogDlgSystemEditor,
Warning, TEXT(
"Undo Transaction with Name = `%s` failed"), *TransactionName.ToString());
849 if (!GEditor->RedoTransaction())
851 const FText TransactionName = GEditor->Trans->GetUndoContext(
true).Title;
852 UE_LOG(LogDlgSystemEditor,
Warning, TEXT(
"Redo Transaction with Name = `%s` failed"), *TransactionName.ToString());
859 check(SelectedNodes.Num() == 1);
870 TArray<UDialogueGraphNode*> OutSelectedGraphNodes;
876 UDialogueGraphNode* Speech_GraphNode = CastChecked<UDialogueGraphNode>(OutSelectedGraphNodes[0]);
885 const FScopedTransaction Transaction(LOCTEXT(
"DialogueEditRemoveSelectedNode",
"Dialogue Editor: Remove Node"));
890 verify(DialogueGraph->
Modify());
893 int32 NumNodesRemoved = 0;
894 int32 NumDialogueNodesRemoved = 0;
895 int32 NumBaseDialogueNodesRemoved = 0;
896 int32 NumEdgeDialogueNodesRemoved = 0;
900 const int32 Initial_GraphNodesNum = DialogueGraph->Nodes.Num();
913 auto RemoveGraphNode = [&NumNodesRemoved](
UEdGraphNode* NodeToRemove)
920 TSet<UDialogueGraphNode_Edge*> RemovedEdges;
921 auto AddToRemovedEdges = [&RemovedEdges, &NumBaseDialogueNodesRemoved, &NumEdgeDialogueNodesRemoved](
UDialogueGraphNode_Edge* NodeEdge)
923 RemovedEdges.Add(NodeEdge);
924 NumBaseDialogueNodesRemoved++;
925 NumEdgeDialogueNodesRemoved++;
928 auto RemoveGraphEdgeNode = [&RemovedEdges, &RemoveGraphNode, &AddToRemovedEdges](
UDialogueGraphNode_Edge* Edge)
930 if (!RemovedEdges.Contains(Edge))
932 RemoveGraphNode(Edge);
933 AddToRemovedEdges(Edge);
938 for (
UObject* NodeObject : SelectedNodes)
940 UEdGraphNode* SelectedNode = CastChecked<UEdGraphNode>(NodeObject);
941 if (!SelectedNode->CanUserDeleteNode())
954 RemoveGraphEdgeNode(ParentNodeEdge);
959 RemoveGraphEdgeNode(ChildNodeEdge);
964 RemoveGraphNode(Node);
965 NumBaseDialogueNodesRemoved++;
966 NumDialogueNodesRemoved++;
972 RemoveGraphEdgeNode(NodeEdge);
978 RemoveGraphNode(SelectedNode);
983 if (NumBaseDialogueNodesRemoved > 0)
994 check(Initial_GraphNodesNum - NumNodesRemoved == DialogueGraph->Nodes.Num());
998 check(NumEdgeDialogueNodesRemoved == RemovedEdges.Num());
1006 if (SelectedNodes.Num() == 1)
1009 return !SelectedNode->IsA(UDialogueGraphNode_Root::StaticClass());
1012 return SelectedNodes.Num() > 0;
1023 Node->PrepareForCopying();
1028 FString ExportedText;
1029 FEdGraphUtilities::ExportNodesToText(SelectedNodes, ExportedText);
1030 FPlatformApplicationMisc::ClipboardCopy(*ExportedText);
1036 Node->PostCopyNode();
1047 if (Node && Node->CanDuplicateNode())
1064 const FScopedTransaction Transaction(FGenericCommands::Get().Paste->GetDescription());
1067 verify(DialogueGraph->
Modify());
1076 FString TextToImport;
1077 FPlatformApplicationMisc::ClipboardPaste(TextToImport);
1080 TSet<UEdGraphNode*> PastedNodes;
1081 FEdGraphUtilities::ImportNodesFromText(DialogueGraph, TextToImport, PastedNodes);
1085 FVector2D AvgNodePosition(0.0f, 0.0f);
1088 AvgNodePosition.X += Node->NodePosX;
1089 AvgNodePosition.Y += Node->NodePosY;
1091 if (PastedNodes.Num() > 0)
1093 const float InvNumNodes = 1.0f / float(PastedNodes.Num());
1094 AvgNodePosition.X *= InvNumNodes;
1095 AvgNodePosition.Y *= InvNumNodes;
1100 TMap<int32, int32> OldToNewIndexMap;
1101 TArray<UDialogueGraphNode*> GraphNodes;
1106 bool bAddToSelection =
true;
1107 bool bPositionNode =
true;
1110 if (
auto* GraphNode = Cast<UDialogueGraphNode>(Node))
1113 const int32 OldNodeIndex = GraphNode->GetDialogueNodeIndex();
1115 GraphNode->SetDialogueNodeIndex(NewNodeIndex);
1117 OldToNewIndexMap.Add(OldNodeIndex, NewNodeIndex);
1118 GraphNodes.Add(GraphNode);
1122 bPositionNode =
false;
1123 bAddToSelection = Edge->HasParentNode() && Edge->HasChildNode();
1127 if (bAddToSelection)
1134 const float NodePosX = (Node->NodePosX - AvgNodePosition.X) + Location.X;
1135 const float NodePosY = (Node->NodePosY - AvgNodePosition.Y) + Location.Y;
1137 if (
auto* GraphNodeBase = Cast<UDialogueGraphNode_Base>(Node))
1139 GraphNodeBase->SetPosition(NodePosX, NodePosY);
1143 Node->NodePosX = NodePosX;
1144 Node->NodePosY = NodePosY;
1149 Node->CreateNewGuid();
1156 UDlgNode* DialogueNode = GraphNode->GetMutableDialogueNode();
1158 const TArray<UDialogueGraphNode_Edge*> GraphNodeChildrenEdges = GraphNode->GetChildEdgeNodes();
1159 const int32 GraphNodeChildrenEdgesNum = GraphNodeChildrenEdges.Num();
1160 if (GraphNodeChildrenEdgesNum == 0)
1169 const TArray<FDlgEdge>& OldNodeEdges = DialogueNode->
GetNodeChildren();
1170 TArray<FDlgEdge> NewNodeEdges;
1171 for (
const FDlgEdge& OldEdge : OldNodeEdges)
1174 if (OldToNewIndexMap.Find(OldEdge.TargetIndex) !=
nullptr)
1176 NewNodeEdges.Add(OldEdge);
1184 for (int32 ChildIndex = 0; ChildIndex < GraphNodeChildrenEdgesNum; ChildIndex++)
1188 const int32 NewNodeIndex = OldToNewIndexMap.FindChecked(OldNodeIndex);
1189 GraphNode->SetEdgeTargetIndexAt(ChildIndex, NewNodeIndex);
1210 FString ClipboardContent;
1211 FPlatformApplicationMisc::ClipboardPaste(ClipboardContent);
1213 return FEdGraphUtilities::CanImportNodesFromText(
DialogueBeingEdited->GetGraph(), ClipboardContent);
1223 if (!GraphNode->IsRootNode())
1225 GraphNode->SetForceHideNode(
true);
1236 GraphNode->SetForceHideNode(
false);
1249 const EAppReturnType::Type Response = FPlatformMisc::MessageBoxExt(EAppMsgType::YesNo,
1250 TEXT(
"You are about to overwrite your data in the editor with the data from the text file(.dlg)"),
1251 TEXT(
"Overwrite graph/dialogue data from text file?"));
1252 if (Response == EAppReturnType::No)
1270 TArray<UObject*> ViewSelection;
1273 if (NewSelection.Num())
1275 for (
UObject* Selected : NewSelection)
1278 ViewSelection.Add(Selected);
1295 const TArray<UEdGraphPin*>& InDraggedPins,
bool bAutoExpand, SGraphEditor::FActionMenuClosed InOnMenuClosed)
1299 .NewNodePosition(InNodePosition)
1300 .DraggedFromPins(InDraggedPins)
1301 .AutoExpandActionMenu(bAutoExpand)
1302 .OnClosedCallback(InOnMenuClosed)
1305 return FActionMenuContent(ActionMenu, ActionMenu->GetFilterTextBox());
1310 if (!bActionExecuted)
1319 if (!IsValid(NodeBeingChanged))
1325 const FScopedTransaction Transaction(LOCTEXT(
"RenameNode",
"Dialogue Editor: Rename Node"));
1326 verify(NodeBeingChanged->Modify());
1327 NodeBeingChanged->OnRenameNode(NewText.ToString());
1332#undef LOCTEXT_NAMESPACE
const FName DialogueEditorAppName
bool CanPasteNodes() const
void InitDialogueEditor(EToolkitMode::Type Mode, const TSharedPtr< IToolkitHost > &InitToolkitHost, UDlgDialogue *InitDialogue)
virtual ~FDialogueEditor()
void OnCommandDeleteSelectedNodes() const
UDlgSystemSettings * Settings
void OnCommandHideSelectedNodes()
TSharedPtr< IDetailsView > DetailsView
void PasteNodesHere(const FVector2D &Location)
void PostRedo(bool bSuccess) override
static const FName PaletteTabId
void SetDialogueBeingEdited(UDlgDialogue *NewDialogue)
TSharedRef< SGraphEditor > CreateGraphEditorWidget()
TSharedPtr< SGraphEditor > GraphEditorView
TArray< TWeakObjectPtr< UObject > > PreviousSelectedNodeObjects
void NotifyPostChange(const FPropertyChangedEvent &PropertyChangedEvent, FNYProperty *PropertyThatChanged) override
void SummonSearchUI(bool bSetFindWithinDialogue, FString NewSearchTerms=FString(), bool bSelectFirstResult=false)
static const FName GraphCanvasTabID
void SaveAssetAs_Execute() override
bool CanDeleteNodes() const
FText GetBaseToolkitName() const override
bool CanCopyNodes() const
void JumpToObject(const UObject *Object) override
void BindEditorCommands()
void OnCommandUndoGraphAction() const
void OnCommandRedoGraphAction() const
static const FName DetailsTabID
void PostUndo(bool bSuccess) override
TSet< UObject * > GetSelectedNodes() const override
void RegisterTabSpawners(const TSharedRef< FTabManager > &TabManager) override
void OnCommandConvertSpeechNodesToSpeechSequence() const
TSharedRef< SDockTab > SpawnTab_Palette(const FSpawnTabArgs &Args) const
UDialogueGraph * GetDialogueGraph() const
void SaveAsset_Execute() override
TSharedPtr< SDialoguePalette > PaletteView
const UDlgSystemSettings & GetSettings() const
void ClearViewportSelection() const
UDialogueGraphNode_Edge * LastTargetGraphEdgeBeforeDrag
void OnGraphActionMenuClosed(bool bActionExecuted, bool bGraphPinContext)
void OnSelectedNodesChanged(const TSet< UObject * > &NewSelection)
void RefreshViewport() const
void RefreshDetailsView(bool bRestorePreviousSelection) override
TSharedRef< SDockTab > SpawnTab_FindInDialogue(const FSpawnTabArgs &Args) const
static const FName FindInDialogueTabId
void OnCommandPasteNodes()
FActionMenuContent OnCreateGraphActionMenu(UEdGraph *InGraph, const FVector2D &InNodePosition, const TArray< UEdGraphPin * > &InDraggedPins, bool bAutoExpand, SGraphEditor::FActionMenuClosed InOnMenuClosed)
TSharedPtr< SFindInDialogues > FindResultsView
FText GetToolkitName() const override
TSharedRef< SDockTab > SpawnTab_GraphCanvas(const FSpawnTabArgs &Args) const
TSharedRef< SWidget > GenerateExternalURLsMenu() const
TSharedRef< SDockTab > SpawnTab_Details(const FSpawnTabArgs &Args) const
void OnCommandCopySelectedNodes() const
void UnregisterTabSpawners(const TSharedRef< FTabManager > &TabManager) override
void CreateInternalWidgets()
TSharedPtr< FUICommandList > GraphEditorCommands
void Refresh(bool bRestorePreviousSelection) override
UDlgDialogue * DialogueBeingEdited
void FocusWindow(UObject *ObjectToFocusOn=nullptr) override
void OnCommandConvertSpeechSequenceNodeToSpeechNodes() const
void OnCommandUnHideAllNodes()
void OnNodeTitleCommitted(const FText &NewText, ETextCommit::Type CommitInfo, UEdGraphNode *NodeBeingChanged) const
void OnCommandDialogueReload() const
TSharedRef< SWidget > GeneratePrimarySecondaryEdgesMenu() const
static void RemapOldIndicesWithNewAndUpdateGUID(const TArray< UDialogueGraphNode * > &GraphNodes, const TMap< int32, int32 > &OldToNewIndexMap)
static bool AreDialogueNodesInSyncWithGraphNodes(const UDlgDialogue *Dialogue)
static void TryToCreateDefaultGraph(UDlgDialogue *Dialogue, bool bPrompt=true)
static void CloseOtherEditors(UObject *Asset, IAssetEditorInstance *OnlyEditor)
static bool CanConvertSpeechNodesToSpeechSequence(const TSet< UObject * > &SelectedNodes, TArray< UDialogueGraphNode * > &OutSelectedGraphNodes)
static bool RemoveNode(UEdGraphNode *NodeToRemove)
static FName GetStyleSetName()
static const FName PROPERTY_NotYetLogoIcon
static TCopyQualifiersFromTo< SetType, typenameSetType::ElementType >::Type * GetFirstSetElement(SetType &Set)
static TSharedPtr< SDockTab > InvokeTab(TSharedPtr< FTabManager > TabManager, const FTabId &TabID)
static TSharedRef< FExtender > CreateHelpMenuExtender(TSharedRef< FUICommandList > Commands)
static void MapActionsForFileMenuExtender(TSharedRef< FUICommandList > Commands)
static void MapActionsForHelpMenuExtender(TSharedRef< FUICommandList > Commands)
static TSharedRef< FExtender > CreateFileMenuExtender(TSharedRef< FUICommandList > Commands, const TArray< TSharedPtr< FUICommandInfo > > &AdditionalMenuEntries={})
bool Modify(bool bAlwaysMarkDirty=true) override
TArray< UDialogueGraphNode_Edge * > GetAllEdgeDialogueGraphNodes() const
TArray< UDialogueGraphNode_Base * > GetAllBaseDialogueGraphNodes() const
TArray< UDialogueGraphNode * > GetAllDialogueGraphNodes() const
virtual FIntPoint GetPosition() const
const FDlgEdge & GetDialogueEdge() const
bool IsSpeechNode() const
bool IsSpeechSequenceNode() const
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
const TArray< UDlgNode * > & GetNodes() const
UFUNCTION(BlueprintPure, Category = "Dialogue")
int32 AddNode(UDlgNode *NodeToAdd)
TArray< UDlgNode * > Nodes
UPROPERTY(AdvancedDisplay, EditFixedSize, Instanced, Meta = (DlgWriteIndex))
UCLASS(BlueprintType, Abstract, EditInlineNew, ClassGroup = "Dialogue")
virtual const TArray< FDlgEdge > & GetNodeChildren() const
Gets this nodes children (edges) as a const/mutable array.
virtual void SetNodeChildren(const TArray< FDlgEdge > &InChildren)
bool bShowPrimarySecondaryEdges
UPROPERTY(Category = "Graph Edge", Config, EditAnywhere)
UEdGraphNode * PerformAction(UEdGraph *ParentGraph, UEdGraphPin *FromPin, const FVector2D Location, bool bSelectNewNode=true) override
UEdGraphNode * PerformAction(UEdGraph *ParentGraph, UEdGraphPin *FromPin, const FVector2D Location, bool bSelectNewNode=false) override
int32 TargetIndex
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Dialogue|Edge", Meta = (ClampMin = -1))