Skip to content

Commit f4f1fc6

Browse files
Toolbar updates
1 parent 636abbc commit f4f1fc6

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

Resources/FolderIcon.png

4.64 KB
Loading

Resources/LevelIcon.png

7.93 KB
Loading

Source/ActorInteractionPluginEditor/Private/ActorInteractionPluginEditor.cpp

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
#include "AssetActions/InteractableComponentAssetActions.h"
1414

1515
#include "AssetToolsModule.h"
16+
#include "ContentBrowserModule.h"
17+
#include "FileHelpers.h"
1618
#include "GameplayTagsManager.h"
1719
#include "HttpModule.h"
20+
#include "IContentBrowserSingleton.h"
1821
#include "HelpButton/AIntPCommands.h"
1922
#include "HelpButton/AIntPHelpStyle.h"
2023
#include "Kismet2/KismetEditorUtilities.h"
@@ -28,6 +31,7 @@
2831
#include "WorkspaceMenuStructure.h"
2932
#include "WorkspaceMenuStructureModule.h"
3033
#include "HelpButton/InteractionSystemTutorialPage.h"
34+
#include "Helpers/MounteaInteractionSystemEditorLog.h"
3135
#include "Interfaces/IHttpResponse.h"
3236

3337
#include "Interfaces/IMainFrameModule.h"
@@ -519,13 +523,43 @@ TSharedRef<SWidget> FActorInteractionPluginEditor::MakeMounteaMenuWidget() const
519523
FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Tutorial"),
520524
FUIAction(
521525
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+
);
524544

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+
);
525559
};
526560
MenuBuilder.EndSection();
527561

528-
MenuBuilder.BeginSection("MounteaMenu_Tools", LOCTEXT("MounteaMenuOptions_Settings", "Mountea Interaction Settings"));
562+
MenuBuilder.BeginSection("MounteaMenu_Settings", LOCTEXT("MounteaMenuOptions_Settings", "Mountea Interaction Settings"));
529563
{
530564
MenuBuilder.AddMenuEntry(
531565
LOCTEXT("MounteaSystemEditor_SettingsButton_Label", "Mountea Interaction Settings"),

Source/ActorInteractionPluginEditor/Private/HelpButton/AIntPHelpStyle.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ TSharedRef<FSlateStyleSet> FAIntPHelpStyle::Create()
8888
Style->Set("AIntPStyleSet.Icon.MoneyIcon", new IMAGE_BRUSH(TEXT("MoneyIcon"), Icon16x16));
8989

9090
Style->Set("AIntPStyleSet.Tutorial", new IMAGE_BRUSH(TEXT("tutorialPage_icon"), Icon40x40));
91+
92+
Style->Set("AIntPStyleSet.Level", new IMAGE_BRUSH(TEXT("LevelIcon"), Icon40x40));
93+
Style->Set("AIntPStyleSet.Folder", new IMAGE_BRUSH(TEXT("FolderIcon"), Icon40x40));
9194
return Style;
9295
}
9396

0 commit comments

Comments
 (0)