UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IConsoleManager.h File Reference

Go to the source code of this file.

Classes

class  IConsoleObject
 
class  IConsoleVariable
 
struct  IConsoleVariable::FResolvedContext
 
struct  IConsoleVariable::FSetContext
 
struct  IConsoleCommand
 
struct  IConsoleThreadPropagation
 
class  FConsoleVariableSinkHandle
 
struct  FConsoleSuggestion
 
class  IConsoleCommandExecutor
 
struct  IConsoleManager
 
struct  TGuardConsoleVariable< T >
 
class  FAutoConsoleVariableSink
 
class  FAutoConsoleObject
 
class  FAutoConsoleVariable
 
class  FAutoConsoleVariableRef
 
class  TConsoleVariableData< T >
 
class  TAutoConsoleVariable< T >
 
class  FAutoConsoleCommand
 
class  FAutoConsoleCommandWithWorld
 
class  FAutoConsoleCommandWithWorldAndArgs
 
class  FAutoConsoleCommandWithArgsAndOutputDevice
 
class  FAutoConsoleCommandWithOutputDevice
 
class  FAutoConsoleCommandWithWorldArgsAndOutputDevice
 
class  FAutoConsoleVariableShadow
 
class  FAutoConsoleVariableDeprecated
 
class  FAutoConsoleCommandDeprecated
 
class  TAutoRangedConsoleVariable< T >
 

Namespaces

namespace  ConsoleVariablePlatformMapping
 

Macros

#define TRACK_CONSOLE_FIND_COUNT   !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
 
#define cvarCheckCode(...)
 
#define SETBY_ERROR   ((EConsoleVariableFlags)0x01000000)
 
#define ENUMERATE_SET_BY(op)
 

Enumerations

enum  EConsoleVariableFlags {
  ECVF_FlagMask = 0x0000ffff , ECVF_Default = 0x0 , ECVF_Cheat = 0x1 , ECVF_ReadOnly = 0x4 ,
  ECVF_Unregistered = 0x8 , ECVF_CreatedFromIni = 0x10 , ECVF_RenderThreadSafe = 0x20 , ECVF_Scalability = 0x40 ,
  ECVF_ScalabilityGroup = 0x80 , ECVF_Preview = 0x100 , ECVF_GeneralShaderChange = 0x200 , ECVF_MobileShaderChange = 0x400 ,
  ECVF_DesktopShaderChange = 0x800 , ECVF_ExcludeFromPreview = 0x1000 , ECVF_SaveForNextBoot = 0x2000 , ECVF_SetFlagMask = 0x00ff0000 ,
  ECVF_Set_NoSinkCall_Unsafe = 0x00010000 , ECVF_Set_SetOnly_Unsafe = 0x00020000 , ECVF_Set_ReplaceExistingTag = 0x00040000 , ECVF_SetByMask = 0xff000000 ,
  ECVF_SetByConstructor = 0x00000000 , ECVF_SetByScalability = 0x02000000 , ECVF_SetByGameSetting = 0x03000000 , ECVF_SetByProjectSetting = 0x04000000 ,
  ECVF_SetBySystemSettingsIni = 0x05000000 , ECVF_SetByPluginLowPriority = 0x06000000 , ECVF_SetByDeviceProfile = 0x07000000 , ECVF_SetByPluginHighPriority = 0x08000000 ,
  ECVF_SetByGameOverride = 0x09000000 , ECVF_SetByConsoleVariablesIni = 0x0A000000 , ECVF_SetByHotfix = 0x0B000000 , ECVF_SetByPreview = 0x0C000000 ,
  ECVF_SetByCommandline = 0x0D000000 , ECVF_SetByCode = 0x0E000000 , ECVF_SetByConsole = 0x0F000000
}
 
enum class  EShadowCVarBehavior : uint8 {
  NoMessaging , Warn , Error , Ensure ,
  Assert
}
 

Functions

CORE_API const TCHARGetConsoleVariableSetByName (EConsoleVariableFlags ConsoleVariableFlags)
 
