ULimenValueSetting
Overview
ULimenValueSetting is an abstract base class designed to handle settings that can be adjusted within a specified range. It inherits from ULimenSetting, TLimenEditableSetting<float>, and TLimenReadableSetting<float>. This class provides the core functionality for managing a value setting, including getting and setting its value, checking validity, and handling default values.
Properties
Type | Name | Access | Description |
|---|---|---|---|
TArray | ValueRange | EditAnywhere | Range of valid values for the setting. Index 0 is the minimum value, index 1 is the maximum value. |
float | DefaultSettingValue | EditAnywhere | The default value of the setting. |
int32 | DecimalsDisplayed | EditAnywhere, ClampMin="0" | Number of decimal places to display and validate against. |
float | CurrentSettingValue | Private | The current value of the setting. |
float | PreviousSettingValue | Private | The previous value of the setting before it was changed. |
float | AppliedSettingValue | Private | The last applied value of the setting. |
FString | StringValue | SaveGame | A string representation of the current value, used for serialization. |
Functions
Return Type | Signature | Description |
|---|---|---|
float | GetMinValuePerChange() const | Returns the minimum value per change that can be set. |
int32 | GetDecimalCount() const | Returns the number of decimal places displayed and validated against. |
TArray | GetSettingValues() const override final | Returns the range of valid values for the setting. |
float | GetCurrentValue() const override final | Returns the current value of the setting. |
float | GetPreviousValue() const override final | Returns the previous value of the setting before it was changed. |
float | GetAppliedValue() const override final | Returns the last applied value of the setting. |
bool | IsValueValid(const float& Test) override | Checks if a given value is within the valid range. |
bool | CanEdit() const override | Determines if the setting can be edited. Always returns true. |
bool | SetNewValue(const float& NewSelection) override | Sets a new value for the setting, sanitizing it to ensure it falls within the valid range and has the correct number of decimal places. |
void | SetDefaultValue() override final | Resets the current value to the default value. |
void | SetDefaults() override | Initializes default values for the setting. |
void | PostDataLoaded() override final | Handles post-load initialization, setting up the current value from serialized data. |
void | ApplyCurrentSetting(bool bUserRequest) override | Applies the current value and updates the applied value. |
Usage & Implementation Notes
The
MinValuePerChangeproperty controls the smallest increment that can be made to the setting.The
DecimalsDisplayedproperty ensures that values are validated and displayed with a specific number of decimal places.The
StringValueis used for serialization purposes, ensuring that the value persists across sessions.