OptionPrompt

Overview

OptionPrompt<T> is a generic prompt used in pre-match configuration screens with ChoiceMenu. It allows drivers to select from a list of options using the gamepad. The currently selected item is clearly marked and can be confirmed with a button press.


Usage

You typically supply ChoiceMenu with an OptionPrompt. To create a new prompt, provide it with the header and options:

new OptionPrompt<>("Select Alliance", Alliance.RED, Alliance.BLUE)

This will display a scrollable list with the options RED and BLUE. The selected option is returned when the user presses the A button.

Can be used with any object type that has a meaningful toString() method, since the display uses toString() to display the options.

Controls

  • D-PAD UP: Move selection up

  • D-PAD DOWN: Move selection down

  • A: Confirm selection

📋 Telemetry Output Example:

Select Alliance

1) RED <
2) BLUE

Pressing D-PAD DOWN:

Select Alliance

1) RED
2) BLUE <

Last updated