2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-11-19 07:43:07 -05:00
|
|
|
|
|
|
|
|
#include "LogVisualizer.h"
|
|
|
|
|
#include "LogVisualizerModule.h"
|
|
|
|
|
#include "LogVisualizerStyle.h"
|
|
|
|
|
#include "SDockTab.h"
|
2014-11-25 10:26:44 -05:00
|
|
|
#include "VisualLoggerRenderingActor.h"
|
2014-12-01 10:42:59 -05:00
|
|
|
#include "LogVisualizerSettings.h"
|
2014-11-28 09:26:40 -05:00
|
|
|
#if WITH_EDITOR
|
2014-11-25 17:52:12 -05:00
|
|
|
#include "Editor/EditorEngine.h"
|
2014-11-28 09:26:40 -05:00
|
|
|
#include "ISettingsModule.h"
|
|
|
|
|
#include "LevelEditor.h"
|
2014-12-11 06:23:59 -05:00
|
|
|
#include "WorkspaceMenuStructureModule.h"
|
2014-11-28 09:26:40 -05:00
|
|
|
#endif // WITH_EDITOR
|
2014-11-19 07:43:07 -05:00
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "FLogVisualizerModule"
|
|
|
|
|
|
|
|
|
|
static const FName VisualLoggerTabName("VisualLogger");
|
|
|
|
|
|
|
|
|
|
//DEFINE_LOG_CATEGORY(LogLogVisualizer);
|
|
|
|
|
|
2014-12-18 08:37:06 -05:00
|
|
|
void FLogVisualizerModule::StartupModule()
|
2014-11-19 07:43:07 -05:00
|
|
|
{
|
|
|
|
|
FLogVisualizerStyle::Initialize();
|
|
|
|
|
|
|
|
|
|
FVisualLoggerCommands::Register();
|
|
|
|
|
IModularFeatures::Get().RegisterModularFeature(VisualLoggerTabName, this);
|
|
|
|
|
|
2014-12-11 06:23:59 -05:00
|
|
|
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(
|
|
|
|
|
VisualLoggerTabName,
|
2014-12-18 08:37:06 -05:00
|
|
|
FOnSpawnTab::CreateRaw(this, &FLogVisualizerModule::SpawnLogVisualizerTab))
|
2014-12-11 06:23:59 -05:00
|
|
|
.SetGroup(WorkspaceMenu::GetMenuStructure().GetDeveloperToolsMiscCategory())
|
|
|
|
|
.SetDisplayName(NSLOCTEXT("LogVisualizerApp", "TabTitle", "Visual Logger"))
|
|
|
|
|
.SetTooltipText(NSLOCTEXT("LogVisualizerApp", "TooltipText", "Opens Visual Logger tool."))
|
|
|
|
|
.SetIcon(FSlateIcon(FLogVisualizerStyle::GetStyleSetName(), "LogVisualizerApp.TabIcon"));
|
2014-11-28 09:26:40 -05:00
|
|
|
|
|
|
|
|
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
|
|
|
|
|
if (SettingsModule != nullptr)
|
|
|
|
|
{
|
|
|
|
|
SettingsModule->RegisterSettings("Editor", "General", "VisualLogger",
|
|
|
|
|
LOCTEXT("AIToolsSettingsName", "Visual Logger"),
|
|
|
|
|
LOCTEXT("AIToolsSettingsDescription", "General settings for UE4 AI Tools."),
|
|
|
|
|
ULogVisualizerSettings::StaticClass()->GetDefaultObject()
|
|
|
|
|
);
|
|
|
|
|
}
|
2014-11-19 07:43:07 -05:00
|
|
|
}
|
|
|
|
|
|
2014-12-18 08:37:06 -05:00
|
|
|
void FLogVisualizerModule::ShutdownModule()
|
2014-11-19 07:43:07 -05:00
|
|
|
{
|
|
|
|
|
FGlobalTabmanager::Get()->UnregisterTabSpawner(VisualLoggerTabName);
|
|
|
|
|
FVisualLoggerCommands::Unregister();
|
|
|
|
|
IModularFeatures::Get().UnregisterModularFeature(VisualLoggerTabName, this);
|
2014-11-28 09:26:40 -05:00
|
|
|
|
|
|
|
|
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
|
|
|
|
|
if (SettingsModule != nullptr)
|
|
|
|
|
{
|
|
|
|
|
SettingsModule->UnregisterSettings("Editor", "General", "VisualLogger");
|
|
|
|
|
}
|
2014-11-19 07:43:07 -05:00
|
|
|
|
|
|
|
|
FLogVisualizerStyle::Shutdown();
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-18 08:37:06 -05:00
|
|
|
TSharedRef<SDockTab> FLogVisualizerModule::SpawnLogVisualizerTab(const FSpawnTabArgs& SpawnTabArgs)
|
2014-11-19 07:43:07 -05:00
|
|
|
{
|
|
|
|
|
const TSharedRef<SDockTab> MajorTab = SNew(SDockTab)
|
2014-12-18 08:37:06 -05:00
|
|
|
.TabRole(ETabRole::MajorTab);
|
2014-11-19 07:43:07 -05:00
|
|
|
|
|
|
|
|
TSharedPtr<SWidget> TabContent;
|
|
|
|
|
|
|
|
|
|
TabContent = SNew(SVisualLogger, MajorTab, SpawnTabArgs.GetOwnerWindow());
|
|
|
|
|
|
|
|
|
|
MajorTab->SetContent(TabContent.ToSharedRef());
|
|
|
|
|
|
|
|
|
|
return MajorTab;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-18 08:37:06 -05:00
|
|
|
IMPLEMENT_MODULE(FLogVisualizerModule, LogVisualizer);
|
2014-11-19 07:43:07 -05:00
|
|
|
#undef LOCTEXT_NAMESPACE
|