The game's car radio: what's playing, and changing the station as the D-pad does.
New in 0.12.0.
Thread: Station, Song and Artist from any thread; Next and Previous on the game's thread; Changed is raised on the game's thread.
Example
protected override void OnInit()
{
Radio.Changed += () => UI.Notify(Radio.Station, $"{Radio.Song} - {Radio.Artist}");
AddHotkey(new HotkeyOptions("NextStation", "Next radio station", new HotkeyBinding(0x22 /* Page Down */, KeyModifiers.None, null))
{
Pressed = () => Game.Run(() => Radio.Next()),
});
}
Protected Overrides Sub OnInit()
AddHandler Radio.Changed, Sub() UI.Notify(Radio.Station, $"{Radio.Song} - {Radio.Artist}")
End Sub
Members
| Member | What it does |
|---|---|
Station (property, get, string) | The station playing, as the radio's banner names it, or "" while it's off or not known yet. |
Song (property, get, string) | The song playing, or "". |
Artist (property, get, string) | Who it's by, or "". |
Changed (event, Action) | The station, the song or the artist changed. |
Next() → bool | The next station, as the game's D-pad right does. |
Previous() → bool | The station before, as D-pad left does. |
Notes
- The station, song and artist come from the radio's banner on the HUD, which the game updates about every frame while you drive. They're "" until it has run once.
- Found by ANNA-DroneMode.
