2021-09-28 13:33:17 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "SmartObjectsModule.h"
|
2021-11-03 10:04:28 -04:00
|
|
|
|
2021-09-28 13:33:17 -04:00
|
|
|
#include "Modules/ModuleManager.h"
|
2021-11-03 11:57:26 -04:00
|
|
|
#include "SmartObjectTypes.h"
|
2021-11-26 12:55:06 -05:00
|
|
|
#include "UObject/CoreRedirects.h"
|
2021-09-28 13:33:17 -04:00
|
|
|
|
2021-11-03 11:57:26 -04:00
|
|
|
#if WITH_GAMEPLAY_DEBUGGER && WITH_SMARTOBJECT_DEBUG
|
2021-11-03 10:04:28 -04:00
|
|
|
#include "GameplayDebugger.h"
|
|
|
|
|
#include "GameplayDebuggerCategory_SmartObject.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-09-28 13:33:17 -04:00
|
|
|
#define LOCTEXT_NAMESPACE "SmartObjects"
|
|
|
|
|
|
|
|
|
|
class FSmartObjectsModule : public ISmartObjectsModule
|
|
|
|
|
{
|
|
|
|
|
virtual void StartupModule() override;
|
|
|
|
|
virtual void ShutdownModule() override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FSmartObjectsModule, SmartObjectsModule)
|
|
|
|
|
|
|
|
|
|
void FSmartObjectsModule::StartupModule()
|
|
|
|
|
{
|
2021-11-26 12:55:06 -05:00
|
|
|
TArray<FCoreRedirect> Redirects;
|
|
|
|
|
Redirects.Emplace(ECoreRedirectFlags::Type_Class, TEXT("/Script/SmartObjectsModule.SmartObjectBehaviorConfigBase"), TEXT("/Script/SmartObjectsModule.SmartObjectBehaviorDefinition"));
|
|
|
|
|
Redirects.Emplace(ECoreRedirectFlags::Type_Class, TEXT("/Script/SmartObjectsModule.SmartObjectGameplayBehaviorConfig"), TEXT("/Script/SmartObjectsModule.SmartObjectGameplayBehaviorDefinition"));
|
|
|
|
|
|
|
|
|
|
Redirects.Emplace(ECoreRedirectFlags::Type_Property, TEXT("/Script/SmartObjectsModule.SmartObjectDefinition.DefaultBehaviorConfigurations"), TEXT("/Script/SmartObjectsModule.SmartObjectDefinition.DefaultBehaviorDefinitions"));
|
|
|
|
|
Redirects.Emplace(ECoreRedirectFlags::Type_Property, TEXT("/Script/SmartObjectsModule.SmartObjectRequestFilter.BehaviorConfigurationClass"), TEXT("/Script/SmartObjectsModule.SmartObjectRequestFilter.BehaviorDefinitionClass"));
|
|
|
|
|
Redirects.Emplace(ECoreRedirectFlags::Type_Property, TEXT("/Script/SmartObjectsModule.SmartObjectSlot.BehaviorConfigurations"), TEXT("/Script/SmartObjectsModule.SmartObjectSlot.BehaviorDefinitions"));
|
|
|
|
|
|
|
|
|
|
FCoreRedirects::AddRedirectList(Redirects, TEXT("SmartObjectsModule"));
|
|
|
|
|
|
2021-11-03 11:57:26 -04:00
|
|
|
#if WITH_GAMEPLAY_DEBUGGER && WITH_SMARTOBJECT_DEBUG
|
2021-11-03 10:04:28 -04:00
|
|
|
IGameplayDebugger& GameplayDebuggerModule = IGameplayDebugger::Get();
|
|
|
|
|
GameplayDebuggerModule.RegisterCategory("SmartObject",
|
|
|
|
|
IGameplayDebugger::FOnGetCategory::CreateStatic(&FGameplayDebuggerCategory_SmartObject::MakeInstance),
|
|
|
|
|
EGameplayDebuggerCategoryState::EnabledInGameAndSimulate);
|
|
|
|
|
GameplayDebuggerModule.NotifyCategoriesChanged();
|
|
|
|
|
#endif
|
2021-09-28 13:33:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FSmartObjectsModule::ShutdownModule()
|
|
|
|
|
{
|
2021-11-03 11:57:26 -04:00
|
|
|
#if WITH_GAMEPLAY_DEBUGGER && WITH_SMARTOBJECT_DEBUG
|
2021-11-03 10:04:28 -04:00
|
|
|
if (IGameplayDebugger::IsAvailable())
|
|
|
|
|
{
|
|
|
|
|
IGameplayDebugger& GameplayDebuggerModule = IGameplayDebugger::Get();
|
|
|
|
|
GameplayDebuggerModule.UnregisterCategory("SmartObject");
|
|
|
|
|
GameplayDebuggerModule.NotifyCategoriesChanged();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2021-09-28 13:33:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|