Class GameUserSettings
Stores user settings for a game (for example graphics and sound settings), with the ability to save and load to and from a file.
Inherited Members
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class GameUserSettings : UObject
Properties
| Improve this Doc View SourceAudioQualityLevel
Audio Quality Level
Declaration
public int AudioQualityLevel { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
bUseDesiredScreenHeight
Declaration
public bool bUseDesiredScreenHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bUseDynamicResolution
Declaration
public bool bUseDynamicResolution { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bUseHDRDisplayOutput
Declaration
public bool bUseHDRDisplayOutput { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bUseVSync
Declaration
public bool bUseVSync { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static GameUserSettings DefaultObject { get; }
Property Value
| Type | Description |
|---|---|
| GameUserSettings |
DesiredScreenHeight
Desired screen height used to calculate the resolution scale when user changes display mode
Declaration
public int DesiredScreenHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
DesiredScreenWidth
Desired screen width used to calculate the resolution scale when user changes display mode
Declaration
public int DesiredScreenWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
FrameRateLimit
Frame rate cap
Declaration
public float FrameRateLimit { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
FullscreenMode
Game window fullscreen mode 0 = Fullscreen 1 = Windowed fullscreen
Declaration
public int FullscreenMode { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Remarks
2 = Windowed
HDRDisplayOutputNits
HDR
Declaration
public int HDRDisplayOutputNits { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
LastConfirmedAudioQualityLevel
Last Confirmed Audio Quality Level
Declaration
public int LastConfirmedAudioQualityLevel { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
LastConfirmedFullscreenMode
Last user confirmed fullscreen mode setting.
Declaration
public int LastConfirmedFullscreenMode { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
LastCPUBenchmarkResult
Result of the last benchmark (CPU); -1 if there has not been a benchmark run
Declaration
public float LastCPUBenchmarkResult { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
LastGPUBenchmarkMultiplier
Multiplier used against the last GPU benchmark
Declaration
public float LastGPUBenchmarkMultiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
LastGPUBenchmarkResult
Result of the last benchmark (GPU); -1 if there has not been a benchmark run
Declaration
public float LastGPUBenchmarkResult { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
LastRecommendedScreenHeight
Result of the last benchmark; calculated resolution to use.
Declaration
public float LastRecommendedScreenHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
LastRecommendedScreenWidth
Result of the last benchmark; calculated resolution to use.
Declaration
public float LastRecommendedScreenWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
LastUserConfirmedDesiredScreenHeight
Desired screen height used to calculate the resolution scale when user changes display mode
Declaration
public int LastUserConfirmedDesiredScreenHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
LastUserConfirmedDesiredScreenWidth
Desired screen width used to calculate the resolution scale when user changes display mode
Declaration
public int LastUserConfirmedDesiredScreenWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
PreferredFullscreenMode
Fullscreen mode to use when toggling between windowed and fullscreen. Same values as r.FullScreenMode.
Declaration
public int PreferredFullscreenMode { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
| Type | Description |
|---|---|
| Class |
WindowPosX
Window PosX
Declaration
public int WindowPosX { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
WindowPosY
Window PosY
Declaration
public int WindowPosY { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceApplyHardwareBenchmarkResults()
Applies the settings stored in ScalabilityQuality and saves settings
Declaration
public void ApplyHardwareBenchmarkResults()
ApplyNonResolutionSettings()
Apply Non Resolution Settings
Declaration
public void ApplyNonResolutionSettings()
ApplyResolutionSettings(Boolean)
Apply Resolution Settings
Declaration
public void ApplyResolutionSettings(bool bCheckForCommandLineOverrides)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bCheckForCommandLineOverrides |
ApplySettings(Boolean)
Applies all current user settings to the game and saves to permanent storage (e.g. file), optionally checking for command line overrides.
Declaration
public void ApplySettings(bool bCheckForCommandLineOverrides)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bCheckForCommandLineOverrides |
ConfirmVideoMode()
Mark current video mode settings (fullscreenmode/resolution) as being confirmed by the user
Declaration
public void ConfirmVideoMode()
EnableHDRDisplayOutput(Boolean, Int32)
Enables or disables HDR display output. Can be called again to change the desired nit level
Declaration
public void EnableHDRDisplayOutput(bool bEnable, int DisplayNits)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bEnable | |
| System.Int32 | DisplayNits |
GetAntiAliasingQuality()
Returns the anti-aliasing quality (0..4, higher is better)
Declaration
public int GetAntiAliasingQuality()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetAudioQualityLevel()
Returns the user's audio quality level setting
Declaration
public int GetAudioQualityLevel()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetCurrentHDRDisplayNits()
Returns 0 if HDR isn't supported or is turned off
Declaration
public int GetCurrentHDRDisplayNits()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetDefaultResolution()
@return The default resolution when no resolution is set
Declaration
public static IntPoint GetDefaultResolution()
Returns
| Type | Description |
|---|---|
| IntPoint |
GetDefaultResolutionScale()
Gets the desired resolution quality based on DesiredScreenWidth/Height and the current screen resolution
Declaration
public float GetDefaultResolutionScale()
Returns
| Type | Description |
|---|---|
| System.Single |
GetDefaultWindowMode()
@return The default window mode when no mode is set
Declaration
public static byte GetDefaultWindowMode()
Returns
| Type | Description |
|---|---|
| System.Byte |
GetDefaultWindowPosition()
@return The default window position when no position is set
Declaration
public static IntPoint GetDefaultWindowPosition()
Returns
| Type | Description |
|---|---|
| IntPoint |
GetDesktopResolution()
Returns user's desktop resolution, in pixels.
Declaration
public IntPoint GetDesktopResolution()
Returns
| Type | Description |
|---|---|
| IntPoint |
GetFoliageQuality()
Returns the foliage quality (0..4, higher is better)
Declaration
public int GetFoliageQuality()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetFrameRateLimit()
Gets the user's frame rate limit (0 indiciates the frame rate limit is disabled)
Declaration
public float GetFrameRateLimit()
Returns
| Type | Description |
|---|---|
| System.Single |
GetFullscreenMode()
Returns the user setting for game window fullscreen mode.
Declaration
public byte GetFullscreenMode()
Returns
| Type | Description |
|---|---|
| System.Byte |
GetGameUserSettings()
Returns the game local machine settings (resolution, windowing mode, scalability settings, etc...)
Declaration
public static GameUserSettings GetGameUserSettings()
Returns
| Type | Description |
|---|---|
| GameUserSettings |
GetLastConfirmedFullscreenMode()
Returns the last confirmed user setting for game window fullscreen mode.
Declaration
public byte GetLastConfirmedFullscreenMode()
Returns
| Type | Description |
|---|---|
| System.Byte |
GetLastConfirmedScreenResolution()
Returns the last confirmed user setting for game screen resolution, in pixels.
Declaration
public IntPoint GetLastConfirmedScreenResolution()
Returns
| Type | Description |
|---|---|
| IntPoint |
GetOverallScalabilityLevel()
Returns the overall scalability level (can return -1 if the settings are custom)
Declaration
public int GetOverallScalabilityLevel()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetPostProcessingQuality()
Returns the post-processing quality (0..4, higher is better)
Declaration
public int GetPostProcessingQuality()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetPreferredFullscreenMode()
Returns the user setting for game window fullscreen mode.
Declaration
public byte GetPreferredFullscreenMode()
Returns
| Type | Description |
|---|---|
| System.Byte |
GetRecommendedResolutionScale()
Gets the recommended resolution quality based on LastRecommendedScreenWidth/Height and the current screen resolution
Declaration
public float GetRecommendedResolutionScale()
Returns
| Type | Description |
|---|---|
| System.Single |
GetResolutionScaleInformation()
Get Resolution Scale Information
Declaration
public (float, int, int, int) GetResolutionScaleInformation()
Returns
| Type | Description |
|---|---|
| System.ValueTuple<System.Single, System.Int32, System.Int32, System.Int32> |
GetResolutionScaleInformationEx()
Returns the current resolution scale and the range
Declaration
public (float, float, float, float) GetResolutionScaleInformationEx()
Returns
| Type | Description |
|---|---|
| System.ValueTuple<System.Single, System.Single, System.Single, System.Single> |
GetScreenResolution()
Returns the user setting for game screen resolution, in pixels.
Declaration
public IntPoint GetScreenResolution()
Returns
| Type | Description |
|---|---|
| IntPoint |
GetShadowQuality()
Returns the shadow quality (0..4, higher is better)
Declaration
public int GetShadowQuality()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetTextureQuality()
Returns the texture quality (0..4, higher is better)
Declaration
public int GetTextureQuality()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetViewDistanceQuality()
Returns the view distance quality (0..4, higher is better)
Declaration
public int GetViewDistanceQuality()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetVisualEffectQuality()
Returns the visual effects quality (0..4, higher is better)
Declaration
public int GetVisualEffectQuality()
Returns
| Type | Description |
|---|---|
| System.Int32 |
IsDirty()
Checks if any user settings is different from current
Declaration
public bool IsDirty()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsDynamicResolutionDirty()
Checks if the dynamic resolution user setting is different from current system setting
Declaration
public bool IsDynamicResolutionDirty()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsDynamicResolutionEnabled()
Returns the user setting for dynamic resolution.
Declaration
public bool IsDynamicResolutionEnabled()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsFullscreenModeDirty()
Checks if the FullscreenMode user setting is different from current
Declaration
public bool IsFullscreenModeDirty()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsHDREnabled()
Is HDREnabled
Declaration
public bool IsHDREnabled()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsScreenResolutionDirty()
Checks if the Screen Resolution user setting is different from current
Declaration
public bool IsScreenResolutionDirty()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsVSyncDirty()
Checks if the vsync user setting is different from current system setting
Declaration
public bool IsVSyncDirty()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsVSyncEnabled()
Returns the user setting for vsync.
Declaration
public bool IsVSyncEnabled()
Returns
| Type | Description |
|---|---|
| System.Boolean |
LoadSettings(Boolean)
Loads the user settings from persistent storage
Declaration
public void LoadSettings(bool bForceReload)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bForceReload |
New(UObject, Name)
Spawn an object of this class
Declaration
public static GameUserSettings New(UObject obj = null, Name name = default(Name))
Parameters
| Type | Name | Description |
|---|---|---|
| UObject | obj | |
| Name | name |
Returns
| Type | Description |
|---|---|
| GameUserSettings |
ResetToCurrentSettings()
This function resets all settings to the current system settings
Declaration
public void ResetToCurrentSettings()
RevertVideoMode()
Revert video mode (fullscreenmode/resolution) back to the last user confirmed values
Declaration
public void RevertVideoMode()
RunHardwareBenchmark(Int32, Single, Single)
Runs the hardware benchmark and populates ScalabilityQuality as well as the last benchmark results config members, but does not apply the settings it determines. Designed to be called in conjunction with ApplyHardwareBenchmarkResults
Declaration
public void RunHardwareBenchmark(int WorkScale, float CPUMultiplier, float GPUMultiplier)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | WorkScale | |
| System.Single | CPUMultiplier | |
| System.Single | GPUMultiplier |
SaveSettings()
Save the user settings to persistent storage (automatically happens as part of ApplySettings)
Declaration
public void SaveSettings()
SetAntiAliasingQuality(Int32)
Sets the anti-aliasing quality (0.
Declaration
public void SetAntiAliasingQuality(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
.4, higher is better) @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
SetAudioQualityLevel(Int32)
Sets the user's audio quality level setting
Declaration
public void SetAudioQualityLevel(int QualityLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | QualityLevel |
SetBenchmarkFallbackValues()
Set scalability settings to sensible fallback values, for use when the benchmark fails or potentially causes a crash
Declaration
public void SetBenchmarkFallbackValues()
SetDynamicResolutionEnabled(Boolean)
Sets the user setting for dynamic resolution. See UGameUserSettings::bUseDynamicResolution.
Declaration
public void SetDynamicResolutionEnabled(bool bEnable)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bEnable |
SetFoliageQuality(Int32)
Sets the foliage quality (0.
Declaration
public void SetFoliageQuality(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
.4, higher is better) @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
SetFrameRateLimit(Single)
Sets the user's frame rate limit (0 will disable frame rate limiting)
Declaration
public void SetFrameRateLimit(float NewLimit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | NewLimit |
SetFullscreenMode(Byte)
Sets the user setting for the game window fullscreen mode. See UGameUserSettings::FullscreenMode.
Declaration
public void SetFullscreenMode(byte InFullscreenMode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | InFullscreenMode |
SetOverallScalabilityLevel(Int32)
Changes all scalability settings at once based on a single overall quality level @
Declaration
public void SetOverallScalabilityLevel(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic
SetPostProcessingQuality(Int32)
Sets the post-processing quality (0.
Declaration
public void SetPostProcessingQuality(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
.4, higher is better) @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
SetResolutionScaleNormalized(Single)
Sets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue
Declaration
public void SetResolutionScaleNormalized(float NewScaleNormalized)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | NewScaleNormalized |
SetResolutionScaleValue(Int32)
Set Resolution Scale Value
Declaration
public void SetResolutionScaleValue(int NewScaleValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | NewScaleValue |
SetResolutionScaleValueEx(Single)
Sets the current resolution scale
Declaration
public void SetResolutionScaleValueEx(float NewScaleValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | NewScaleValue |
SetScreenResolution(IntPoint)
Sets the user setting for game screen resolution, in pixels.
Declaration
public void SetScreenResolution(IntPoint Resolution)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPoint | Resolution |
SetShadowQuality(Int32)
Sets the shadow quality (0.
Declaration
public void SetShadowQuality(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
.4, higher is better) @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
SetTextureQuality(Int32)
Sets the texture quality (0.
Declaration
public void SetTextureQuality(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
.4, higher is better) @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
SetToDefaults()
Set to Defaults
Declaration
public void SetToDefaults()
SetViewDistanceQuality(Int32)
Sets the view distance quality (0.
Declaration
public void SetViewDistanceQuality(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
.4, higher is better) @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
SetVisualEffectQuality(Int32)
Sets the visual effects quality (0.
Declaration
public void SetVisualEffectQuality(int Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Value |
Remarks
.4, higher is better) @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
SetVSyncEnabled(Boolean)
Sets the user setting for vsync. See UGameUserSettings::bUseVSync.
Declaration
public void SetVSyncEnabled(bool bEnable)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bEnable |
SupportsHDRDisplayOutput()
Whether the curently running system supports HDR display output
Declaration
public bool SupportsHDRDisplayOutput()
Returns
| Type | Description |
|---|---|
| System.Boolean |
ValidateSettings()
Validates and resets bad user settings to default. Deletes stale user settings file if necessary.
Declaration
public void ValidateSettings()
Operators
| Improve this Doc View SourceImplicit(IntPtr to GameUserSettings)
Convert from IntPtr to UObject
Declaration
public static implicit operator GameUserSettings(IntPtr p)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | p |
Returns
| Type | Description |
|---|---|
| GameUserSettings |