diff --git a/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp b/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp index 677edb94830aaa0158f936d2b3af44431e9a3dee..2cfd23435ddcd3ae6a0f31c66e3a0b07d1f9b0d4 100644 --- a/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp +++ b/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp @@ -1,20 +1,10 @@ #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 diff --git a/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h b/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h index 09d2ff296521492d9badfc81083d0e039cbd2110..fa1843ded226c6fcd438ea1e22f1acdc83632906 100644 --- a/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h +++ b/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h @@ -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; }; diff --git a/Source/RWTHVRToolkit/Public/RWTHVRToolkitSettings.h b/Source/RWTHVRToolkit/Public/RWTHVRToolkitSettings.h deleted file mode 100644 index d229f2675f28d6a22a805dcfab5d05f2908310e3..0000000000000000000000000000000000000000 --- a/Source/RWTHVRToolkit/Public/RWTHVRToolkitSettings.h +++ /dev/null @@ -1,40 +0,0 @@ -// 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; -};