UDEPRECATED_LimenToggleSetting
Overview
UDEPRECATED_LimenToggleSetting is an abstract base class designed to handle settings that can be toggled between two states: on and off. It inherits from ULimenSetting, TLimenEditableSetting<bool>, and TLimenReadableSetting<bool>. This class provides the core functionality for managing a toggleable setting, including getting and setting its value, checking validity, and handling default values.
Properties
Type | Name | Access | Description |
|---|---|---|---|
bool | bDefaultSettingState | EditAnywhere | The default state of the toggle. |
TArray | PossibleStates | None | An array containing all possible states for the toggle (currently only |
bool | bCurrentSettingState | SaveGame | The current state of the toggle. |
bool | bPreviousSettingState | Private | The previous state of the toggle before it was last updated. |
Functions
Return Type | Signature | Description |
|---|---|---|
const TArray & | GetSettingValues() const | Returns an array containing all possible states for the toggle. |
bool | GetCurrentValue() const | Returns the current state of the toggle. |
bool | GetPreviousValue() const | Returns the previous state of the toggle before it was last updated. |
bool | IsValueValid(const bool& Test) | Checks if a given value is valid for the toggle. Always returns |
bool | CanEdit() const | Determines if the setting can be edited. Always returns |
bool | SetNewValue(const bool& NewSelection) | Sets the new state of the toggle and updates the previous state accordingly. Broadcasts an event when the setting is updated. |
void | SetDefaults() | Resets the setting to its default value. |
void | SetDefaultValue() | Sets the current state of the toggle to its default value. |
void | PostDataLoaded() | Called after data has been loaded, ensuring that the previous and current states are synchronized. |
Usage & Implementation Notes
The
GetSettingValuesfunction returns a predefined array with two possible states (falseandtrue). This is likely kept for compatibility reasons.The
SetNewValuefunction includes error handling to log an error if setting the new value fails, which should be addressed in any subclass that overrides this method.The class uses Unreal Engine's logging system to handle errors, ensuring that issues with setting values are reported appropriately.