Class SetupUiFieldModel
- Namespace
- LibreRally.HUD
- Assembly
- LibreRally.dll
Data model for a single setup field in the UI.
public sealed class SetupUiFieldModel
- Inheritance
-
SetupUiFieldModel
- Inherited Members
Properties
ApplyHint
Gets a short hint about when changes to this field will be applied.
public string ApplyHint { get; }
Property Value
ApplyMode
Gets the mode for applying changes to this field.
public SetupUiApplyMode ApplyMode { get; }
Property Value
Axle
Gets the axle associated with this field, if any.
public VehicleSetupAxle Axle { get; }
Property Value
BindingKind
Gets the kind of binding (e.g., Variable, TyrePressure).
public VehicleSetupEntryKind? BindingKind { get; }
Property Value
BoundKey
Gets the key used for binding this field to a vehicle property or variable.
public string? BoundKey { get; }
Property Value
CanResetToDefault
Gets a value indicating whether this field can currently be reset to its default value.
public bool CanResetToDefault { get; }
Property Value
ChoiceIndex
Gets the current index of the selected choice.
public int ChoiceIndex { get; }
Property Value
ChoiceOptions
Gets the list of options for a choice field.
public IReadOnlyList<string> ChoiceOptions { get; }
Property Value
DefaultDisplayValue
Gets the display string for the default value of this field.
public string DefaultDisplayValue { get; }
Property Value
Description
Gets the detailed description of what the field tunes.
public string Description { get; }
Property Value
DisplayValue
Gets the human-readable display value of the field.
public string DisplayValue { get; }
Property Value
EditorKind
Gets the kind of editor to use for this field.
public SetupUiEditorKind EditorKind { get; }
Property Value
Id
Gets the unique identifier for the field.
public string Id { get; }
Property Value
IsBoundNumericField
Gets a value indicating whether this field is a numeric field bound to a vehicle property.
public bool IsBoundNumericField { get; }
Property Value
IsDirty
Gets a value indicating whether this field has pending changes that haven't been committed.
public bool IsDirty { get; }
Property Value
Label
Gets the display label for the field.
public string Label { get; }
Property Value
Maximum
Gets the maximum allowed display-scale value.
public float Maximum { get; }
Property Value
Minimum
Gets the minimum allowed display-scale value.
public float Minimum { get; }
Property Value
NumericValue
Gets the current display-scale numeric value.
public float NumericValue { get; }
Property Value
RawNumericValue
Gets the current raw-scale numeric value (as used in simulation or BeamNG variables).
public float RawNumericValue { get; }
Property Value
Step
Gets the step size for display-scale adjustments.
public float Step { get; }
Property Value
ToggleOffLabel
Gets the label displayed when the toggle is 'off'.
public string ToggleOffLabel { get; }
Property Value
ToggleOnLabel
Gets the label displayed when the toggle is 'on'.
public string ToggleOnLabel { get; }
Property Value
ToggleValue
Gets the current boolean toggle value.
public bool ToggleValue { get; }
Property Value
Unit
Gets the unit of measurement for the numeric value.
public string Unit { get; }
Property Value
Methods
AcceptPendingValue()
Commits the current pending value as the new baseline.
public void AcceptPendingValue()
Choice(string, string, string, int, IReadOnlyList<string>, SetupUiApplyMode)
Creates a choice field model.
public static SetupUiFieldModel Choice(string id, string label, string description, int choiceIndex, IReadOnlyList<string> options, SetupUiApplyMode applyMode)
Parameters
idstringStable field identifier.
labelstringDisplay label shown in the setup UI.
descriptionstringLong-form helper text for the field.
choiceIndexintInitial selected option index.
optionsIReadOnlyList<string>Available option labels.
applyModeSetupUiApplyModeHow the field is applied to the vehicle.
Returns
- SetupUiFieldModel
A configured choice SetupUiFieldModel.
CycleChoice(int)
Cycles to the next or previous choice option.
public void CycleChoice(int step = 1)
Parameters
stepintThe number of options to move (can be negative).
FromVehicleSetupEntry(VehicleSetupEntry, string)
Creates a setup field model from a VehicleSetupEntry.
public static SetupUiFieldModel FromVehicleSetupEntry(VehicleSetupEntry entry, string label)
Parameters
entryVehicleSetupEntryThe vehicle setup entry.
labelstringThe display label for the field.
Returns
Numeric(string, string, string, float, float, float, float, string, SetupUiApplyMode)
Creates a numeric field model.
public static SetupUiFieldModel Numeric(string id, string label, string description, float value, float minimum, float maximum, float step, string unit, SetupUiApplyMode applyMode)
Parameters
idstringStable field identifier.
labelstringDisplay label shown in the setup UI.
descriptionstringLong-form helper text for the field.
valuefloatInitial numeric value.
minimumfloatMinimum allowed numeric value.
maximumfloatMaximum allowed numeric value.
stepfloatIncrement step used by the UI.
unitstringDisplay unit label.
applyModeSetupUiApplyModeHow the field is applied to the vehicle.
Returns
- SetupUiFieldModel
A configured numeric SetupUiFieldModel.
ResetToCommittedValue()
Resets the field's value to the last committed value.
public void ResetToCommittedValue()
ResetToDefaultValue()
Resets the field's value to its original default value.
public void ResetToDefaultValue()
SetNumericValue(float)
Sets a new numeric value for the field, clamping it to the allowed range.
public void SetNumericValue(float value)
Parameters
valuefloatThe new display-scale value.
SetToggleValue(bool)
Sets a new boolean toggle value for the field.
public void SetToggleValue(bool value)
Parameters
valueboolThe new toggle value.
Toggle(string, string, string, bool, string, string, SetupUiApplyMode)
Creates a toggle field model.
public static SetupUiFieldModel Toggle(string id, string label, string description, bool value, string onLabel, string offLabel, SetupUiApplyMode applyMode)
Parameters
idstringStable field identifier.
labelstringDisplay label shown in the setup UI.
descriptionstringLong-form helper text for the field.
valueboolInitial toggle state.
onLabelstringText shown for the enabled state.
offLabelstringText shown for the disabled state.
applyModeSetupUiApplyModeHow the field is applied to the vehicle.
Returns
- SetupUiFieldModel
A configured toggle SetupUiFieldModel.