Navigation
API > API/Runtime > API/Runtime/Engine
Stores user settings for a game (for example graphics and sound settings), with the ability to save and load to and from a file.
| Name | UGameUserSettings |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/GameFramework/GameUserSettings.h |
| Include Path | #include "GameFramework/GameUserSettings.h" |
Syntax
UCLASS (Config=GameUserSettings, ConfigDoNotCheckDefaults, MinimalAPI)
class UGameUserSettings : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UGameUserSettings
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UGameUserSettings
(
const FObjectInitializer& ObjectInitializer |
GameFramework/GameUserSettings.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FUpdateCloudDataFromGameUserSettings | TBaseDelegate_OneParam< bool, const FString & > | We call this to notify any listening Cloud subsystem that we have updated the config file. | GameFramework/GameUserSettings.h |
| FUpdateGameUserSettingsFileFromCloud | TBaseDelegate_OneParam< bool, const FString & > | We call this to refresh the config file from a listening Cloud subsystem, before we open it. | GameFramework/GameUserSettings.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bUseDynamicResolution | bool | Whether to use dynamic resolution or not. (public to allow UI to connect to it) | GameFramework/GameUserSettings.h |
|
| bUseVSync | bool | Whether to use VSync or not. (public to allow UI to connect to it) | GameFramework/GameUserSettings.h |
|
| OnUpdateCloudDataFromGameUserSettings | FUpdateCloudDataFromGameUserSettings | GameFramework/GameUserSettings.h | ||
| OnUpdateGameUserSettingsFileFromCloud | FUpdateGameUserSettingsFileFromCloud | GameFramework/GameUserSettings.h | ||
| ScalabilityQuality | Scalability::FQualityLevels | Cached for the UI, current state if stored in console variables | GameFramework/GameUserSettings.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnGameUserSettingsUINeedsUpdate | FOnGameUserSettingsUINeedsUpdate | GameFramework/GameUserSettings.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ApplyHardwareBenchmarkResults() |
Applies the settings stored in ScalabilityQuality and saves settings | GameFramework/GameUserSettings.h |
|
virtual void ApplyNonResolutionSettings() |
GameFramework/GameUserSettings.h |
|
|
void ApplyResolutionSettings
(
bool bCheckForCommandLineOverrides |
GameFramework/GameUserSettings.h |
|
|
virtual void ApplySettings
(
bool bCheckForCommandLineOverrides |
Applies all current user settings to the game and saves to permanent storage (e.g. file), optionally checking for command line overrides. | GameFramework/GameUserSettings.h |
|
virtual void ConfirmVideoMode() |
Mark current video mode settings (fullscreenmode/resolution) as being confirmed by the user | GameFramework/GameUserSettings.h |
|
void EnableHDRDisplayOutput
(
bool bEnable, |
Enables or disables HDR display output. Can be called again to change the desired nit level | GameFramework/GameUserSettings.h |
|
int32 GetAntiAliasingQuality() |
Returns the anti-aliasing quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
int32 GetAudioQualityLevel() |
Returns the user's audio quality level setting | GameFramework/GameUserSettings.h |
|
int32 GetCurrentHDRDisplayNits() |
Returns 0 if HDR isn't supported or is turned off | GameFramework/GameUserSettings.h |
|
virtual float GetDefaultResolutionScale() |
Gets the desired resolution quality based on DesiredScreenWidth/Height and the current screen resolution | GameFramework/GameUserSettings.h |
|
FIntPoint GetDesktopResolution() |
Returns user's desktop resolution, in pixels. | GameFramework/GameUserSettings.h |
|
int32 GetFoliageQuality() |
Returns the foliage quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
float GetFrameRateLimit() |
Gets the user's frame rate limit (0 indiciates the frame rate limit is disabled) | GameFramework/GameUserSettings.h |
|
EWindowMode::Type GetFullscreenMode() |
Returns the user setting for game window fullscreen mode. | GameFramework/GameUserSettings.h |
|
int32 GetGlobalIlluminationQuality() |
Returns the global illumination quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
EWindowMode::Type GetLastConfirmedFullscreenMode() |
Returns the last confirmed user setting for game window fullscreen mode. | GameFramework/GameUserSettings.h |
|
FIntPoint GetLastConfirmedScreenResolution() |
Returns the last confirmed user setting for game screen resolution, in pixels. | GameFramework/GameUserSettings.h |
|
float GetLastCPUBenchmarkResult() |
Returns the last CPU benchmark result (set by RunHardwareBenchmark) | GameFramework/GameUserSettings.h | |
TArray< float > GetLastCPUBenchmarkSteps() |
Returns each individual step of the last CPU benchmark result (set by RunHardwareBenchmark) | GameFramework/GameUserSettings.h | |
float GetLastGPUBenchmarkResult() |
Returns the last GPU benchmark result (set by RunHardwareBenchmark) | GameFramework/GameUserSettings.h | |
TArray< float > GetLastGPUBenchmarkSteps() |
Returns each individual step of the last GPU benchmark result (set by RunHardwareBenchmark) | GameFramework/GameUserSettings.h | |
int32 GetMaxNumWindowPositionSaveSlots() |
Returns the maximum supported number save slots for window positions. | GameFramework/GameUserSettings.h | |
virtual int32 GetOverallScalabilityLevel() |
Returns the overall scalability level (can return -1 if the settings are custom) | GameFramework/GameUserSettings.h |
|
int32 GetPostProcessingQuality() |
Returns the post-processing quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
EWindowMode::Type GetPreferredFullscreenMode() |
Returns the user setting for game window fullscreen mode. | GameFramework/GameUserSettings.h |
|
virtual float GetRecommendedResolutionScale() |
Gets the recommended resolution quality based on LastRecommendedScreenWidth/Height and the current screen resolution | GameFramework/GameUserSettings.h |
|
int32 GetReflectionQuality() |
Returns the reflection quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void GetResolutionScaleInformationEx
(
float& CurrentScaleNormalized, |
Returns the current resolution scale and the range. | GameFramework/GameUserSettings.h |
|
float GetResolutionScaleNormalized() |
Gets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue. | GameFramework/GameUserSettings.h |
|
FIntPoint GetScreenResolution() |
Returns the user setting for game screen resolution, in pixels. | GameFramework/GameUserSettings.h |
|
int32 GetShadingQuality() |
Returns the shading quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
int32 GetShadowQuality() |
Returns the shadow quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
int32 GetTextureQuality() |
Returns the texture quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
int32 GetViewDistanceQuality() |
Returns the view distance quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
int32 GetVisualEffectQuality() |
Returns the visual effects quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
virtual FIntPoint GetWindowPosition
(
int32 SaveSlotIndex |
Returns the window position in the given index, or the default if the index is invalid. | GameFramework/GameUserSettings.h | |
virtual FIntPoint GetWindowPosition () |
Returns the window position in save slot index 0. | GameFramework/GameUserSettings.h | |
virtual bool IsDirty() |
Checks if any user settings is different from current | GameFramework/GameUserSettings.h |
|
bool IsDynamicResolutionDirty() |
Checks if the dynamic resolution user setting is different from current system setting | GameFramework/GameUserSettings.h |
|
virtual bool IsDynamicResolutionEnabled() |
Returns the user setting for dynamic resolution. | GameFramework/GameUserSettings.h |
|
bool IsFullscreenModeDirty() |
Checks if the FullscreenMode user setting is different from current | GameFramework/GameUserSettings.h |
|
bool IsHDREnabled() |
GameFramework/GameUserSettings.h |
|
|
bool IsScreenResolutionDirty() |
Checks if the Screen Resolution user setting is different from current | GameFramework/GameUserSettings.h |
|
bool IsVSyncDirty() |
Checks if the vsync user setting is different from current system setting | GameFramework/GameUserSettings.h |
|
bool IsVSyncEnabled() |
Returns the user setting for vsync. | GameFramework/GameUserSettings.h |
|
virtual void LoadSettings
(
bool bForceReload |
Loads the user settings from persistent storage | GameFramework/GameUserSettings.h |
|
void ReloadWindowPositions () |
Reloads the WindowPositions array from config files. | GameFramework/GameUserSettings.h | |
void RequestUIUpdate() |
GameFramework/GameUserSettings.h | ||
virtual void ResetToCurrentSettings() |
This function resets all settings to the current system settings | GameFramework/GameUserSettings.h |
|
void RevertVideoMode() |
Revert video mode (fullscreenmode/resolution) back to the last user confirmed values | GameFramework/GameUserSettings.h |
|
virtual void RunHardwareBenchmark
(
int32 WorkScale, |
Runs the hardware benchmark and populates ScalabilityQuality as well as the last benchmark results config members, but does not apply the settings it determines. | GameFramework/GameUserSettings.h |
|
virtual void SaveSettings() |
Save the user settings to persistent storage (automatically happens as part of ApplySettings) | GameFramework/GameUserSettings.h |
|
void SetAntiAliasingQuality
(
int32 Value |
Sets the anti-aliasing quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetAudioQualityLevel
(
int32 QualityLevel |
Sets the user's audio quality level setting | GameFramework/GameUserSettings.h |
|
void SetBenchmarkFallbackValues() |
Set scalability settings to sensible fallback values, for use when the benchmark fails or potentially causes a crash | GameFramework/GameUserSettings.h |
|
void SetDynamicResolutionEnabled
(
bool bEnable |
Sets the user setting for dynamic resolution. See UGameUserSettings::bUseDynamicResolution. | GameFramework/GameUserSettings.h |
|
void SetFoliageQuality
(
int32 Value |
Sets the foliage quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetFrameRateLimit
(
float NewLimit |
Sets the user's frame rate limit (0 will disable frame rate limiting) | GameFramework/GameUserSettings.h |
|
void SetFullscreenMode
(
EWindowMode::Type InFullscreenMode |
Sets the user setting for the game window fullscreen mode. See UGameUserSettings::FullscreenMode. | GameFramework/GameUserSettings.h |
|
void SetGlobalIlluminationQuality
(
int32 Value |
Sets the global illumination quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
virtual void SetOverallScalabilityLevel
(
int32 Value |
Changes all scalability settings at once based on a single overall quality level | GameFramework/GameUserSettings.h |
|
void SetPostProcessingQuality
(
int32 Value |
Sets the post-processing quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetReflectionQuality
(
int32 Value |
Sets the reflection quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetResolutionScaleNormalized
(
float NewScaleNormalized |
Sets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue. | GameFramework/GameUserSettings.h |
|
void SetResolutionScaleValueEx
(
float NewScaleValue |
Sets the current resolution scale. | GameFramework/GameUserSettings.h |
|
void SetScreenResolution
(
FIntPoint Resolution |
Sets the user setting for game screen resolution, in pixels. | GameFramework/GameUserSettings.h |
|
void SetShadingQuality
(
int32 Value |
Sets the shading quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetShadowQuality
(
int32 Value |
Sets the shadow quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetTextureQuality
(
int32 Value |
Sets the texture quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
virtual void SetToDefaults() |
GameFramework/GameUserSettings.h |
|
|
void SetViewDistanceQuality
(
int32 Value |
Sets the view distance quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetVisualEffectQuality
(
int32 Value |
Sets the visual effects quality (0..4, higher is better) | GameFramework/GameUserSettings.h |
|
void SetVSyncEnabled
(
bool bEnable |
Sets the user setting for vsync. See UGameUserSettings::bUseVSync. | GameFramework/GameUserSettings.h |
|
virtual void SetWindowPosition
(
int32 WindowPosX, |
Sets the window position in save slot index 0. | GameFramework/GameUserSettings.h | |
virtual void SetWindowPosition
(
int32 WindowPosX, |
Sets the window position in the given index, which must be less than GetMaxNumWindowPositionSaveSlots(). | GameFramework/GameUserSettings.h | |
virtual bool SupportsHDRDisplayOutput() |
Whether the curently running system supports HDR display output | GameFramework/GameUserSettings.h |
|
virtual void ValidateSettings() |
Validates and resets bad user settings to default. Deletes stale user settings file if necessary. | GameFramework/GameUserSettings.h |
|
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void EnableHDRDisplayOutputInternal
(
bool bEnable, |
GameFramework/GameUserSettings.h | ||
float FindResolutionQualityForScreenSize
(
float Width, |
Picks the best resolution quality for a given screen size | GameFramework/GameUserSettings.h | |
virtual float GetEffectiveFrameRateLimit() |
Returns the effective frame rate limit (by default it returns the FrameRateLimit member) | GameFramework/GameUserSettings.h | |
virtual bool IsVersionValid () |
Check if the current version of the game user settings is valid. | GameFramework/GameUserSettings.h | |
void UpdateResolutionQuality() |
GameFramework/GameUserSettings.h | ||
virtual void UpdateVersion() |
Update the version of the game user settings to the current version | GameFramework/GameUserSettings.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FString GetConfigDir() |
GameFramework/GameUserSettings.h | ||
static FIntPoint GetDefaultResolution() |
Returns the default resolution when no resolution is set | GameFramework/GameUserSettings.h |
|
static EWindowMode::Type GetDefaultWindowMode() |
Returns the default window mode when no mode is set | GameFramework/GameUserSettings.h |
|
static FIntPoint GetDefaultWindowPosition() |
Returns the default window position when no position is set | GameFramework/GameUserSettings.h |
|
static int32 GetFramePace() |
Gets the current frame pacing frame rate in fps, or 0 if none | GameFramework/GameUserSettings.h |
|
static UGameUserSettings * GetGameUserSettings() |
Returns the game local machine settings (resolution, windowing mode, scalability settings, etc...) | GameFramework/GameUserSettings.h |
|
static int32 GetSyncInterval() |
Gets the current vsync interval setting | GameFramework/GameUserSettings.h |
|
static void LoadConfigIni
(
bool bForceReload |
Loads the user .ini settings into GConfig | GameFramework/GameUserSettings.h | |
static void PreloadResolutionSettings
(
bool bAllowCmdLineOverrides |
Loads the resolution settings before is object is available | GameFramework/GameUserSettings.h | |
static void RequestResolutionChange
(
int32 InResolutionX, |
Request a change to the specified resolution and window mode. Optionally apply cmd line overrides. | GameFramework/GameUserSettings.h | |
static void SetFrameRateLimitCVar
(
float InLimit |
Sets the frame rate limit CVar to the passed in value, 0.0 indicates no limit | GameFramework/GameUserSettings.h | |
static void SetSyncTypeCVar
(
int32 InInterval |
Sets the input latency mode 0 and 2 | GameFramework/GameUserSettings.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| WindowPosX_DEPRECATED | int32 | Window PosX | GameFramework/GameUserSettings.h |
|
| WindowPosY_DEPRECATED | int32 | Window PosY | GameFramework/GameUserSettings.h |
|