CORE_API EConsoleVariableFlags GetConsoleVariableSetByValue (const TCHAR *SetByName)
 
 DECLARE_DELEGATE_OneParam (FConsoleVariableDelegate, IConsoleVariable *)
 
 DECLARE_MULTICAST_DELEGATE_OneParam (FConsoleVariableMulticastDelegate, IConsoleVariable *)
 
 DECLARE_MULTICAST_DELEGATE_TwoParams (FConsoleObjectWithNameMulticastDelegate, const TCHAR *, IConsoleObject *)
 
 DECLARE_DELEGATE (FConsoleCommandDelegate)
 
 DECLARE_DELEGATE_OneParam (FConsoleCommandWithArgsDelegate, const TArray< FString > &)
 
 DECLARE_DELEGATE_OneParam (FConsoleCommandWithWorldDelegate, UWorld *)
 
 DECLARE_DELEGATE_TwoParams (FConsoleCommandWithWorldAndArgsDelegate, const TArray< FString > &, UWorld *)
 
 DECLARE_DELEGATE_TwoParams (FConsoleCommandWithArgsAndOutputDeviceDelegate, const TArray< FString > &, FOutputDevice &)
 
 DECLARE_DELEGATE_ThreeParams (FConsoleCommandWithWorldArgsAndOutputDeviceDelegate, const TArray< FString > &, UWorld *, FOutputDevice &)
 
 DECLARE_DELEGATE_OneParam (FConsoleCommandWithOutputDeviceDelegate, FOutputDevice &)
 
 DECLARE_DELEGATE_TwoParams (FConsoleObjectVisitor, const TCHAR *, IConsoleObject *)
 
CORE_API DECLARE_LOG_CATEGORY_EXTERN (LogConsoleResponse, Log, All)
 

Macro Definition Documentation

◆ cvarCheckCode

#define cvarCheckCode (   ...)

◆ ENUMERATE_SET_BY

#define ENUMERATE_SET_BY (   op)
Value:
op(Code) \
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define op
Definition Scalability.cpp:198

◆ SETBY_ERROR

#define SETBY_ERROR   ((EConsoleVariableFlags)0x01000000)

◆ TRACK_CONSOLE_FIND_COUNT

#define TRACK_CONSOLE_FIND_COUNT   !(UE_BUILD_SHIPPING || UE_BUILD_TEST)

Enumeration Type Documentation

◆ EConsoleVariableFlags

Console variable usage guide:

The variable should be creates early in the initialization but not before (not in global variable construction). Choose the right variable type, consider using a console command if more functionality is needed (see Exec()). Available types: bool, int, float, bool&, int&, float&, string Always provide a good help text, other should be able to understand the function of the console variable by reading this help. The help length should be limited to a reasonable width in order to work well for low res screen resolutions.

Usage in the game console: <COMMAND> ? print the HELP <COMMAND> print the current state of the console variable <COMMAND> x set and print the new state of the console variable

All variables support auto completion. The single line help that can show up there is currently not connected to the help as the help text is expected to be multi line. The former Exec() system can be used to access the console variables. Use console variables only in main thread. The state of console variables is not network synchronized or serialized (load/save). The plan is to allow to set the state in external files (game/platform/engine/local). Bitmask 0x1, 0x2, 0x4, ..

Enumerator
ECVF_FlagMask 
ECVF_Default 

Default, no flags are set, the value is set by the constructor

ECVF_Cheat 

Console variables marked with this flag behave differently in a final release build. Then they are are hidden in the console and cannot be changed by the user.

ECVF_ReadOnly 

Console variables cannot be changed by the user (from console). Changing from C++ or ini is still possible.

ECVF_Unregistered 

UnregisterConsoleObject() was called on this one. If the variable is registered again with the same type this object is reactivated. This is good for DLL unloading.

ECVF_CreatedFromIni 

This flag is set by the ini loading code when the variable wasn't registered yet. Once the variable is registered later the value is copied over and the variable is destructed.

ECVF_RenderThreadSafe 

Maintains another shadow copy and updates the copy with render thread commands to maintain proper ordering. Could be extended for more/other thread. Note: On console variable references it assumes the reference is accessed on the render thread only (Don't use in any other thread or better don't use references to avoid the potential pitfall).

ECVF_Scalability 
ECVF_ScalabilityGroup 
ECVF_Preview 
ECVF_GeneralShaderChange 
ECVF_MobileShaderChange 
ECVF_DesktopShaderChange 
ECVF_ExcludeFromPreview 
ECVF_SaveForNextBoot 

CVars with this flag will be saved into local temp file for next boot after hotfixed. Normally use for feature switch which is too early, even before launching the hotfix http request Use it carefully with these constrains in mind:

  • WARNING: This exposes the config to end user who could change it through the local temp file in shipping client, it's your responsibility to make sure client can't "legally" cheat through this type of CVar;
  • For the first time get hotfixed, the value will change from default value during boot to the hotfixed value after the hotfix http request, so make sure caching it when boot if the logic doesn't support to change at runtime;
  • When there is a new released game version, the saved local temp file of last version could still be there. So it will still got read once. Keep the logic work well with the old value, or remove the CVar if the old value no longer supported;
  • It will only work for game client, not for dedicated servers which will be dynamically allocated on different server instances.
