Files
UnrealEngineUWP/Engine/Source/Developer/Lumin/LuminPlatformEditor/Private/MagicLeapSDKSettings.cpp
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

62 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MagicLeapSDKSettings.h"
#include "Interfaces/ITargetPlatformManagerModule.h"
#include "Interfaces/IAndroidDeviceDetection.h"
#include "Misc/Paths.h"
DEFINE_LOG_CATEGORY_STATIC(MagicLeapSDKSettings, Log, All);
UMagicLeapSDKSettings::UMagicLeapSDKSettings()
: TargetManagerModule(nullptr)
, LuminDeviceDetection(nullptr)
{
}
#if WITH_EDITOR
void UMagicLeapSDKSettings::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);
UpdateTargetModulePaths();
}
void UMagicLeapSDKSettings::SetTargetModule(ITargetPlatformManagerModule* InTargetManagerModule)
{
TargetManagerModule = InTargetManagerModule;
}
void UMagicLeapSDKSettings::SetDeviceDetection(IAndroidDeviceDetection* InLuminDeviceDetection)
{
LuminDeviceDetection = InLuminDeviceDetection;
}
void UMagicLeapSDKSettings::UpdateTargetModulePaths()
{
TArray<FString> Keys;
TArray<FString> Values;
if (!MLSDKPath.Path.IsEmpty())
{
FPaths::NormalizeFilename(MLSDKPath.Path);
Keys.Add(TEXT("MLSDK"));
Values.Add(MLSDKPath.Path);
}
SaveConfig();
if (Keys.Num() != 0)
{
if (TargetManagerModule != nullptr)
{
TargetManagerModule->UpdatePlatformEnvironment(TEXT("Lumin"), Keys, Values);
}
if (LuminDeviceDetection != nullptr)
{
LuminDeviceDetection->UpdateADBPath();
}
}
}
#endif