|
22 | 22 | #include "Framework/Notifications/NotificationManager.h"
|
23 | 23 | #include "Framework/SlateDelegates.h"
|
24 | 24 | #include "LevelEditor.h"
|
| 25 | +#include "ToolMenuEntry.h" |
| 26 | +#include "ToolMenus.h" |
25 | 27 | #include "Widgets/Notifications/SNotificationList.h"
|
26 | 28 | #include "Widgets/SNullWidget.h"
|
27 | 29 |
|
@@ -246,15 +248,17 @@ void FEditorUIExtender::Extend()
|
246 | 248 | MenuExtenders.Add(FLevelEditorModule::FLevelViewportMenuExtender_SelectedActors::CreateStatic(&Local::OnExtendLevelEditorActorContextMenu));
|
247 | 249 | LevelViewportExtenderHandle = MenuExtenders.Last().GetHandle();
|
248 | 250 |
|
249 |
| - LevelToolbarExtender = MakeShareable(new FExtender); |
250 |
| - LevelToolbarExtender->AddToolBarExtension( |
251 |
| - "Settings", |
252 |
| - EExtensionHook::After, |
253 |
| - FPrefabricatorCommands::Get().LevelMenuActionList, |
254 |
| - FToolBarExtensionDelegate::CreateStatic(&Local::ExtendLevelToolbar) |
255 |
| - ); |
256 |
| - |
257 |
| - LevelEditorModule.GetToolBarExtensibilityManager().Get()->AddExtender(LevelToolbarExtender); |
| 251 | + UToolMenu* AssetsToolBar = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.AssetsToolBar"); |
| 252 | + if (AssetsToolBar) { |
| 253 | + FToolMenuSection& Section = AssetsToolBar->AddSection("Prefabricator"); |
| 254 | + const FToolMenuEntry LaunchPadEntry = FToolMenuEntry::InitComboButton("Prefabricator", |
| 255 | + FUIAction(), |
| 256 | + FOnGetContent::CreateStatic(&Local::HandleShowToolbarPrefabMenu), |
| 257 | + LOCTEXT("PrefabricatorToolbarButtonText", "Prefabricator"), |
| 258 | + LOCTEXT("DAToolbarButtonTooltip", "Prefabricator Menu"), |
| 259 | + FSlateIcon(FPrefabEditorStyle::GetStyleSetName(), TEXT("Prefabricator.CreatePrefab"))); |
| 260 | + Section.AddEntry(LaunchPadEntry); |
| 261 | + } |
258 | 262 |
|
259 | 263 |
|
260 | 264 | }
|
|
0 commit comments