Skip to content

Commit

Permalink
Go straight to timing tower when a session is started
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAman62 committed Feb 28, 2025
1 parent 098c3a3 commit e2ae56f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion OpenF1.Console/Display/MainDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ public Task<IRenderable> GetContentAsync()
Welcome to [bold italic]Open F1 Console[/].
To start a live timing session, press [bold]S[/] then [bold]L[/].
To start a replay an recorded session, press [bold]S[/] then [bold]F[/].
To start a replay a previously recorded/imported session, press [bold]S[/] then [bold]F[/].
Once a session is started, navigate to the Timing Tower using [bold]T[/]
Then use the Arrow Keys [bold]◄[/]/[bold]►[/] to switch between timing pages.
Use [bold]N[/]/[bold]M[/] to adjust the stream delay, and [bold]▲[/]/[bold]▼[/] keys to use the cursor.
Press Shift with these keys to adjust by a higher amount.
You can download old session data from Formula 1 by running:
> openf1-console import <year> list
Expand Down
9 changes: 7 additions & 2 deletions OpenF1.Console/Input/Session/StartLiveSessionInputHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

public class StartLiveSessionInputHandler(
SessionInfoProcessor sessionInfo,
ILiveTimingClient liveTimingClient
ILiveTimingClient liveTimingClient,
State state
) : IInputHandler
{
public bool IsEnabled => sessionInfo.Latest.Name is null;
Expand All @@ -19,5 +20,9 @@ ILiveTimingClient liveTimingClient
public async Task ExecuteAsync(
ConsoleKeyInfo consoleKeyInfo,
CancellationToken cancellationToken = default
) => await liveTimingClient.StartAsync();
)
{
await liveTimingClient.StartAsync();
state.CurrentScreen = Screen.TimingTower;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ displayOptions.SelectedLocation is null
if (state.CursorOffset >= 0 && state.CursorOffset < selected.Count)
{
_ = jsonTimingClient.StartAsync(selected.ElementAt(state.CursorOffset).Directory);
state.CurrentScreen = Screen.ManageSession;
state.CurrentScreen = Screen.TimingTower;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion OpenF1.Console/Input/SwitchToSessionInputHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class SwitchToSessionInputHandler(State state) : IInputHandler
{
public bool IsEnabled => true;

public Screen[] ApplicableScreens => [Screen.Main];
public Screen[] ApplicableScreens => [Screen.Main, Screen.TimingTower];

public ConsoleKey[] Keys => [ConsoleKey.S];

Expand Down

0 comments on commit e2ae56f

Please sign in to comment.