| 439 | } |
| 440 | |
| 441 | void FDlgSystemEditorModule::ExtendMenu() |
| 442 | { |
| 443 | // Running in game mode (standalone game) or dedicated server (-server) exit as we can't get the LevelEditorModule. |
| 444 | if (IsRunningGame() || IsRunningCommandlet() || IsRunningDedicatedServer()) |
| 445 | { |
| 446 | return; |
| 447 | } |
| 448 | |
| 449 | // File and Help Menu Extenders |
| 450 | { |
| 451 | const TSharedRef<FExtender> FileMenuExtender = CreateFileMenuExtender(LevelMenuEditorCommands.ToSharedRef()); |
| 452 | const TSharedRef<FExtender> HelpMenuExtender = CreateHelpMenuExtender(LevelMenuEditorCommands.ToSharedRef()); |
| 453 | |
| 454 | // Add to the level editor |
| 455 | FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>(NAME_MODULE_LevelEditor); |
| 456 | LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(FileMenuExtender); |
| 457 | LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(HelpMenuExtender); |
| 458 | } |
| 459 | |
| 460 | // Window -> Dialogue search, Dialogue Browse, Dialogue Data Display |
| 461 | { |
| 462 | ToolsDialogueCategory = WorkspaceMenu::GetMenuStructure().GetStructureRoot() |
| 463 | ->AddGroup( |
| 464 | LOCTEXT("WorkspaceMenu_DialogueCategory", "Dialogue" ), |
| 465 | FSlateIcon( |
| 466 | FDialogueStyle::GetStyleSetName(), |
| 467 | FDialogueStyle::PROPERTY_DlgDialogueClassIcon |
| 468 | ), |
| 469 | false |
| 470 | ); |
| 471 | |
| 472 | // Register the Dialogue Overview Browser |
| 473 | FGlobalTabmanager::Get()->RegisterNomadTabSpawner(DIALOGUE_BROWSER_TAB_ID, |
| 474 | FOnSpawnTab::CreateLambda([this](const FSpawnTabArgs& Args) -> TSharedRef<SDockTab> |
| 475 | { |
| 476 | const TSharedRef<SDockTab> DockTab = SNew(SDockTab) |
| 477 | .TabRole(ETabRole::NomadTab) |
| 478 | [ |
| 479 | SNew(SDialogueBrowser) |
| 480 | ]; |
| 481 | return DockTab; |
| 482 | })) |
| 483 | .SetDisplayName(LOCTEXT("DialogueBrowserTabTitle", "Dialogue Browser")) |
| 484 | .SetTooltipText(LOCTEXT("DialogueBrowserTooltipText", "Open the Dialogue Overview Browser tab.")) |
| 485 | .SetIcon(FSlateIcon(FDialogueStyle::GetStyleSetName(), FDialogueStyle::PROPERTY_DialogueBrowser_TabIcon)) |
| 486 | .SetGroup(ToolsDialogueCategory.ToSharedRef()); |
| 487 | |
| 488 | // Register the Dialogue Search |
| 489 | FDialogueSearchManager::Get()->Initialize(ToolsDialogueCategory); |
| 490 | |
| 491 | // Register the Dialogue Data Display |
| 492 | FTabSpawnerEntry* TabDialogueDataDisplay = IDlgSystemModule::Get().GetDialogueDataDisplaySpawnEntry(); |
| 493 | TabDialogueDataDisplay->SetGroup(ToolsDialogueCategory.ToSharedRef()); |
| 494 | TabDialogueDataDisplay->SetIcon(FSlateIcon(FDialogueStyle::GetStyleSetName(), FDialogueStyle::PROPERTY_DialogueDataDisplay_TabIcon)); |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | TSharedRef<FExtender> FDlgSystemEditorModule::CreateFileMenuExtender( |
nothing calls this directly
no test coverage detected