You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#UE-3840 - BP: Blutilities UI broke in 4.4. #Branch UE4 #Proj Blutility, DetailCustomizations, KismetCompiler, UnrealEd, CoreUObject #Added FUNC_Blutility function flag to enable better blutility identification. #Change Updated kismet compiler to tag blutility events as FUNC_Blutility #Change Updated FBlueprintEditorUtils::CreateFunctionGraph to tag the function flags with FUNC_Blutility if the blueprint is based on a blutility. #Change CallInEditor code previously detected through metadata was modified to use the new FUNC_Blutility flags. #Change Modified the blutilities dialog to detect any UFunctions with FUNC_Blutility flags rather than FUNC_Exec which had previously been broken. #Change Added a test in the blutility module to enable blueprint blutility detection and exposed a function to check this in BPEditorUtils [CL 2397472 by Ben Cosh in Main branch]
102 lines
3.5 KiB
C++
102 lines
3.5 KiB
C++
// Copyright 1998-2015 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();
|
|
}
|
|
}
|
|
|
|
virtual bool IsBlutility( const UBlueprint* Blueprint ) const override
|
|
{
|
|
const UClass* BPClass = Blueprint ? Blueprint->GetClass() : nullptr;
|
|
|
|
if( BPClass && BPClass->IsChildOf( UEditorUtilityBlueprint::StaticClass() ))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
protected:
|
|
static TSharedRef<SDockTab> SpawnBlutilityShelfTab(const FSpawnTabArgs& Args)
|
|
{
|
|
return SNew(SDockTab)
|
|
.TabRole(ETabRole::NomadTab)
|
|
[
|
|
SNew(SBlutilityShelf)
|
|
];
|
|
}
|
|
};
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE( FBlutilityModule, Blutility );
|