FSaveableEnhancedActionKeyMapping
Overview
This struct is used to save and load key mappings for input actions, ensuring they can be persisted across sessions. It inherits from FEnhancedActionKeyMapping and overrides the Serialize function to handle saving and loading of the key mapping's name.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FName | Key | Public | The key associated with the action. |
Functions
Return Type | Signature | Description |
|---|---|---|
bool | Serialize(FArchive& Ar) | Serializes the key mapping's name to or from an archive. |
ULimenKeyBind
Overview
This class manages the state and behavior of a key binding setting. It provides methods to initialize, serialize, apply, and manage the current value of the key binding. It also implements interfaces for editable and readable settings.
Properties
Type | Name | Access | Description |
|---|---|---|---|
bool | bCanEdit | EditAnywhere | Indicates whether the setting can be edited. |
FEnhancedActionKeyMapping | CurrentKeyMapping | Private | The current key mapping value. |
FEnhancedActionKeyMapping | PreviousKeyMapping | Private | The previous key mapping value. |
FSaveableEnhancedActionKeyMapping | AppliedKeyMapping | SaveGame | The applied key mapping value, saved across sessions. |
EInputActionHandlingType | SavedInputHandlingType | SaveGame | The saved input action handling type. |
TArray | PossibleValues | Private | A list of possible key mapping values. |
FEnhancedActionKeyMapping | DefaultSelection | Private | The default key mapping selection. |
FEnhancedActionKeyMapping* | ActionKeyMappingPtr | Private | Pointer to the action key mapping being managed. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | Serialize(FArchive& Ar) | Serializes the applied key mapping value to or from an archive. |
void | InitializeSetting(ULimenModularSettingsSubsystem* InOwnerSubsystem, FEnhancedActionKeyMapping* InActionKeyMapping) | Initializes the setting with a specific action key mapping. |
const TArray & | GetSettingValues() const | Returns the list of possible key mapping values. |
FEnhancedActionKeyMapping | GetCurrentValue() const | Gets the current key mapping value. |
FEnhancedActionKeyMapping | GetPreviousValue() const | Gets the previous key mapping value. |
FEnhancedActionKeyMapping | GetAppliedValue() const | Gets the applied key mapping value. |
bool | IsValueValid(const FEnhancedActionKeyMapping& Test) | Checks if a given key mapping is valid (i.e., not invalid). |
bool | CanEdit() const | Determines if the setting can be edited. |
bool | SetNewValue(const FEnhancedActionKeyMapping& NewSelection) | Sets a new value for the key binding and updates internal state accordingly. |
void | ApplyCurrentSetting(bool bUserRequest = false) | Applies the current key mapping to the target action key mapping pointer. |
void | SetDefaults() | Resets the setting to its default values. |
void | SetDefaultValue() | Sets the current value to the default selection and updates internal state accordingly. |
void | PostDataLoaded() | Called after data is loaded, ensuring consistency of internal state. |
void | SetInputActionHandlingType(const EInputActionHandlingType NewType) | Sets a new input action handling type if allowed. |
Usage & Implementation Notes
Threading Constraints: This class does not have specific threading constraints as it operates on Unreal Engine's default thread model.
Replication Requirements: No replication is required for this class as it manages local settings.
Memory Lifetime Management: The class uses
UPROPERTY(SaveGame)to ensure that the applied key mapping and input handling type are saved across sessions, managing memory lifetime through Unreal Engine's save game system.Initialization Dependencies: The
InitializeSettingfunction depends on a validULimenModularSettingsSubsystemand anFEnhancedActionKeyMapping.