UserSettingsClass

UserSettingsClass

#Overview

name: UserSettingsClass

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of UserSettingsClass is to define the class used for storing and managing user-specific input settings in the Enhanced Input system of Unreal Engine 5. This variable is part of the Enhanced Input plugin, which provides an advanced input handling system for game development.

The Enhanced Input subsystem relies on this setting variable. Specifically, it is used within the EnhancedInput module to determine which class should be instantiated for managing user input settings.

The value of this variable is set in the UEnhancedInputDeveloperSettings constructor, where it is initialized with UEnhancedInputUserSettings::StaticClass(). Developers can modify this value through the Enhanced Input Project Settings in the Unreal Engine editor.

This variable interacts with other components of the Enhanced Input system, particularly the UEnhancedInputUserSettings class and related functionality. It is used when loading or creating user settings for a local player.

Developers must be aware that:

  1. This variable determines the class used for user input settings, so changing it affects how input configurations are stored and managed.
  2. It is part of the experimental user settings feature in the Enhanced Input system.
  3. The class specified by this variable should be a subclass of UEnhancedInputUserSettings.

Best practices when using this variable include:

  1. Only change the UserSettingsClass if you need custom functionality beyond what UEnhancedInputUserSettings provides.
  2. If creating a custom class, ensure it inherits from UEnhancedInputUserSettings and implements all necessary functionality.
  3. Be cautious when modifying this setting, as it can affect the entire input system for your game.
  4. Test thoroughly after changing this value to ensure all input-related features continue to work as expected.
  5. Consider the implications on saved games and user preferences when changing this class, as it may affect data compatibility.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultInput.ini:49, section: [/Script/EnhancedInput.EnhancedInputDeveloperSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/EnhancedInputDeveloperSettings.cpp:23

Scope (from outer to inner):

file
function     UEnhancedInputDeveloperSettings::UEnhancedInputDeveloperSettings

Source code excerpt:

UEnhancedInputDeveloperSettings::UEnhancedInputDeveloperSettings(const FObjectInitializer& Initializer)
	: Super(Initializer)
	, UserSettingsClass(UEnhancedInputUserSettings::StaticClass())
	, DefaultPlayerMappableKeyProfileClass(UEnhancedPlayerMappableKeyProfile::StaticClass())
	, DefaultWorldInputClass(UEnhancedPlayerInput::StaticClass())
	, bSendTriggeredEventsWhenInputIsFlushed(true)
	, bEnableUserSettings(false)
	, bEnableDefaultMappingContexts(true)
	, bShouldOnlyTriggerLastActionInChord(true)

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Private/UserSettings/EnhancedInputUserSettings.cpp:589

Scope (from outer to inner):

file
function     UEnhancedInputUserSettings* UEnhancedInputUserSettings::LoadOrCreateSettings

Source code excerpt:

	{
		const UEnhancedInputDeveloperSettings* DevSettings = GetDefault<UEnhancedInputDeveloperSettings>();
		UClass* SettingsClass = DevSettings->UserSettingsClass ? DevSettings->UserSettingsClass.Get() : UEnhancedInputDeveloperSettings::StaticClass();
		
		Settings = Cast<UEnhancedInputUserSettings>(UGameplayStatics::CreateSaveGameObject(SettingsClass));
	}

	if (ensure(Settings))
	{

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/EnhancedInputDeveloperSettings.h:74

Scope (from outer to inner):

file
class        class UEnhancedInputDeveloperSettings : public UDeveloperSettingsBackedByCVars

Source code excerpt:

	 */
	UPROPERTY(config, EditAnywhere, NoClear, Category = "Enhanced Input|User Settings", meta=(editCondition = "bEnableUserSettings"))
	TSoftClassPtr<UEnhancedInputUserSettings> UserSettingsClass;

	/**
	 * The default class for the player mappable key profile, used to store the key mappings set by the player in the user settings.
	 * 
	 * Note: This is a new experimental feature!
	 */

#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/UserSettings/EnhancedInputUserSettings.h:464

Scope: file

Source code excerpt:

 * a single User or Local Player.
 *
 * To customize this for your game, you can create a subclass of it and change the "UserSettingsClass" in the
 * Enhanced Input Project Settings.
 */
UCLASS(config=GameUserSettings, DisplayName="Enhanced Input User Settings (Experimental)", Category="Enhanced Input|User Settings")
class ENHANCEDINPUT_API UEnhancedInputUserSettings : public USaveGame
{
	GENERATED_BODY()

public:

	//~ Begin UObject Interface
	virtual void Serialize(FArchive& Ar) override;
	//~ End UObject Interface
	
	/** Loads or creates new user settings for the owning local player of the given player input */
	static UEnhancedInputUserSettings* LoadOrCreateSettings(ULocalPlayer* LP);
	virtual void Initialize(ULocalPlayer* LP);

	/**
	 * Apply any custom input settings to your user. By default, this will just broadcast the OnSettingsApplied delegate