|
13 | 13 | #include "AssetActions/InteractableComponentAssetActions.h" |
14 | 14 |
|
15 | 15 | #include "AssetToolsModule.h" |
| 16 | +#include "ContentBrowserModule.h" |
| 17 | +#include "FileHelpers.h" |
16 | 18 | #include "GameplayTagsManager.h" |
17 | 19 | #include "HttpModule.h" |
| 20 | +#include "IContentBrowserSingleton.h" |
18 | 21 | #include "HelpButton/AIntPCommands.h" |
19 | 22 | #include "HelpButton/AIntPHelpStyle.h" |
20 | 23 | #include "Kismet2/KismetEditorUtilities.h" |
|
28 | 31 | #include "WorkspaceMenuStructure.h" |
29 | 32 | #include "WorkspaceMenuStructureModule.h" |
30 | 33 | #include "HelpButton/InteractionSystemTutorialPage.h" |
| 34 | +#include "Helpers/MounteaInteractionSystemEditorLog.h" |
31 | 35 | #include "Interfaces/IHttpResponse.h" |
32 | 36 |
|
33 | 37 | #include "Interfaces/IMainFrameModule.h" |
@@ -519,13 +523,43 @@ TSharedRef<SWidget> FActorInteractionPluginEditor::MakeMounteaMenuWidget() const |
519 | 523 | FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Tutorial"), |
520 | 524 | FUIAction( |
521 | 525 | FExecuteAction::CreateRaw(this, &FActorInteractionPluginEditor::TutorialButtonClicked) |
522 | | - ) |
523 | | -); |
| 526 | + ) |
| 527 | + ); |
| 528 | + |
| 529 | + MenuBuilder.AddMenuEntry( |
| 530 | + LOCTEXT("MounteaSystemEditor_OpenExampleLevel_Label", "Open Example Level"), |
| 531 | + LOCTEXT("MounteaSystemEditor_OpenExampleLevel_ToolTip", "🌄 Opens an example level demonstrating Mountea Interaction System"), |
| 532 | + FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Level"), |
| 533 | + FUIAction( |
| 534 | + FExecuteAction::CreateLambda([]() |
| 535 | + { |
| 536 | + const FString mapPath = TEXT("/ActorInteractionPlugin/Example/M_Example"); |
| 537 | + if (FPackageName::DoesPackageExist(mapPath)) |
| 538 | + FEditorFileUtils::LoadMap(mapPath, false, true); |
| 539 | + else |
| 540 | + EDITOR_LOG_ERROR(TEXT("Example map not found at:\nContent/Mountea/Maps/ExampleMap.umap")) |
| 541 | + }) |
| 542 | + ) |
| 543 | + ); |
524 | 544 |
|
| 545 | + MenuBuilder.AddMenuEntry( |
| 546 | + LOCTEXT("MounteaSystemEditor_OpenPluginFolder_Label", "Open Plugin Folder"), |
| 547 | + LOCTEXT("MounteaSystemEditor_OpenPluginFolder_ToolTip", "📂 Open the Mountea plugin's folder on disk"), |
| 548 | + FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Folder"), |
| 549 | + FUIAction( |
| 550 | + FExecuteAction::CreateLambda([]() |
| 551 | + { |
| 552 | + const FContentBrowserModule& contentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser"); |
| 553 | + TArray<FString> folderPaths; |
| 554 | + folderPaths.Add(TEXT("/ActorInteractionPlugin")); |
| 555 | + contentBrowserModule.Get().SetSelectedPaths(folderPaths, true); |
| 556 | + }) |
| 557 | + ) |
| 558 | + ); |
525 | 559 | }; |
526 | 560 | MenuBuilder.EndSection(); |
527 | 561 |
|
528 | | - MenuBuilder.BeginSection("MounteaMenu_Tools", LOCTEXT("MounteaMenuOptions_Settings", "Mountea Interaction Settings")); |
| 562 | + MenuBuilder.BeginSection("MounteaMenu_Settings", LOCTEXT("MounteaMenuOptions_Settings", "Mountea Interaction Settings")); |
529 | 563 | { |
530 | 564 | MenuBuilder.AddMenuEntry( |
531 | 565 | LOCTEXT("MounteaSystemEditor_SettingsButton_Label", "Mountea Interaction Settings"), |
|
0 commit comments