menus.radio module

Provides ShowMenu based functionality.

Bases: menus.radio.PagedRadioMenu

Creates a list-like radio menu.

Navigation options are added automatically.

Initialize the object.

Parameters:

Bases: menus.radio.PagedRadioOption

Provides options for ListRadioMenu objects.

Initialize the option.

Parameters:

Note

highlight only works if enumerated is set to True.

See menus.base._MenuData._render().

Bases: menus.radio.SimpleRadioMenu, menus.base._PagedMenuBase

Create menus with an unlimited number of options.

Navigation options will be added automatically.

Initialize the object.

Parameters:
  • data (iterable|None) – See menus.base._BaseMenu.__init__().
  • select_callback (callable|None) – See menus.base._BaseMenu.__init__().
  • build_callback (callable|None) – See menus.base._BaseMenu.__init__().
  • description (str|None) – A description that is displayed under the title.
  • title (str|None) – A title that is displayed at the top of the menu.
  • top_separator (str) – A separator that is displayed right after the title/description.
  • bottom_separator (str) – A separator that is displayed right after the body.
  • fill (bool) – If True the menu will be filled so that it will always have the same size.
  • parent_menu (_BaseMenu) – A menu that will be displayed when hitting ‘Back’ on the first page.

Prepare the body for the menu.

Parameters:
  • player_index (int) – A player index.
  • page (_PlayerPage) – The player’s current page.
  • slots (set) – A set to which slots can be added.

Prepare the footer for the menu.

Parameters:
  • player_index (int) – A player index.
  • page (_PlayerPage) – The player’s current page.
  • slots (set) – A set to which slots can be added.

Prepare the header for the menu.

Parameters:
  • player_index (int) – A player index.
  • page (_PlayerPage) – The player’s current page.
  • slots (set) – A set to which slots can be added.

Return the maximum possible item count per page.

Return all relevant menu data as a dictionary.

Parameters:player_index (int) – A player index.

See menus.base._BaseMenu._select().

Bases: menus.radio._BaseRadioOption

Provides options for PagedRadioMenu objects.

See menus.base._MenuData._render().

Bases: menus.base._BaseMenu

This class creates a basic radio menu.

See menus.base._BaseMenu._close().

Return the menu string, enabled slots, and time to show the menu.

Parameters:player_index (int) – See menus.base._BaseMenu._get_menu_data().

Return the queue for radio menus.

See menus.base._BaseMenu._select().

Build and sends the menu to the given player via ShowMenu.

Parameters:player_index (int) – See menus.base._BaseMenu._send().

Convert an iterable of slots to the binary slot representation.

Parameters:slots (iterable) – Slots that should be enabled.
Raises:ValueError – Raised if a slot is out of range.

Bases: menus.radio._BaseRadioOption

Provides options for SimpleRadioMenu objects.

Initialize the option.

Parameters:

See menus.base._MenuData._render().