UGameUserSettings

Inheritance Hierarchy

Syntax

class UGameUserSettings : public UObject

Remarks

Stores user settings for a game (for example graphics and sound settings), with the ability to save and load to and from a file.

Variables

Name Description

Protected variable

int32

 

AudioQualityLevel

Protected variable

bool

 

bUseDesiredScreenHeight

If true, the desired screen height will be used to scale the render resolution automatically.

Protected variable

bool

 

bUseHDRDisplayOutput

HDR

Public variable

bool

 

bUseVSync

Whether to use VSync or not. (public to allow UI to connect to it)

Protected variable

int32

 

DesiredScreenHeight

Desired screen height used to calculate the resolution scale when user changes display mode

Protected variable

int32

 

DesiredScreenWidth

Desired screen width used to calculate the resolution scale when user changes display mode

Protected variable

float

 

FrameRateLimit

Frame rate cap

Protected variable

int32

 

FullscreenMode

Game window fullscreen mode 0 = Fullscreen 1 = Windowed fullscreen 2 = Windowed

Protected variable

int32

 

HDRDisplayOutputNits

HDR

Protected variable

int32

 

LastConfirmedFullscreenMode

Last user confirmed fullscreen mode setting.

Protected variable

float

 

LastCPUBenchmarkResult

Result of the last benchmark (CPU); -1 if there has not been a benchmark run

Protected variable

TArray < float >

 

LastCPUBenchmarkSteps

Result of each individual sub-section of the last CPU benchmark; empty if there has not been a benchmark run

Protected variable

float

 

LastGPUBenchmarkMultiplier

Multiplier used against the last GPU benchmark

Protected variable

float

 

LastGPUBenchmarkResult

Result of the last benchmark (GPU); -1 if there has not been a benchmark run

Protected variable

TArray < float >

 

LastGPUBenchmarkSteps

Result of each individual sub-section of the last GPU benchmark; empty if there has not been a benchmark run

Protected variable

float

 

LastRecommendedScreenHeight

Result of the last benchmark; calculated resolution to use.

Protected variable

float

 

LastRecommendedScreenWidth

Result of the last benchmark; calculated resolution to use.

Protected variable

uint32

 

LastUserConfirmedResolutionSizeX

Game screen resolution width, in pixels.

Protected variable

uint32

 

LastUserConfirmedResolutionSizeY

Game screen resolution height, in pixels.

Protected variable

float

 

MinResolutionScale

Min resolution scale we allow in current display mode

Protected variable

int32

 

PreferredFullscreenMode

Fullscreen mode to use when toggling between windowed and fullscreen.

Protected variable

uint32

 

ResolutionSizeX

Game screen resolution width, in pixels.

Protected variable

uint32

 

ResolutionSizeY

Game screen resolution height, in pixels.

Public variable

Scalability::FQ ...

 

ScalabilityQuality

Cached for the UI, current state if stored in console variables

Protected variable

uint32

 

Version

All settings will be wiped and set to default if the serialized version differs from UE_GAMEUSERSETTINGS_VERSION.

Protected variable

int32

 

WindowPosX

Window PosX

Protected variable

int32

 

WindowPosY

Window PosY

Constructors

Name Description

Public function

UGameUserSettings

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function Virtual

void

 

ApplyHardwareBenchmarkResults()

Applies the settings stored in ScalabilityQuality and saves settings

Public function Virtual

void

 

ApplyNonResolutionSettings()

Public function

void

 

ApplyResolutionSettings

(
    bool bCheckForCommandLineOverrides
)

Public function 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.

Public function

void

 

ConfirmVideoMode()

Mark current video mode settings (fullscreenmode/resolution) as being confirmed by the user

Public function

void

 

EnableHDRDisplayOutput

(
    bool bEnable,
    int32 DisplayNits
)

Enables or disables HDR display output. Can be called again to change the desired nit level

Protected function

float

 

FindResolutionQualityForScreenSize

(
    float Width,
    float Height
)

Picks the best resolution quality for a given screen size

Public function

int32

 

GetAntiAliasingQuality()

Returns the anti-aliasing quality (0..3, higher is better)

Public function

int32

 

GetAudioQualityLevel()

Returns the user's audio quality level setting

Public function

int32

 

GetCurrentHDRDisplayNits()

