CommonLoadingScreen.AlwaysShow
CommonLoadingScreen.AlwaysShow
#Overview
name: CommonLoadingScreen.AlwaysShow
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Force the loading screen to show.
It is referenced in 8
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of CommonLoadingScreen.AlwaysShow is to force the loading screen to be displayed, which is particularly useful for debugging purposes. This variable is part of the CommonLoadingScreen plugin, which is responsible for managing and displaying loading screens in Unreal Engine projects.
This setting variable is primarily used in the CommonLoadingScreen module, specifically within the LoadingScreenManager class. It’s part of the debugging tools provided by the plugin to help developers test and refine their loading screen implementations.
The value of this variable is set through multiple mechanisms:
- It’s defined as a console variable, allowing runtime modification.
- It’s exposed as an UPROPERTY in the UCommonLoadingScreenSettings class, making it accessible through the Unreal Editor’s project settings.
The associated variable ForceLoadingScreenVisible interacts directly with CommonLoadingScreen.AlwaysShow. They share the same value and purpose, with ForceLoadingScreenVisible being the internal representation used within the C++ code.
Developers should be aware that:
- This variable is intended for debugging purposes and should not be left enabled in production builds.
- Enabling this will force the loading screen to show regardless of the actual loading state, which could potentially mask real loading issues.
Best practices when using this variable include:
- Use it temporarily during development to test loading screen appearance and behavior.
- Ensure it’s disabled before building for release.
- Use in conjunction with other debugging tools provided by the CommonLoadingScreen plugin for comprehensive testing.
Regarding the associated variable ForceLoadingScreenVisible:
- It serves the same purpose as CommonLoadingScreen.AlwaysShow.
- It’s used internally within the LoadingScreenManager to determine if the loading screen should be forcibly displayed.
- It’s set by the console variable system, allowing for runtime changes.
- Developers should treat it as they would CommonLoadingScreen.AlwaysShow, being cautious not to leave it enabled in production code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h:51
Scope (from outer to inner):
file
class class UCommonLoadingScreenSettings : public UDeveloperSettingsBackedByCVars
Source code excerpt:
// Force the loading screen to be displayed (useful for debugging)
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.AlwaysShow"))
bool ForceLoadingScreenVisible = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
// (useful when iterating on loading screens)
UPROPERTY(Transient, EditAnywhere, Category=Debugging)
bool HoldLoadingScreenAdditionalSecsEvenInEditor = false;
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:85
Scope (from outer to inner):
file
namespace LoadingScreenCVars
Source code excerpt:
static bool ForceLoadingScreenVisible = false;
static FAutoConsoleVariableRef CVarForceLoadingScreenVisible(
TEXT("CommonLoadingScreen.AlwaysShow"),
ForceLoadingScreenVisible,
TEXT("Force the loading screen to show."),
ECVF_Default);
}
//////////////////////////////////////////////////////////////////////
#Associated Variable and Callsites
This variable is associated with another variable named ForceLoadingScreenVisible
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h:49
Scope (from outer to inner):
file
class class UCommonLoadingScreenSettings : public UDeveloperSettingsBackedByCVars
Source code excerpt:
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"))
bool LogLoadingScreenReasonEveryFrame = 0;
// Force the loading screen to be displayed (useful for debugging)
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.AlwaysShow"))
bool ForceLoadingScreenVisible = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
// (useful when iterating on loading screens)
UPROPERTY(Transient, EditAnywhere, Category=Debugging)
bool HoldLoadingScreenAdditionalSecsEvenInEditor = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
// (useful when iterating on loading screens)
UPROPERTY(config, EditAnywhere, Category=Configuration)
bool ForceTickLoadingScreenEvenInEditor = true;
};
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:80
Scope (from outer to inner):
file
namespace LoadingScreenCVars
Source code excerpt:
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
// Input processor to throw in when loading screen is shown
// This will capture any inputs, so active menus under the loading screen will not interact
class FLoadingScreenInputPreProcessor : public IInputProcessor
{
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:247
Scope (from outer to inner):
file
function bool ULoadingScreenManager::CheckForAnyNeedToShowLoadingScreen
Source code excerpt:
// Start out with 'unknown' reason in case someone forgets to put a reason when changing this in the future.
DebugReasonForShowingOrHidingLoadingScreen = TEXT("Reason for Showing/Hiding LoadingScreen is unknown!");
const UGameInstance* LocalGameInstance = GetGameInstance();
if (LoadingScreenCVars::ForceLoadingScreenVisible)
{
DebugReasonForShowingOrHidingLoadingScreen = FString(TEXT("CommonLoadingScreen.AlwaysShow is true"));
return true;
}
const FWorldContext* Context = LocalGameInstance->GetWorldContext();
if (Context == nullptr)
{
// We don't have a world context right now... better show a loading screen
DebugReasonForShowingOrHidingLoadingScreen = FString(TEXT("The game instance has a null WorldContext"));
return true;
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/CommonLoadingScreenSettings.h:49
Scope (from outer to inner):
file
class class UCommonLoadingScreenSettings : public UDeveloperSettingsBackedByCVars
Source code excerpt:
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.LogLoadingScreenReasonEveryFrame"))
bool LogLoadingScreenReasonEveryFrame = 0;
// Force the loading screen to be displayed (useful for debugging)
UPROPERTY(Transient, EditAnywhere, Category=Debugging, meta=(ConsoleVariable="CommonLoadingScreen.AlwaysShow"))
bool ForceLoadingScreenVisible = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
// (useful when iterating on loading screens)
UPROPERTY(Transient, EditAnywhere, Category=Debugging)
bool HoldLoadingScreenAdditionalSecsEvenInEditor = false;
// Should we apply the additional HoldLoadingScreenAdditionalSecs delay even in the editor
// (useful when iterating on loading screens)
UPROPERTY(config, EditAnywhere, Category=Configuration)
bool ForceTickLoadingScreenEvenInEditor = true;
};
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:80
Scope (from outer to inner):
file
namespace LoadingScreenCVars
Source code excerpt:
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
// Input processor to throw in when loading screen is shown
// This will capture any inputs, so active menus under the loading screen will not interact
class FLoadingScreenInputPreProcessor : public IInputProcessor
{
#Loc: <Workspace>/Projects/Lyra/Plugins/CommonLoadingScreen/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp:247
Scope (from outer to inner):
file
function bool ULoadingScreenManager::CheckForAnyNeedToShowLoadingScreen
Source code excerpt:
// Start out with 'unknown' reason in case someone forgets to put a reason when changing this in the future.
DebugReasonForShowingOrHidingLoadingScreen = TEXT("Reason for Showing/Hiding LoadingScreen is unknown!");
const UGameInstance* LocalGameInstance = GetGameInstance();
if (LoadingScreenCVars::ForceLoadingScreenVisible)
{
DebugReasonForShowingOrHidingLoadingScreen = FString(TEXT("CommonLoadingScreen.AlwaysShow is true"));
return true;
}
const FWorldContext* Context = LocalGameInstance->GetWorldContext();
if (Context == nullptr)
{
// We don't have a world context right now... better show a loading screen
DebugReasonForShowingOrHidingLoadingScreen = FString(TEXT("The game instance has a null WorldContext"));
return true;