Files
UnrealEngineUWP/Engine/Source/Developer/AssetTools/Private/AssetToolsModule.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

52 lines
1.4 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "AssetToolsModule.h"
#include "AssetToolsLog.h"
#include "AssetTools.h"
#include "AssetToolsConsoleCommands.h"
#include "MessageLogInitializationOptions.h"
#include "MessageLogModule.h"
IMPLEMENT_MODULE( FAssetToolsModule, AssetTools );
DEFINE_LOG_CATEGORY(LogAssetTools);
void FAssetToolsModule::StartupModule()
{
AssetTools = new FAssetTools();
ConsoleCommands = new FAssetToolsConsoleCommands(*this);
// create a message log for the asset tools to use
FMessageLogModule& MessageLogModule = FModuleManager::LoadModuleChecked<FMessageLogModule>("MessageLog");
FMessageLogInitializationOptions InitOptions;
InitOptions.bShowPages = true;
MessageLogModule.RegisterLogListing("AssetTools", NSLOCTEXT("AssetTools", "AssetToolsLogLabel", "Asset Tools"), InitOptions);
}
void FAssetToolsModule::ShutdownModule()
{
if (AssetTools != NULL)
{
delete AssetTools;
AssetTools = NULL;
}
if (ConsoleCommands != NULL)
{
delete ConsoleCommands;
ConsoleCommands = NULL;
}
if (FModuleManager::Get().IsModuleLoaded("MessageLog"))
{
// unregister message log
FMessageLogModule& MessageLogModule = FModuleManager::GetModuleChecked<FMessageLogModule>("MessageLog");
MessageLogModule.UnregisterLogListing("AssetTools");
}
}
IAssetTools& FAssetToolsModule::Get() const
{
check(AssetTools);
return *AssetTools;
}