UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GameUserSettings.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "UObject/Object.h"
10#include "Scalability.h"
11#include "GameUserSettings.generated.h"
12
13#if !CPP //noexport class
14
16UENUM(BlueprintType)
17namespace EWindowMode
18{
19 enum Type : int
20 {
27 };
28}
29
30#endif
31
33
37UCLASS(config=GameUserSettings, configdonotcheckdefaults, MinimalAPI)
39{
41
42public:
43
45 static ENGINE_API FString GetConfigDir();
46
48 UFUNCTION(BlueprintCallable, Category=Settings, meta=(bCheckForCommandLineOverrides=true))
49 ENGINE_API virtual void ApplySettings(bool bCheckForCommandLineOverrides);
50
51 UFUNCTION(BlueprintCallable, Category=Settings)
52 ENGINE_API virtual void ApplyNonResolutionSettings();
53
54 UFUNCTION(BlueprintCallable, Category=Settings)
55 ENGINE_API void ApplyResolutionSettings(bool bCheckForCommandLineOverrides);
56
58 UFUNCTION(BlueprintPure, Category=Settings)
59 ENGINE_API FIntPoint GetScreenResolution() const;
60
62 UFUNCTION(BlueprintPure, Category=Settings)
63 ENGINE_API FIntPoint GetLastConfirmedScreenResolution() const;
64
66 UFUNCTION(BlueprintPure, Category = Settings)
67 ENGINE_API FIntPoint GetDesktopResolution() const;
68
70 UFUNCTION(BlueprintCallable, Category=Settings)
71 ENGINE_API void SetScreenResolution(FIntPoint Resolution);
72
74 UFUNCTION(BlueprintPure, Category=Settings)
75 ENGINE_API EWindowMode::Type GetFullscreenMode() const;
76
78 UFUNCTION(BlueprintPure, Category=Settings)
79 ENGINE_API EWindowMode::Type GetLastConfirmedFullscreenMode() const;
80
82 UFUNCTION(BlueprintCallable, Category=Settings)
83 ENGINE_API void SetFullscreenMode(EWindowMode::Type InFullscreenMode);
84
86 UFUNCTION(BlueprintPure, Category = Settings)
87 ENGINE_API EWindowMode::Type GetPreferredFullscreenMode() const;
88
90 UFUNCTION(BlueprintCallable, Category=Settings)
91 ENGINE_API void SetVSyncEnabled(bool bEnable);
92
94 UFUNCTION(BlueprintPure, Category=Settings)
95 ENGINE_API bool IsVSyncEnabled() const;
96
98 UFUNCTION(BlueprintCallable, Category = Settings)
99 ENGINE_API void SetDynamicResolutionEnabled(bool bEnable);
100
102 UFUNCTION(BlueprintPure, Category = Settings)
103 ENGINE_API virtual bool IsDynamicResolutionEnabled() const;
104
106 UFUNCTION(BlueprintPure, Category=Settings)
107 ENGINE_API bool IsScreenResolutionDirty() const;
108
110 UFUNCTION(BlueprintPure, Category=Settings)
111 ENGINE_API bool IsFullscreenModeDirty() const;
112
114 UFUNCTION(BlueprintPure, Category=Settings)
115 ENGINE_API bool IsVSyncDirty() const;
116
118 UFUNCTION(BlueprintPure, Category = Settings)
119 ENGINE_API bool IsDynamicResolutionDirty() const;
120
122 UFUNCTION(BlueprintCallable, Category=Settings)
123 ENGINE_API virtual void ConfirmVideoMode();
124
126 UFUNCTION(BlueprintCallable, Category=Settings)
127 ENGINE_API void RevertVideoMode();
128
130 UFUNCTION(BlueprintCallable, Category=Settings)
131 ENGINE_API void SetBenchmarkFallbackValues();
132
134 UFUNCTION(BlueprintCallable, Category=Settings)
135 ENGINE_API void SetAudioQualityLevel(int32 QualityLevel);
136
138 UFUNCTION(BlueprintPure, Category=Settings)
139 int32 GetAudioQualityLevel() const { return AudioQualityLevel; }
140
142 UFUNCTION(BlueprintCallable, Category=Settings)
143 ENGINE_API void SetFrameRateLimit(float NewLimit);
144
146 UFUNCTION(BlueprintPure, Category=Settings)
147 ENGINE_API float GetFrameRateLimit() const;
148
149 // Changes all scalability settings at once based on a single overall quality level
150 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic
151 UFUNCTION(BlueprintCallable, Category=Settings)
152 ENGINE_API virtual void SetOverallScalabilityLevel(int32 Value);
153
154 // Returns the overall scalability level (can return -1 if the settings are custom)
155 UFUNCTION(BlueprintCallable, Category=Settings)
156 ENGINE_API virtual int32 GetOverallScalabilityLevel() const;
157
158 // Returns the current resolution scale and the range
159 UFUNCTION(BlueprintCallable, Category=Settings, meta=(DisplayName="GetResolutionScaleInformation"))
160 ENGINE_API void GetResolutionScaleInformationEx(float& CurrentScaleNormalized, float& CurrentScaleValue, float& MinScaleValue, float& MaxScaleValue) const;
161
162 // Gets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue
163 UFUNCTION(BlueprintCallable, Category = Settings)
164 ENGINE_API float GetResolutionScaleNormalized() const;
165
166 // Sets the current resolution scale
167 UFUNCTION(BlueprintCallable, Category=Settings, meta=(DisplayName="SetResolutionScaleValue"))
168 ENGINE_API void SetResolutionScaleValueEx(float NewScaleValue);
169
170 // Sets the current resolution scale as a normalized 0..1 value between MinScaleValue and MaxScaleValue
171 UFUNCTION(BlueprintCallable, Category=Settings)
172 ENGINE_API void SetResolutionScaleNormalized(float NewScaleNormalized);
173
174 // Sets the view distance quality (0..4, higher is better)
175 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
176 UFUNCTION(BlueprintCallable, Category=Settings)
177 ENGINE_API void SetViewDistanceQuality(int32 Value);
178
179 // Returns the view distance quality (0..4, higher is better)
180 UFUNCTION(BlueprintCallable, Category=Settings)
181 ENGINE_API int32 GetViewDistanceQuality() const;
182
183 // Sets the shadow quality (0..4, higher is better)
184 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
185 UFUNCTION(BlueprintCallable, Category=Settings)
186 ENGINE_API void SetShadowQuality(int32 Value);
187
188 // Returns the shadow quality (0..4, higher is better)
189 UFUNCTION(BlueprintCallable, Category=Settings)
191
192 // Sets the global illumination quality (0..4, higher is better)
193 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
194 UFUNCTION(BlueprintCallable, Category=Settings)
195 ENGINE_API void SetGlobalIlluminationQuality(int32 Value);
196
197 // Returns the global illumination quality (0..4, higher is better)
198 UFUNCTION(BlueprintCallable, Category=Settings)
199 ENGINE_API int32 GetGlobalIlluminationQuality() const;
200
201 // Sets the reflection quality (0..4, higher is better)
202 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
203 UFUNCTION(BlueprintCallable, Category=Settings)
204 ENGINE_API void SetReflectionQuality(int32 Value);
205
206 // Returns the reflection quality (0..4, higher is better)
207 UFUNCTION(BlueprintCallable, Category=Settings)
208 ENGINE_API int32 GetReflectionQuality() const;
209
210 // Sets the anti-aliasing quality (0..4, higher is better)
211 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
212 UFUNCTION(BlueprintCallable, Category=Settings)
213 ENGINE_API void SetAntiAliasingQuality(int32 Value);
214
215 // Returns the anti-aliasing quality (0..4, higher is better)
216 UFUNCTION(BlueprintCallable, Category=Settings)
217 ENGINE_API int32 GetAntiAliasingQuality() const;
218
219 // Sets the texture quality (0..4, higher is better)
220 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
221 UFUNCTION(BlueprintCallable, Category=Settings)
222 ENGINE_API void SetTextureQuality(int32 Value);
223
224 // Returns the texture quality (0..4, higher is better)
225 UFUNCTION(BlueprintCallable, Category=Settings)
226 ENGINE_API int32 GetTextureQuality() const;
227
228 // Sets the visual effects quality (0..4, higher is better)
229 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
230 UFUNCTION(BlueprintCallable, Category=Settings)
231 ENGINE_API void SetVisualEffectQuality(int32 Value);
232
233 // Returns the visual effects quality (0..4, higher is better)
234 UFUNCTION(BlueprintCallable, Category=Settings)
235 ENGINE_API int32 GetVisualEffectQuality() const;
236
237 // Sets the post-processing quality (0..4, higher is better)
238 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
239 UFUNCTION(BlueprintCallable, Category=Settings)
240 ENGINE_API void SetPostProcessingQuality(int32 Value);
241
242 // Returns the post-processing quality (0..4, higher is better)
243 UFUNCTION(BlueprintCallable, Category=Settings)
244 ENGINE_API int32 GetPostProcessingQuality() const;
245
246 // Sets the foliage quality (0..4, higher is better)
247 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
248 UFUNCTION(BlueprintCallable, Category=Settings)
249 ENGINE_API void SetFoliageQuality(int32 Value);
250
251 // Returns the foliage quality (0..4, higher is better)
252 UFUNCTION(BlueprintCallable, Category=Settings)
253 ENGINE_API int32 GetFoliageQuality() const;
254
255 // Sets the shading quality (0..4, higher is better)
256 // @param Value 0:low, 1:medium, 2:high, 3:epic, 4:cinematic (gets clamped if needed)
257 UFUNCTION(BlueprintCallable, Category = Settings)
258 ENGINE_API void SetShadingQuality(int32 Value);
259
260 // Returns the shading quality (0..4, higher is better)
261 UFUNCTION(BlueprintCallable, Category = Settings)
262 ENGINE_API int32 GetShadingQuality() const;
263
265 UFUNCTION(BlueprintPure, Category=Settings)
266 ENGINE_API virtual bool IsDirty() const;
267
269 UFUNCTION(BlueprintCallable, Category=Settings)
270 ENGINE_API virtual void ValidateSettings();
271
273 UFUNCTION(BlueprintCallable, Category=Settings)
274 ENGINE_API virtual void LoadSettings(bool bForceReload = false);
275
277 UFUNCTION(BlueprintCallable, Category=Settings)
278 ENGINE_API virtual void SaveSettings();
279
281 UFUNCTION(BlueprintCallable, Category=Settings)
282 ENGINE_API virtual void ResetToCurrentSettings();
283
285 ENGINE_API virtual void SetWindowPosition(int32 WindowPosX, int32 WindowPosY);
286
289
291 ENGINE_API virtual FIntPoint GetWindowPosition();
292
295
297 ENGINE_API void ReloadWindowPositions();
298
299 UFUNCTION(BlueprintCallable, Category=Settings)
300 ENGINE_API virtual void SetToDefaults();
301
303 UFUNCTION(BlueprintCallable, Category=Settings)
304 ENGINE_API virtual float GetDefaultResolutionScale();
305
307 UFUNCTION(BlueprintCallable, Category = Settings)
308 ENGINE_API virtual float GetRecommendedResolutionScale();
309
311 static ENGINE_API void PreloadResolutionSettings(bool bAllowCmdLineOverrides = true);
312
314 UFUNCTION(BlueprintCallable, Category=Settings)
315 static ENGINE_API FIntPoint GetDefaultResolution();
316
318 UFUNCTION(BlueprintCallable, Category=Settings)
319 static ENGINE_API FIntPoint GetDefaultWindowPosition();
320
322 UFUNCTION(BlueprintCallable, Category=Settings)
323 static ENGINE_API EWindowMode::Type GetDefaultWindowMode();
324
326 UE_DEPRECATED(4.25, "Please use GetFramePace to get the paced frame rate")
327 UFUNCTION(BlueprintPure, Category = Settings)
328 static ENGINE_API int32 GetSyncInterval();
329
331 UFUNCTION(BlueprintPure, Category = Settings)
332 static ENGINE_API int32 GetFramePace();
333
335 static ENGINE_API void LoadConfigIni(bool bForceReload = false);
336
339
341 UFUNCTION(BlueprintCallable, Category=Settings)
342 static ENGINE_API UGameUserSettings* GetGameUserSettings();
343
345 UFUNCTION(BlueprintCallable, Category=Settings)
346 ENGINE_API virtual void RunHardwareBenchmark(int32 WorkScale = 10, float CPUMultiplier = 1.0f, float GPUMultiplier = 1.0f);
347
349 UFUNCTION(BlueprintCallable, Category=Settings)
350 ENGINE_API virtual void ApplyHardwareBenchmarkResults();
351
353 UFUNCTION(BlueprintCallable, Category=Settings, meta = (DisplayName = "Supports HDR Display Output"))
354 ENGINE_API virtual bool SupportsHDRDisplayOutput() const;
355
357 UFUNCTION(BlueprintCallable, Category=Settings, meta=(DisplayName = "Enable HDR Display Output"))
358 ENGINE_API void EnableHDRDisplayOutput(bool bEnable, int32 DisplayNits = 1000);
359
361 UFUNCTION(BlueprintCallable, Category = Settings, meta = (DisplayName = "Get Current HDR Display Nits"))
362 ENGINE_API int32 GetCurrentHDRDisplayNits() const;
363
364 UFUNCTION(BlueprintCallable, Category = Settings, meta = (DisplayName = "Is HDR Enabled"))
365 ENGINE_API bool IsHDREnabled() const;
366
368 UPROPERTY(config)
369 bool bUseVSync;
370
372 UPROPERTY(config)
373 bool bUseDynamicResolution;
374
375 // cached for the UI, current state if stored in console variables
376 Scalability::FQualityLevels ScalabilityQuality;
377
380 UPROPERTY(config)
381 uint32 ResolutionSizeX;
382
384 UPROPERTY(config)
385 uint32 ResolutionSizeY;
386
388 UPROPERTY(config)
389 uint32 LastUserConfirmedResolutionSizeX;
390
392 UPROPERTY(config)
393 uint32 LastUserConfirmedResolutionSizeY;
394
396 UE_DEPRECATED(5.6, "Use the WindowPositions array instead.")
397 UPROPERTY(config)
398 int32 WindowPosX_DEPRECATED;
399
401 UE_DEPRECATED(5.6, "Use the WindowPositions array instead.")
402 UPROPERTY(config)
403 int32 WindowPosY_DEPRECATED;
404
406 UPROPERTY(config)
407 TArray<FIntPoint> WindowPositions;
408
415 UPROPERTY(config)
416 int32 FullscreenMode;
417
419 UPROPERTY(config)
420 int32 LastConfirmedFullscreenMode;
421
423 UPROPERTY(config)
424 int32 PreferredFullscreenMode;
425
427 UPROPERTY(config)
428 uint32 Version;
429
430 UPROPERTY(config)
431 int32 AudioQualityLevel;
432
433 UPROPERTY(config)
434 int32 LastConfirmedAudioQualityLevel;
435
437 UPROPERTY(config)
438 float FrameRateLimit;
439
441 UE_DEPRECATED(5.3, "MinResolutionScale is now always Scalability::MinResolutionScale=0 that fallbacks to default project wide behavior defined by r.ScreenPercentage.Default")
442 float MinResolutionScale;
443
445 UPROPERTY(config)
446 int32 DesiredScreenWidth;
447
450 bool bUseDesiredScreenHeight;
451
453 UPROPERTY(config)
454 int32 DesiredScreenHeight;
455
457 UPROPERTY(config)
458 int32 LastUserConfirmedDesiredScreenWidth;
459
461 UPROPERTY(config)
462 int32 LastUserConfirmedDesiredScreenHeight;
463
465 UPROPERTY(config)
466 float LastRecommendedScreenWidth;
467
469 UPROPERTY(config)
470 float LastRecommendedScreenHeight;
471
473 UPROPERTY(config)
474 float LastCPUBenchmarkResult;
475
477 UPROPERTY(config)
478 float LastGPUBenchmarkResult;
479
481 UPROPERTY(config)
482 TArray<float> LastCPUBenchmarkSteps;
483
485 UPROPERTY(config)
486 TArray<float> LastGPUBenchmarkSteps;
487
491 UPROPERTY(config)
492 float LastGPUBenchmarkMultiplier;
493
495 UPROPERTY(config)
496 bool bUseHDRDisplayOutput;
497
499 UPROPERTY(config)
500 int32 HDRDisplayOutputNits;
501
505 bool bEnableScalabilitySettings = true;
506
507public:
509 float GetLastCPUBenchmarkResult() const
510 {
511 return LastCPUBenchmarkResult;
512 }
513
516 {
517 return LastGPUBenchmarkResult;
518 }
519
522 {
523 return LastCPUBenchmarkSteps;
524 }
525
528 {
529 return LastGPUBenchmarkSteps;
530 }
531
533 {
534 OnGameUserSettingsUINeedsUpdate.Broadcast();
535 }
536
538 int32 GetMaxNumWindowPositionSaveSlots() const;
539
545
551
552protected:
557 ENGINE_API virtual bool IsVersionValid();
558
560 ENGINE_API virtual void UpdateVersion();
561
563 ENGINE_API float FindResolutionQualityForScreenSize(float Width, float Height);
564
566 static ENGINE_API void SetFrameRateLimitCVar(float InLimit);
567
569 static ENGINE_API void SetSyncTypeCVar(int32 InInterval);
570
572 ENGINE_API virtual float GetEffectiveFrameRateLimit();
573
574 ENGINE_API void UpdateResolutionQuality();
575
576 ENGINE_API void EnableHDRDisplayOutputInternal(bool bEnable, int32 DisplayNits, bool bFromUserSettings);
577
578private:
579
580 UPROPERTY(BlueprintAssignable, meta = (AllowPrivateAccess = "true"))
581 FOnGameUserSettingsUINeedsUpdate OnGameUserSettingsUINeedsUpdate;
582
583 ENGINE_API void SetPreferredFullscreenMode(int32 Mode);
584};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DYNAMIC_MULTICAST_DELEGATE(DelegateName)
Definition DelegateCombinations.h:38
DIRECTLINK_API Display
Definition DirectLinkLog.h:8
return true
Definition ExternalRpcRegistry.cpp:601
uint32 GetShadowQuality()
Definition ShadowRendering.cpp:256
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
RENDERCORE_API bool IsHDREnabled()
Definition RenderCore.cpp:444
decltype(auto) get(TupleType &&val)
Definition Tuple.h:940
bool IsVersionValid(const VersionInfo &Version, const VersionInfo &MinVersion)
Definition WindowsRedistributableValidation.h:37
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition UnrealType.h:3087
Definition Array.h:670
Definition GameUserSettings.h:39
void RequestUIUpdate()
Definition GameUserSettings.h:532
TArray< float > GetLastCPUBenchmarkSteps() const
Definition GameUserSettings.h:521
float GetLastGPUBenchmarkResult() const
Definition GameUserSettings.h:515
DECLARE_DELEGATE_RetVal_OneParam(bool, FUpdateCloudDataFromGameUserSettings, const FString &)
TArray< float > GetLastGPUBenchmarkSteps() const
Definition GameUserSettings.h:527
DECLARE_DELEGATE_RetVal_OneParam(bool, FUpdateGameUserSettingsFileFromCloud, const FString &)
FUpdateGameUserSettingsFileFromCloud OnUpdateGameUserSettingsFileFromCloud
Definition GameUserSettings.h:544
FUpdateCloudDataFromGameUserSettings OnUpdateCloudDataFromGameUserSettings
Definition GameUserSettings.h:550
static ENGINE_API FString GetConfigDir()
Definition Object.h:95
Definition GenericWindow.h:15
Type
Definition GenericWindow.h:17
@ Windowed
Definition GenericWindow.h:23
@ Fullscreen
Definition GenericWindow.h:19
@ WindowedFullscreen
Definition GenericWindow.h:21
Definition Scalability.cpp:198
@ false
Definition radaudio_common.h:23
Definition IntPoint.h:25