ECVF_SetFlagMask 
ECVF_Set_NoSinkCall_Unsafe 
ECVF_Set_SetOnly_Unsafe 
ECVF_Set_ReplaceExistingTag 
ECVF_SetByMask 
ECVF_SetByConstructor 
ECVF_SetByScalability 
ECVF_SetByGameSetting 
ECVF_SetByProjectSetting 
ECVF_SetBySystemSettingsIni 
ECVF_SetByPluginLowPriority 
ECVF_SetByDeviceProfile 
ECVF_SetByPluginHighPriority 
ECVF_SetByGameOverride 
ECVF_SetByConsoleVariablesIni 
ECVF_SetByHotfix 
ECVF_SetByPreview 
ECVF_SetByCommandline 
ECVF_SetByCode 
ECVF_SetByConsole 

◆ EShadowCVarBehavior

enum class EShadowCVarBehavior : uint8
strong
Enumerator
NoMessaging 
Warn 
Error 
Ensure 
Assert 

Function Documentation

◆ DECLARE_DELEGATE()

DECLARE_DELEGATE ( FConsoleCommandDelegate  )

Console command delegate type (takes no arguments.) This is a void callback function.

◆ DECLARE_DELEGATE_OneParam() [1/4]

DECLARE_DELEGATE_OneParam ( FConsoleCommandWithArgsDelegate  ,
const TArray< FString > &   
)

Console command delegate type (with arguments.) This is a void callback function that always takes a list of arguments.

◆ DECLARE_DELEGATE_OneParam() [2/4]

DECLARE_DELEGATE_OneParam ( FConsoleCommandWithOutputDeviceDelegate  ,
FOutputDevice  
)

Console command delegate type with the output device passed through.

◆ DECLARE_DELEGATE_OneParam() [3/4]

DECLARE_DELEGATE_OneParam ( FConsoleCommandWithWorldDelegate  ,
UWorld  
)

Console command delegate type with a world argument. This is a void callback function that always takes a world.

◆ DECLARE_DELEGATE_OneParam() [4/4]

DECLARE_DELEGATE_OneParam ( FConsoleVariableDelegate  ,
IConsoleVariable  
)

Console variable delegate type This is a void callback function.

◆ DECLARE_DELEGATE_ThreeParams()

DECLARE_DELEGATE_ThreeParams ( FConsoleCommandWithWorldArgsAndOutputDeviceDelegate  ,
const TArray< FString > &  ,
UWorld ,
FOutputDevice  
)

Console command delegate type (with a world arguments and output device.) This is a void callback function that always takes a list of arguments, a world and output device.

◆ DECLARE_DELEGATE_TwoParams() [1/3]

DECLARE_DELEGATE_TwoParams ( FConsoleCommandWithArgsAndOutputDeviceDelegate  ,
const TArray< FString > &  ,
FOutputDevice  
)

Console command delegate type (with arguments and output device.) This is a void callback function that always takes a list of arguments and output device.

◆ DECLARE_DELEGATE_TwoParams() [2/3]

DECLARE_DELEGATE_TwoParams ( FConsoleCommandWithWorldAndArgsDelegate  ,
const TArray< FString > &  ,
UWorld  
)

Console command delegate type (with a world and arguments.) This is a void callback function that always takes a list of arguments and a world.

◆ DECLARE_DELEGATE_TwoParams() [3/3]

DECLARE_DELEGATE_TwoParams ( FConsoleObjectVisitor  ,
const TCHAR ,
IConsoleObject  
)

Declares a delegate type that's used by the console manager to call back into a user function for each known console object.

First parameter is the Name string for the current console object Second parameter is the current console object

◆ DECLARE_LOG_CATEGORY_EXTERN()

CORE_API DECLARE_LOG_CATEGORY_EXTERN ( LogConsoleResponse  ,
Log  ,
All   
)

◆ DECLARE_MULTICAST_DELEGATE_OneParam()

DECLARE_MULTICAST_DELEGATE_OneParam ( FConsoleVariableMulticastDelegate  ,
IConsoleVariable  
)

Console variable multicast delegate type.

◆ DECLARE_MULTICAST_DELEGATE_TwoParams()

DECLARE_MULTICAST_DELEGATE_TwoParams ( FConsoleObjectWithNameMulticastDelegate  ,
const TCHAR ,
IConsoleObject  
)

Console object with name multicast delegate type.

◆ GetConsoleVariableSetByName()

CORE_API const TCHAR * GetConsoleVariableSetByName ( EConsoleVariableFlags  ConsoleVariableFlags)
extern

Returns human readable ECVF_SetByMask bits of the console variable flags.

◆ GetConsoleVariableSetByValue()

CORE_API EConsoleVariableFlags GetConsoleVariableSetByValue ( const TCHAR SetByName)
extern