From ad35203527fd4770d75a66e022cfc95ceb4297c3 Mon Sep 17 00:00:00 2001 From: Jamie Greunbaum Date: Mon, 29 May 2023 22:22:17 -0400 Subject: [PATCH] Remove CVars for loading screen options to prevent them from constantly resetting the project settings. --- .../Private/CommonLoadingScreenSettings.h | 10 +++---- .../Private/LoadingScreenManager.cpp | 27 ------------------- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h b/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h index cb6217c..d99a5d3 100644 --- a/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h +++ b/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h @@ -2,7 +2,7 @@ #pragma once -#include "Engine/DeveloperSettingsBackedByCVars.h" +#include "Engine/DeveloperSettings.h" #include "HAL/Platform.h" #include "UObject/SoftObjectPath.h" #include "UObject/UObjectGlobals.h" @@ -14,7 +14,7 @@ * Settings for a loading screen system. */ UCLASS(config=Game, defaultconfig, meta=(DisplayName="Common Loading Screen")) -class UCommonLoadingScreenSettings : public UDeveloperSettingsBackedByCVars +class UCommonLoadingScreenSettings : public UDeveloperSettings { GENERATED_BODY() @@ -36,7 +36,7 @@ public: // // Note: This is not normally applied in the editor for iteration time, but can be // enabled via HoldLoadingScreenAdditionalSecsEvenInEditor - UPROPERTY(config, EditAnywhere, Category=Configuration, meta=(ForceUnits=s, ConsoleVariable="CommonLoadingScreen.HoldLoadingScreenAdditionalSecs")) + UPROPERTY(config, EditAnywhere, Category=Configuration, meta=(ForceUnits=s)) float HoldLoadingScreenAdditionalSecs = 0.0f; // The interval in seconds beyond which the loading screen is considered permanently hung (if non-zero). @@ -48,11 +48,11 @@ public: float LogLoadingScreenHeartbeatInterval = 5.0f; // When true, the reason the loading screen is shown or hidden will be printed to the log every frame. - UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.LogLoadingScreenReasonEveryFrame")) + UPROPERTY(Transient, EditAnywhere, Category=Debugging) bool LogLoadingScreenReasonEveryFrame = 0; // Force the loading screen to be displayed (useful for debugging) - UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.AlwaysShow")) + UPROPERTY(Transient, EditAnywhere, Category=Debugging) bool ForceLoadingScreenVisible = false; // Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor diff --git a/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp b/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp index ed299aa..c64a8dc 100644 --- a/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp +++ b/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp @@ -64,33 +64,6 @@ bool ILoadingProcessInterface::ShouldShowLoadingScreen(UObject* TestObject, FStr return false; } -////////////////////////////////////////////////////////////////////// - -namespace LoadingScreenCVars -{ - // CVars - static float HoldLoadingScreenAdditionalSecs = 0.0f; - static FAutoConsoleVariableRef CVarHoldLoadingScreenUpAtLeastThisLongInSecs( - TEXT("CommonLoadingScreen.HoldLoadingScreenAdditionalSecs"), - HoldLoadingScreenAdditionalSecs, - TEXT("How long to hold the loading screen up after other loading finishes (in seconds) to try to give texture streaming a chance to avoid blurriness"), - ECVF_Default | ECVF_Preview); - - static bool LogLoadingScreenReasonEveryFrame = false; - static FAutoConsoleVariableRef CVarLogLoadingScreenReasonEveryFrame( - TEXT("CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"), - LogLoadingScreenReasonEveryFrame, - TEXT("When true, the reason the loading screen is shown or hidden will be printed to the log every frame."), - ECVF_Default); - - static bool ForceLoadingScreenVisible = false; - static FAutoConsoleVariableRef CVarForceLoadingScreenVisible( - TEXT("CommonLoadingScreen.AlwaysShow"), - ForceLoadingScreenVisible, - TEXT("Force the loading screen to show."), - ECVF_Default); -} - ////////////////////////////////////////////////////////////////////// // FLoadingScreenInputPreProcessor