Returns 0 if HDR isn't supported or is turned off

Public function Static

FIntPoint

 

GetDefaultResolution()

The default resolution when no resolution is set

Public function Virtual

float

 

GetDefaultResolutionScale()

Gets the desired resolution quality based on DesiredScreenWidth/Height and the current screen resolution

Public function Static

EWindowMode: ...

 

GetDefaultWindowMode()

The default window mode when no mode is set

Public function Static

FIntPoint

 

GetDefaultWindowPosition()

The default window position when no position is set

Public function

FIntPoint

 

GetDesktopResolution()

Returns user's desktop resolution, in pixels.

Protected function Virtual

float

 

GetEffectiveFrameRateLimit()

Returns the effective frame rate limit (by default it returns the FrameRateLimit member)

Public function

int32

 

GetFoliageQuality()

Returns the post-processing quality (0..3, higher is better)

Public function

float

 

GetFrameRateLimit()

Gets the user's frame rate limit (0 indiciates the frame rate limit is disabled)

Public function

EWindowMode: ...

 

GetFullscreenMode()

Returns the user setting for game window fullscreen mode.

Public function Static

UGameUserSet ...

 

GetGameUserSettings()

Returns the game local machine settings (resolution, windowing mode, scalability settings, etc...)

Public function

EWindowMode: ...

 

GetLastConfirmedFullscreenMode()

Returns the last confirmed user setting for game window fullscreen mode.

Public function

FIntPoint

 

GetLastConfirmedScreenResolution()

Returns the last confirmed user setting for game screen resolution, in pixels.

Public function

float

 

GetLastCPUBenchmarkResult()

Returns the last CPU benchmark result (set by RunHardwareBenchmark)

Public function

TArray < floa...

 

GetLastCPUBenchmarkSteps()

Returns each individual step of the last CPU benchmark result (set by RunHardwareBenchmark)

Public function

float

 

GetLastGPUBenchmarkResult()

Returns the last GPU benchmark result (set by RunHardwareBenchmark)

Public function

TArray < floa...

 

GetLastGPUBenchmarkSteps()

Returns each individual step of the last GPU benchmark result (set by RunHardwareBenchmark)

Public function

int32

 

GetOverallScalabilityLevel()

Returns the overall scalability level (can return -1 if the settings are custom)

Public function

int32

 

GetPostProcessingQuality()

Returns the post-processing quality (0..3, higher is better)

Public function

EWindowMode: ...

 

GetPreferredFullscreenMode()

Returns the user setting for game window fullscreen mode.

Public function Virtual

float

 

GetRecommendedResolutionScale()

Gets the recommended resolution quality based on LastRecommendedScreenWidth/Height and the current screen resolution

Public function

void

 

GetResolutionScaleInformation

(
    float& CurrentScaleNormalized,
    int32 & CurrentScaleValue,
    int32 & MinScaleValue,
    int32 & MaxScaleValue
)

Returns the current resolution scale and the range.

Public function

void

 

GetResolutionScaleInformationEx

(
    float& CurrentScaleNormalized,
    float& CurrentScaleValue,
    float& MinScaleValue,
    float& MaxScaleValue
)

Returns the current resolution scale and the range.

Public function

FIntPoint

 

GetScreenResolution()

Returns the user setting for game screen resolution, in pixels.

Public function

int32

 

GetShadowQuality()

Returns the shadow quality (0..3, higher is better)

Public function

int32

 

GetTextureQuality()

Returns the texture quality (0..3, higher is better)

Public function

int32

 

GetViewDistanceQuality()

Returns the view distance quality (0..3, higher is better)

Public function

int32

 

GetVisualEffectQuality()

Returns the visual effects quality (0..3, higher is better)

Public function Virtual

FIntPoint

 

GetWindowPosition()

Public function Virtual

bool

 

IsDirty()

Checks if any user settings is different from current

Public function

bool

 

IsFullscreenModeDirty()

Checks if the FullscreenMode user setting is different from current

Public function

bool

 

IsHDREnabled()

Public function

bool

 

IsScreenResolutionDirty()

Checks if the Screen Resolution user setting is different from current

Protected function Virtual

bool

 

IsVersionValid()

Check if the current version of the game user settings is valid.

Public function

bool

 

IsVSyncDirty()

Checks if the vsync user setting is different from current system setting

