43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||
|
|
|
||
|
|
#include "DialogueGraphTabSummoner.h"
|
||
|
|
#include "DialogueAssetEditor.h"
|
||
|
|
|
||
|
|
#define LOCTEXT_NAMESPACE "DialogueGraphTabSummoner"
|
||
|
|
|
||
|
|
const FName DialogueGraphTabId = FName(TEXT("DialogueGraphTabId"));
|
||
|
|
|
||
|
|
FDialogueGraphTabSummoner::FDialogueGraphTabSummoner(TSharedPtr<FDialogueAssetEditor> InDialogueEditor)
|
||
|
|
: FWorkflowTabFactory(DialogueGraphTabId, InDialogueEditor)
|
||
|
|
{
|
||
|
|
DialogueEditor = InDialogueEditor;
|
||
|
|
TabLabel = LOCTEXT("DialogueGraphTabLabel", "Dialogue Graph");
|
||
|
|
ViewMenuDescription = LOCTEXT("DialogueGraph_ViewMenu_Desc", "Dialogue Graph");
|
||
|
|
ViewMenuTooltip = LOCTEXT("DialogueGraph_ViewMenu_ToolTip", "Show the Dialogue Graph");
|
||
|
|
}
|
||
|
|
|
||
|
|
TSharedRef<SWidget> FDialogueGraphTabSummoner::CreateTabBody(const FWorkflowTabSpawnInfo& Info) const
|
||
|
|
{
|
||
|
|
TSharedPtr<FDialogueAssetEditor> Editor = DialogueEditor.Pin();
|
||
|
|
|
||
|
|
SGraphEditor::FGraphEditorEvents GraphEvents;
|
||
|
|
GraphEvents.OnSelectionChanged.BindSP(Editor.Get(), &FDialogueAssetEditor::OnGraphSelectionChanged);
|
||
|
|
|
||
|
|
TSharedPtr<SGraphEditor> GraphEditor =
|
||
|
|
SNew(SGraphEditor)
|
||
|
|
.IsEditable(true)
|
||
|
|
.GraphEvents(GraphEvents)
|
||
|
|
.GraphToEdit(Editor->GetDialogueGraph());
|
||
|
|
|
||
|
|
Editor->SetGraphEditor(GraphEditor);
|
||
|
|
|
||
|
|
return GraphEditor.ToSharedRef();
|
||
|
|
}
|
||
|
|
|
||
|
|
FText FDialogueGraphTabSummoner::GetTabToolTipText(const FWorkflowTabSpawnInfo& Info) const
|
||
|
|
{
|
||
|
|
return LOCTEXT("DialogueGraphTooltip", "The dialogue graph editor");
|
||
|
|
}
|
||
|
|
|
||
|
|
#undef LOCTEXT_NAMESPACE
|