Module |
|
Header |
/Engine/Source/Runtime/Core/Public/HAL/IConsoleManager.h |
Include |
#include "HAL/IConsoleManager.h" |
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_SetFlagMask = 0x00ff0000,
ECVF_Set_NoSinkCall_Unsafe = 0x00010000,
ECVF_SetByMask = 0xff000000,
ECVF_SetByConstructor = 0x00000000,
ECVF_SetByScalability = 0x01000000,
ECVF_SetByGameSetting = 0x02000000,
ECVF_SetByProjectSetting = 0x03000000,
ECVF_SetBySystemSettingsIni = 0x04000000,
ECVF_SetByDeviceProfile = 0x05000000,
ECVF_SetByConsoleVariablesIni = 0x06000000,
ECVF_SetByCommandline = 0x07000000,
ECVF_SetByCode = 0x08000000,
ECVF_SetByConsole = 0x09000000,
}
Name |
Description |
---|---|
ECVF_FlagMask |
Mask for flags. Use this instead of ~ECVF_SetByMask |
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. |
ECVF_ReadOnly |
Console variables cannot be changed by the user (from console). |
ECVF_Unregistered |
UnregisterConsoleObject() was called on this one. |
ECVF_CreatedFromIni |
This flag is set by the ini loading code when the variable wasn't registered yet. |
ECVF_RenderThreadSafe |
Maintains another shadow copy and updates the copy with render thread commands to maintain proper ordering. |
ECVF_Scalability |
ApplyCVarSettingsGroupFromIni will complain if this wasn't set, should not be combined with ECVF_Cheat |
ECVF_ScalabilityGroup |
Those cvars control other cvars with the flag ECVF_Scalability, names should start with "sg." |
ECVF_SetFlagMask |
Set flags |
ECVF_Set_NoSinkCall_Unsafe |
Use to set a cvar without calling all cvar sinks. Much faster, but potentially unsafe. Use only if you know the particular cvar/setting does not require a sink call. |
ECVF_SetByMask |
To get some history of where the last value was set by ( useful for track down why a cvar is in a specific state |
ECVF_SetByConstructor |
Lowest priority (default after console variable creation) |
ECVF_SetByScalability |
From Scalability.ini (lower priority than game settings so it's easier to override partially) |
ECVF_SetByGameSetting |
(in game UI or from file) |
ECVF_SetByProjectSetting |
Project settings (editor UI or from file, higher priority than game setting to allow to enforce some setting fro this project) |
ECVF_SetBySystemSettingsIni |
Per project setting (ini file e.g. Engine.ini or Game.ini) |
ECVF_SetByDeviceProfile |
Per device setting (e.g. specific iOS device, higher priority than per project to do device specific settings) |
ECVF_SetByConsoleVariablesIni |
Consolevariables.ini (for multiple projects) |
ECVF_SetByCommandline |
A minus command e.g. -VSync (very high priority to enforce the setting for the application) |
ECVF_SetByCode |
Least useful, likely a hack, maybe better to find the correct SetBy... |
ECVF_SetByConsole |
Editor UI or console in game or editor |
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:
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, ..