Concept: Value Types & Data Sources
A setting's value type decides its widget; its source decides where the value comes from. Mixing these deliberately gives you the persist / bind / advanced choices.
Value types
| Type | Widget | Classes |
|---|---|---|
| Scalar | Slider | UCrimsonSettingValueScalar -> _BP (delegates + optional store) / Dynamic (C++ data source) |
| Discrete | Options selector | UCrimsonSettingValueDiscrete -> _BP / Dynamic (+ _Bool, _Number, _Enum, ...) |
| Action | Button | UCrimsonSettingAction (fires a named action tag or delegate) |
| Collection | Section header | UCrimsonSettingCollection / ...Collapsible (expandable) |
Sources (how a value is read/written)
| Source | Set up by | Best for |
|---|---|---|
| Keyed store | Tick Persist To Shared Store | Plain per-player persistence, no code |
| Blueprint delegates | K2_BindSetting (OnGetValue/OnSetValue, OnGetIndex/OnSetIndex) | Driving live game state from a Blueprint registry |
| C++ data source | SetDynamicGetter/SetDynamicSetter on a Dynamic value | Engine/machine settings via reflected function paths |
| Internal | Bind nothing | A value your game reads elsewhere |
C++ data sources
UCrimsonSettingValueScalarDynamic / ...DiscreteDynamic resolve their value through a FCrimsonSettingDataSource. The shipped sources are FCrimsonLocalSettingDataSourceStatic (resolves through UCrimsonSettingsLocal::Get() via the GET_CRIMSON_LOCAL_SETTINGS_FUNCTION_PATH macro), FCrimsonSettingDataSourceDynamic (a reflected property path from the local player), and FCrimsonKeyedSharedSettingDataSource (the keyed store, used by Persist To Shared Store).
auto* Gamma = NewObject<UCrimsonSettingValueScalarDynamic>(this);Gamma->SetDevName(TEXT("Brightness"));Gamma->SetSourceRangeAndStep(TRange<double>(0.0, 1.0), 0.01);Gamma->SetDynamicGetter(GET_CRIMSON_LOCAL_SETTINGS_FUNCTION_PATH(GetDisplayGamma));Gamma->SetDynamicSetter(GET_CRIMSON_LOCAL_SETTINGS_FUNCTION_PATH(SetDisplayGamma));Gamma->SetDisplayFormat(UCrimsonSettingValueScalarDynamic::Raw);
Precedence inside a _BP value
A
_BP value returns, in order: its preview value (during live preview), its storage source (if persisting), its OnGet* delegate (if bound), else its internal field. Writes go to the storage source and the OnSet* delegate when each is present - so a setting can both persist and fire a live callback.