Public function

bool

 

IsVSyncEnabled()

Returns the user setting for vsync.

Public function Static

void

 

LoadConfigIni

(
    bool bForceReload
)

Loads the user .ini settings into GConfig

Public function Virtual

void

 

LoadSettings

(
    bool bForceReload
)

Loads the user settings from persistent storage

Public function Static

void

 

PreloadResolutionSettings()

Loads the resolution settings before is object is available

Public function Static

void

 

RequestResolutionChange

(
    int32 InResolutionX,
    int32 InResolutionY,
    EWindowMode::Type InWindowMode,
    bool bInDoOverrides
)

Request a change to the specified resolution and window mode. Optionally apply cmd line overrides.

Public function Virtual

void

 

ResetToCurrentSettings()

This function resets all settings to the current system settings

Public function

void

 

RevertVideoMode()

Revert video mode (fullscreenmode/resolution) back to the last user confirmed values

Public function Virtual

void

 

RunHardwareBenchmark

(
    int32 WorkScale,
    float CPUMultiplier,
    float GPUMultiplier
)

Runs the hardware benchmark and populates ScalabilityQuality as well as the last benchmark results config members, but does not apply the settings it determines.

Public function Virtual

void

 

SaveSettings()

Save the user settings to persistent storage (automatically happens as part of ApplySettings)

Public function

void

 

SetAntiAliasingQuality

(
    int32 Value
)

Sets the anti-aliasing quality (0..3, higher is better)

Public function

void

 

SetAudioQualityLevel

(
    int32 QualityLevel
)

Sets the user's audio quality level setting

Public function

void

 

SetBenchmarkFallbackValues()

Set scalability settings to sensible fallback values, for use when the benchmark fails or potentially causes a crash

Public function

void

 

SetFoliageQuality

(
    int32 Value
)

Sets the post-processing quality (0..3, higher is better)

Public function

void

 

SetFrameRateLimit

(
    float NewLimit
)

Sets the user's frame rate limit (0 will disable frame rate limiting)

Protected function Static

void

 

SetFrameRateLimitCVar

(
    float InLimit
)

Sets the frame rate limit CVar to the passed in value, 0.0 indicates no limit

Public function

void

 

SetFullscreenMode

(
    EWindowMode::Type InFullscreenMode
)

Sets the user setting for the game window fullscreen mode.

Public function Virtual

void

 

SetOverallScalabilityLevel

(
    int32 Value
)

Changes all scalability settings at once based on a single overall quality level

Public function

void

 

SetPostProcessingQuality

(
    int32 Value
)

Sets the post-processing quality (0..3, higher is better)

Public function

void

 

SetResolutionScaleNormalized

(
    float NewScaleNormalized
)

Sets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue.

Public function

void

 

SetResolutionScaleValue

(
    int32 NewScaleValue
)

Sets the current resolution scale.

Public function

void

 

SetResolutionScaleValueEx

(
    float NewScaleValue
)

Sets the current resolution scale.

Public function

void

 

SetScreenResolution

(
    FIntPoint Resolution
)

Sets the user setting for game screen resolution, in pixels.

Public function

void

 

SetShadowQuality

(
    int32 Value
)

Sets the shadow quality (0..3, higher is better)

Public function

void

 

SetTextureQuality

(
    int32 Value
)

Sets the texture quality (0..3, higher is better)

Public function Virtual

void

 

SetToDefaults()

Public function

void

 

SetViewDistanceQuality

(
    int32 Value
)

Sets the view distance quality (0..3, higher is better)

Public function

void

 

SetVisualEffectQuality

(
    int32 Value
)

Sets the visual effects quality (0..3, higher is better)

Public function

void

 

SetVSyncEnabled

(
    bool bEnable
)

Sets the user setting for vsync.

Public function Virtual

void

 

SetWindowPosition

(
    int32 WindowPosX,
    int32 WindowPosY
)

Public function Virtual

bool

 

SupportsHDRDisplayOutput()

Whether the curently running system supports HDR display output

Protected function

void

 

UpdateResolutionQuality()

Protected function Virtual

void

 

UpdateVersion()

Update the version of the game user settings to the current version

Public function Virtual

void

 

ValidateSettings()

Validates and resets bad user settings to default. Deletes stale user settings file if necessary.

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/GameUserSettings.h