Table of Contents

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

string

ApplyMode

Gets the mode for applying changes to this field.

public SetupUiApplyMode ApplyMode { get; }

Property Value

SetupUiApplyMode

Axle

Gets the axle associated with this field, if any.

public VehicleSetupAxle Axle { get; }

Property Value

VehicleSetupAxle

BindingKind

Gets the kind of binding (e.g., Variable, TyrePressure).

public VehicleSetupEntryKind? BindingKind { get; }

Property Value

VehicleSetupEntryKind?

BoundKey

Gets the key used for binding this field to a vehicle property or variable.

public string? BoundKey { get; }

Property Value

string

CanResetToDefault

Gets a value indicating whether this field can currently be reset to its default value.

public bool CanResetToDefault { get; }

Property Value

bool

ChoiceIndex

Gets the current index of the selected choice.

public int ChoiceIndex { get; }

Property Value

int

ChoiceOptions

Gets the list of options for a choice field.

public IReadOnlyList<string> ChoiceOptions { get; }

Property Value

IReadOnlyList<string>

DefaultDisplayValue

Gets the display string for the default value of this field.

public string DefaultDisplayValue { get; }

Property Value

string

Description

Gets the detailed description of what the field tunes.

public string Description { get; }

Property Value

string

DisplayValue

Gets the human-readable display value of the field.

public string DisplayValue { get; }

Property Value

string

EditorKind

Gets the kind of editor to use for this field.

public SetupUiEditorKind EditorKind { get; }

Property Value

SetupUiEditorKind

Id

Gets the unique identifier for the field.

public string Id { get; }

Property Value

string

IsBoundNumericField

Gets a value indicating whether this field is a numeric field bound to a vehicle property.

public bool IsBoundNumericField { get; }

Property Value

bool

IsDirty

Gets a value indicating whether this field has pending changes that haven't been committed.

public bool IsDirty { get; }

Property Value

bool

Label

Gets the display label for the field.

public string Label { get; }

Property Value

string

Maximum

Gets the maximum allowed display-scale value.

public float Maximum { get; }

Property Value

float

Minimum

Gets the minimum allowed display-scale value.

public float Minimum { get; }

Property Value

float

NumericValue

Gets the current display-scale numeric value.

public float NumericValue { get; }

Property Value

float

RawNumericValue

Gets the current raw-scale numeric value (as used in simulation or BeamNG variables).

public float RawNumericValue { get; }

Property Value

float

Step

Gets the step size for display-scale adjustments.

public float Step { get; }

Property Value

float

ToggleOffLabel

Gets the label displayed when the toggle is 'off'.

public string ToggleOffLabel { get; }

Property Value

string

ToggleOnLabel

Gets the label displayed when the toggle is 'on'.

public string ToggleOnLabel { get; }

Property Value

string

ToggleValue

Gets the current boolean toggle value.

public bool ToggleValue { get; }

Property Value

bool

Unit

Gets the unit of measurement for the numeric value.

public string Unit { get; }

Property Value

string

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

id string

Stable field identifier.

label string

Display label shown in the setup UI.

description string

Long-form helper text for the field.

choiceIndex int

Initial selected option index.

options IReadOnlyList<string>

Available option labels.

applyMode SetupUiApplyMode

How 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

step int

The 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

entry VehicleSetupEntry

The vehicle setup entry.

label string

The display label for the field.

Returns

SetupUiFieldModel

A new SetupUiFieldModel.

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

id string

Stable field identifier.

label string

Display label shown in the setup UI.

description string

Long-form helper text for the field.

value float

Initial numeric value.

minimum float

Minimum allowed numeric value.

maximum float

Maximum allowed numeric value.

step float

Increment step used by the UI.

unit string

Display unit label.

applyMode SetupUiApplyMode

How 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

value float

The new display-scale value.

SetToggleValue(bool)

Sets a new boolean toggle value for the field.

public void SetToggleValue(bool value)

Parameters

value bool

The 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

id string

Stable field identifier.

label string

Display label shown in the setup UI.

description string

Long-form helper text for the field.

value bool

Initial toggle state.

onLabel string

Text shown for the enabled state.

offLabel string

Text shown for the disabled state.

applyMode SetupUiApplyMode

How the field is applied to the vehicle.

Returns

SetupUiFieldModel

A configured toggle SetupUiFieldModel.