Skip to content

Game.UI.Widgets.TimeSliderField

Assembly:
Assembly-CSharp (typical for Cities: Skylines 2 mods; adjust if the class is in a different assembly)

Namespace:
Game.UI.Widgets

Type:
public class

Base:
TimeField

Summary:
A lightweight concrete specialization of TimeField with T = float. TimeSliderField exposes a slider-style UI widget for editing float-based time values. The class itself does not add new fields or members — it exists to provide a typed, reusable widget for float time values and inherits behavior, styling, events and properties from TimeField. This is useful in mod UI code where a float-based time slider is required (for example, adjusting simulation speed, time-of-day, or other float time parameters).


Fields

  • This class does not declare any new private or public fields.
    Inherited fields (if any) come from TimeField and its base classes.

Properties

  • This class does not declare any new properties.
    Use the properties provided by TimeField, such as (typical examples — actual names depend on the base class implementation):
  • Value (float) — current slider value
  • Min (float) / Max (float) — allowed range
  • IsReadOnly / Enabled — UI state
  • OnValueChanged (delegate/event) — callback for value changes

Replace the example property names with the actual members from TimeField in your environment.

Constructors

  • public TimeSliderField()
    This class does not declare an explicit constructor; the default parameterless constructor is available. Initialization behavior (control creation, default ranges, styling) is inherited from TimeField and any common UI initialization performed there.

Methods

  • This class does not declare any new methods.
    Override or use the protected/public methods from TimeField if you need to customize creation, binding or event handling (for example OnCreate, OnBind, OnDestroy, etc., if present).

Usage Example

// Create and configure a TimeSliderField (example usage — adapt to actual API names)
var slider = new TimeSliderField();

// Typical inherited properties (replace with actual member names from TimeField<float>):
slider.Min = 0f;
slider.Max = 24f;
slider.Value = 12f;

// Subscribe to value changes (use the actual event or callback member provided by TimeField<float>)
slider.OnValueChanged += (float newValue) =>
{
    UnityEngine.Debug.Log("TimeSlider value changed: " + newValue);
};

// Add to your UI layout/container as appropriate for your UI framework
// e.g., parent.AddChild(slider); // pseudo-code — replace with actual UI container API

Notes: - Because TimeSliderField is a thin typed wrapper, consult the documentation or source of TimeField to discover the exact member names and behaviors to use (events, binding, styling hooks). - If you need to customize behavior, derive from TimeSliderField or directly from TimeField and override the relevant protected methods (e.g., OnCreate) to set up custom logic or default ranges.