Files
UnrealEngineUWP/Engine/Source/Editor/AddContentDialog/Private/AddContentDialogModule.cpp
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

56 lines
1.6 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "AddContentDialogPCH.h"
#include "AssertionMacros.h"
#include "FeaturePackContentSourceProvider.h"
#include "ModuleManager.h"
#include "SDockTab.h"
#include "WidgetCarouselModule.h"
#include "WidgetCarouselStyle.h"
#define LOCTEXT_NAMESPACE "AddContentDialog"
class FAddContentDialogModule : public IAddContentDialogModule
{
public:
virtual void StartupModule() override
{
FModuleManager::LoadModuleChecked<FWidgetCarouselModule>("WidgetCarousel");
FWidgetCarouselModuleStyle::Initialize();
ContentSourceProviderManager = TSharedPtr<FContentSourceProviderManager>(new FContentSourceProviderManager());
ContentSourceProviderManager->RegisterContentSourceProvider(MakeShareable(new FFeaturePackContentSourceProvider()));
FAddContentDialogStyle::Initialize();
}
virtual void ShutdownModule() override
{
FAddContentDialogStyle::Shutdown();
FWidgetCarouselModuleStyle::Shutdown();
}
virtual TSharedRef<FContentSourceProviderManager> GetContentSourceProviderManager() override
{
return ContentSourceProviderManager.ToSharedRef();
}
virtual void ShowDialog(TSharedRef<SWindow> ParentWindow) override
{
if (AddContentDialog.IsValid() == false)
{
TSharedRef<SWindow> Dialog = SNew(SAddContentDialog);
FSlateApplication::Get().AddWindowAsNativeChild(Dialog, ParentWindow);
AddContentDialog = TWeakPtr<SWindow>(Dialog);
}
}
private:
TSharedPtr<FContentSourceProviderManager> ContentSourceProviderManager;
TWeakPtr<SWindow> AddContentDialog;
};
IMPLEMENT_MODULE(FAddContentDialogModule, AddContentDialog);
#undef LOCTEXT_NAMESPACE