UGantrySettingValue
A setting whose value is stored as text: the base of the number, choice, toggle and key binding shapes.
By default the value is kept in the player's save under the setting's Id. To keep it somewhere else, override Read Value and Write Value in Blueprint, or call BindValue in C++.
Some places forget a value when the game closes, such as a console variable. For those, turn on Keep In Save. The registry then saves each applied value, and writes it back when the setting's page is added.
- Inherits
UGantrySetting
Properties
| Property | Type | Default | Description |
|---|---|---|---|
bKeepInSave read-only | bool | False | Keeps each applied value in the player's save, and writes it back when the page is added. Use it for values that are forgotten when the game closes, such as console variables. Not needed when Read Value and Write Value are left alone, since the value is in the save already. |
Functions
GetDefaultValueString
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | FString | out | The value the setting has before the player sets one, as text: its default, or a shape's own starting value. |
ReadValue
The current value, as text.
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | FString | out | The bound read function's value, or the player's saved value (the default when none is saved). |
SetValueString
Sets the value as text, and announces the change when it is different.
| Pin | Type | Direction | Description |
|---|---|---|---|
Value | FString | in | The value. |
Reason = Change | EGantrySettingChangeReason | in | Why it is changing. |
WriteValue
Writes the value to wherever it lives.
| Pin | Type | Direction | Description |
|---|---|---|---|
Value | FString | in | The value, as text. |
C++
Public C++ members that Blueprint does not see.
FReadFunction
using UGantrySettingValue::FReadFunction = TFunction<FString>
Native value access: reads the value as text.
FWriteFunction
using UGantrySettingValue::FWriteFunction = TFunction<void>
Native value access: writes a value given as text.
StoreInitial
virtual void
Remembers the current value as text.
RestoreToInitial
virtual void
Sets the remembered value again, as a Revert change.
IsDirty
virtual bool
Whether the current value differs from the remembered one (compared as SameValue does).
Apply
virtual void
Writes the value into the player's save when the setting keeps it there, then applies it.
BindValue
void
C++: reads and writes the value with functions instead of the save.