You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* Moved Slate.h into SlateBasics.h and began shifting less commonly used headers into SlateExtras.h. * Slate.h now simply includes SlateBasics.h and SlateExtras.h. * Slate.h includes a deprecated warning now to indicate that SlateBasics.h + specific includes should be used instead. * Moved dozens of inlined functions using Slate widgets into .cpp files to avoid header dependencies. * All code samples now include SlateBasics.h and SlateExtras.h so future shifts will not break most those projects, but not trigger the deprecation warning of including Slate.h. #BUN [CL 2329610 by Wes Hunt in Main branch]
91 lines
3.2 KiB
C++
91 lines
3.2 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "BlutilityPrivatePCH.h"
|
|
#include "BlutilityClasses.h"
|
|
|
|
|
|
#include "AssetTypeActions_EditorUtilityBlueprint.h"
|
|
#include "AssetToolsModule.h"
|
|
#include "WorkspaceMenuStructureModule.h"
|
|
|
|
#include "BlutilityDetailsPanel.h"
|
|
#include "BlutilityShelf.h"
|
|
#include "SDockTab.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
namespace BlutilityModule
|
|
{
|
|
static const FName BlutilityShelfApp = FName(TEXT("BlutilityShelfApp"));
|
|
}
|
|
|
|
/////////////////////////////////////////////////////
|
|
// FBlutilityModule
|
|
|
|
// Blutility module implementation (private)
|
|
class FBlutilityModule : public IBlutilityModule
|
|
{
|
|
public:
|
|
/** Asset type actions for MovieScene assets. Cached here so that we can unregister it during shutdown. */
|
|
TSharedPtr<FAssetTypeActions_EditorUtilityBlueprint> EditorBlueprintAssetTypeActions;
|
|
|
|
public:
|
|
virtual void StartupModule() override
|
|
{
|
|
// Register the asset type
|
|
EditorBlueprintAssetTypeActions = MakeShareable(new FAssetTypeActions_EditorUtilityBlueprint);
|
|
FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get().RegisterAssetTypeActions(EditorBlueprintAssetTypeActions.ToSharedRef());
|
|
|
|
// Register the details customizer
|
|
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
|
PropertyModule.RegisterCustomClassLayout("PlacedEditorUtilityBase", FOnGetDetailCustomizationInstance::CreateStatic(&FEditorUtilityInstanceDetails::MakeInstance));
|
|
PropertyModule.RegisterCustomClassLayout("GlobalEditorUtilityBase", FOnGetDetailCustomizationInstance::CreateStatic(&FEditorUtilityInstanceDetails::MakeInstance));
|
|
PropertyModule.NotifyCustomizationModuleChanged();
|
|
|
|
FGlobalTabmanager::Get()->RegisterTabSpawner(BlutilityModule::BlutilityShelfApp, FOnSpawnTab::CreateStatic(&SpawnBlutilityShelfTab))
|
|
.SetDisplayName(NSLOCTEXT("BlutilityShelf", "TabTitle", "Blutility Shelf"))
|
|
.SetGroup(WorkspaceMenu::GetMenuStructure().GetToolsCategory());
|
|
}
|
|
|
|
virtual void ShutdownModule() override
|
|
{
|
|
if (!UObjectInitialized())
|
|
{
|
|
return;
|
|
}
|
|
|
|
FGlobalTabmanager::Get()->UnregisterTabSpawner(BlutilityModule::BlutilityShelfApp);
|
|
|
|
// Only unregister if the asset tools module is loaded. We don't want to forcibly load it during shutdown phase.
|
|
check( EditorBlueprintAssetTypeActions.IsValid() );
|
|
if (FModuleManager::Get().IsModuleLoaded("AssetTools"))
|
|
{
|
|
FModuleManager::GetModuleChecked<FAssetToolsModule>("AssetTools").Get().UnregisterAssetTypeActions(EditorBlueprintAssetTypeActions.ToSharedRef());
|
|
}
|
|
EditorBlueprintAssetTypeActions.Reset();
|
|
|
|
// Unregister the details customization
|
|
if (FModuleManager::Get().IsModuleLoaded("PropertyEditor"))
|
|
{
|
|
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
|
PropertyModule.UnregisterCustomClassLayout("PlacedEditorUtilityBase");
|
|
PropertyModule.UnregisterCustomClassLayout("GlobalEditorUtilityBase");
|
|
PropertyModule.NotifyCustomizationModuleChanged();
|
|
}
|
|
}
|
|
|
|
protected:
|
|
static TSharedRef<SDockTab> SpawnBlutilityShelfTab(const FSpawnTabArgs& Args)
|
|
{
|
|
return SNew(SDockTab)
|
|
.TabRole(ETabRole::NomadTab)
|
|
[
|
|
SNew(SBlutilityShelf)
|
|
];
|
|
}
|
|
};
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE( FBlutilityModule, Blutility );
|