githubEdit

OptionPrompt

package com.skeletonarmy.marrow.prompts

Overview

OptionPrompt<T> is a generic prompt used in pre-match configuration screens with Prompter. 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

To create a new prompt, provide a 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.

circle-info

Can be used with any object type that has a meaningful toString() method, since it 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 ===

 - RED <
 - BLUE

After pressing D-PAD DOWN:

Last updated