Skip to content
Snippets Groups Projects
Commit 894b60c3 authored by dg128746's avatar dg128746
Browse files

Removed livelink dtrack hack

parent bacad0a7
No related branches found
No related tags found
2 merge requests!13Draft: Improve walking implementation,!9Draft: LiveLink capabilities and 4.27 config assets.
#include "RWTHVRToolkit.h"
#include "ILiveLinkClient.h"
#include "LiveLinkClient.h"
#include "RWTHVRToolkitSettings.h"
#define LOCTEXT_NAMESPACE "FRWTHVRToolkitModule"
void FRWTHVRToolkitModule::StartupModule ()
{
ConsoleActivation.Register();
FCoreDelegates::OnFEngineLoopInitComplete.AddRaw(this, &FRWTHVRToolkitModule::OnEngineLoopInitComplete);
#if WITH_EDITOR
GetMutableDefault<URWTHVRToolkitSettings>()->OnSettingChanged().AddRaw(this, &FRWTHVRToolkitModule::HandleSettingsSaved);
#endif
}
void FRWTHVRToolkitModule::ShutdownModule()
......@@ -22,39 +12,6 @@ void FRWTHVRToolkitModule::ShutdownModule()
ConsoleActivation.Unregister();
}
void FRWTHVRToolkitModule::OnEngineLoopInitComplete()
{
ApplyDefaultPreset();
}
void FRWTHVRToolkitModule::HandleSettingsSaved(UObject* Settings, FPropertyChangedEvent& PropertyChangedEvent)
{
ApplyDefaultPreset();
}
void FRWTHVRToolkitModule::ApplyDefaultPreset()
{
ULiveLinkPreset* StartupPreset = GetDefault<URWTHVRToolkitSettings>()->DefaultLiveLinkPreset.LoadSynchronous();
if (StartupPreset != nullptr)
{
SetLiveLinkPreset(StartupPreset);
}
}
void FRWTHVRToolkitModule::SetLiveLinkPreset(ULiveLinkPreset* Preset)
{
// We should check for a currently applied preset/sources now, and if it includes the ART one.
// If it does, and is active, do not apply it again.
const FLiveLinkClient& LiveLinkClient = IModularFeatures::Get().GetModularFeature<FLiveLinkClient>(ILiveLinkClient::ModularFeatureName);
if (LiveLinkPreset == nullptr && LiveLinkClient.GetSources().Num() == 0 )
{
LiveLinkPreset = Preset;
LiveLinkPreset->ApplyToClient();
}
}
#undef LOCTEXT_NAMESPACE
......
......@@ -3,7 +3,6 @@
#include "CoreMinimal.h"
#include "Fixes/ActivateConsoleInShipping.h"
class ULiveLinkPreset;
class FRWTHVRToolkitModule : public IModuleInterface
{
......@@ -11,14 +10,6 @@ public:
virtual void StartupModule () override;
virtual void ShutdownModule() override;
void SetLiveLinkPreset(ULiveLinkPreset* Preset);
private:
void OnEngineLoopInitComplete();
void HandleSettingsSaved(UObject* Settings, FPropertyChangedEvent& PropertyChangedEvent);
void ApplyDefaultPreset();
FActivateConsoleInShipping ConsoleActivation;
ULiveLinkPreset* LiveLinkPreset = nullptr;
};
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreTypes.h"
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "Engine/EngineTypes.h"
#include "Templates/SubclassOf.h"
#include "LiveLinkPreset.h"
#include "Utility/DemoConfig.h"
#include "RWTHVRToolkitSettings.generated.h"
/**
* Settings for LiveLink.
*/
UCLASS(config=RWTHVRToolkit, defaultconfig)
class RWTHVRTOOLKIT_API URWTHVRToolkitSettings : public UDemoConfig
{
GENERATED_BODY()
virtual FName GetCategoryName() const override { return "Plugins"; };
#if WITH_EDITOR
virtual FText GetSectionText() const override { return FText::FromString("RWTH VR Toolkit"); };
#endif
public:
URWTHVRToolkitSettings() = default;
public:
/** The default preset that should be applied */
UPROPERTY(config, EditAnywhere, Category = "LiveLink")
TSoftObjectPtr<ULiveLinkPreset> DefaultLiveLinkPreset;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment