x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

UE 4.6.1 slate tabspawning

I am building a plugin for the Unreal Editor and I started porting it to version 4.6.1. In 4.5 and previous versions I made a tab under the window button in the editor. Only this isn't working in the new version. I have no clue what I am doing wrong! StartupModule() is being called, but the tab just doesn't spawn.

I also tried the PluginsEditor plugin (UnrealEngine/Engine/Plugins/Editor/PluginsEditor/) code, but that doesn't work as well.

This was my previous code from 4.5:

 #include "MultiEdEnginePch.h"
 #include "MultiEdEngineModule.h"
 #include "MultiEditWindow.h"
 
 DEFINE_LOG_CATEGORY(MultiEdit)
 
 IMPLEMENT_MODULE(MultiEdEngineModule, MultiEdEngine);
 
 #define LOCTEXT_NAMESPACE "MultiEdit"
 
 const FName MultiEditWindowTabName(TEXT("MultiEditWindowTab"));
 
 MultiEdEngineModule::MultiEdEngineModule()
 {
 
 }
 
 void MultiEdEngineModule::StartupModule()
 {
     //Starts the plugin
     UE_LOG(MultiEdit, Warning, TEXT("Starting MultiEdit"));
 
     TSharedPtr<FExtender> extender = MakeShareable(new FExtender);
     extender->AddMenuExtension(
         "WindowLocalTabSpawners",
         EExtensionHook::After,
         NULL,
         FMenuExtensionDelegate::CreateRaw(this, &MultiEdEngineModule::CreateWindowMenu));
 
     FLevelEditorModule& levelEditor = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
     levelEditor.GetMenuExtensibilityManager()->AddExtender(extender);
 
     //Register MultiEdit window to the Unreal Editor window menu
     FGlobalTabmanager::Get()->RegisterTabSpawner(
         MultiEditWindowTabName, 
         FOnSpawnTab::CreateRaw(this, &MultiEdEngineModule::CreateTab))
             .SetDisplayName(FText::FromString(TEXT("MultiEdit Window")));
 
 }
 
 void MultiEdEngineModule::ShutdownModule()
 {
 
 }
 
 void MultiEdEngineModule::CreateWindowMenu(FMenuBuilder& MenuBuilder)
 {
     //Creates the window when pressed
     MenuBuilder.AddMenuEntry(
         LOCTEXT("OpenWindow", "MultiEdit Window"),
         LOCTEXT("OpenWindowToolTip", "Opens the MultiEdit Plugin window"),
         FSlateIcon(),
         FUIAction(FExecuteAction::CreateRaw(this, &MultiEdEngineModule::OpenPluginWindow)));
 }
 
 void MultiEdEngineModule::OpenPluginWindow()
 {
     UE_LOG(MultiEdit, Warning, TEXT("Creating MultiEdit window"));
     FGlobalTabmanager::Get()->InvokeTab(MultiEditWindowTabName);
 }
 
 TSharedRef<SDockTab> MultiEdEngineModule::CreateTab(const FSpawnTabArgs& Args)
 {
     return
         SNew(SDockTab)
         .Label(LOCTEXT("TabTitle", "MultiEdit Window"))
         .TabRole(ETabRole::MajorTab)
         .ContentPadding(5)
         [
             SNew(SBorder)
             .Padding(4)
             .BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
             [
                 SNew(MultiEditWindow)
             ]
         ];
 }


Product Version: Not Selected
Tags:
more ▼

asked Dec 20 '14 at 11:45 AM in C++ Programming

avatar image

YannickLange
71 9 11 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Solution code:

 #include "MultiEditPch.h"
 #include "MultiEditModule.h"
 #include "MultiEditWindow.h"
 #include "Editor/WorkspaceMenuStructure/Public/WorkspaceMenuStructureModule.h"
 
 DEFINE_LOG_CATEGORY(MultiEdit)
 
 IMPLEMENT_MODULE(MultiEditModule, MultiEdit);
 
 #define LOCTEXT_NAMESPACE "MultiEdit"
 
 const FName MultiEditWindowTabName(TEXT("MultiEditWindowTab"));
 
 void MultiEditModule::StartupModule()
 {
     //Starts the plugin
     UE_LOG(MultiEdit, Warning, TEXT("Starting MultiEdit"));
 
     //Register MultiEdit window to the Unreal Editor window menu
     FGlobalTabmanager::Get()->RegisterNomadTabSpawner(MultiEditWindowTabName, FOnSpawnTab::CreateRaw(this, &MultiEditModule::CreateTab))
         .SetDisplayName(FText::FromString(TEXT("MultiEdit Window")))
         .SetGroup(WorkspaceMenu::GetMenuStructure().GetLevelEditorCategory())
         .SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "Log.TabIcon"));
 }
 
 void MultiEditModule::ShutdownModule()
 {
     FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(MultiEditWindowTabName);
 }
 
 TSharedRef<SDockTab> MultiEditModule::CreateTab(const FSpawnTabArgs& Args)
 {
     return
         SNew(SDockTab)
         .Label(LOCTEXT("TabTitle", "MultiEdit Window"))
         .TabRole(ETabRole::MajorTab)
         .ContentPadding(5)
         [
             SNew(SBorder)
             .Padding(4)
             .BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
             [
                 SNew(MultiEditWindow)
             ]
         ];
 }
more ▼

answered Dec 20 '14 at 02:00 PM

avatar image

YannickLange
71 9 11 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question