bauiv1lib.playlist package¶
Playlist ui functionality.
- class bauiv1lib.playlist.PlaylistTypeVars(sessiontype: type[Session])[source]¶
Bases:
objectDefines values for a playlist type (config names to use, etc).
Submodules¶
bauiv1lib.playlist.addgame module¶
Provides a window for selecting a game type to add to a playlist.
- class bauiv1lib.playlist.addgame.PlaylistAddGameWindow(editcontroller: PlaylistEditController, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None)[source]¶
Bases:
MainWindowWindow for selecting a game type to add to a playlist.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.playlist.browserdocui module¶
The teams/free-for-all playlist browser, as a doc-ui page.
A client-local doc-ui domain: a grid of playlist buttons (map previews and all) plus a small customize button, leading to the play-options popup and the playlist customize browser (both still legacy).
It also serves gather’s private-party hosting in select mode (reached via the play page’s select mode), where confirming a playlist in the popup just records it and heads back to gather.
- class bauiv1lib.playlist.browserdocui.Customize(kind: SessionKind)[source]¶
Bases:
PlaylistLocalActionGo to the playlist customize browser.
- classmethod get_press_sound() PressSound[source]¶
What a button plays when pressed to run this local-action.
Actions that stay on the page click (the default); override to return
SWISHfor ones that go somewhere (open a window or popup). A press whose action hasdefault_soundoff plays nothing either way.
- kind: SessionKind¶
- class bauiv1lib.playlist.browserdocui.OpenPlaylist(kind: SessionKind, name: str, select: bool = False)[source]¶
Bases:
PlaylistLocalActionShow a playlist’s play options.
- classmethod get_press_sound() PressSound[source]¶
What a button plays when pressed to run this local-action.
Actions that stay on the page click (the default); override to return
SWISHfor ones that go somewhere (open a window or popup). A press whose action hasdefault_soundoff plays nothing either way.
- kind: SessionKind¶
- class bauiv1lib.playlist.browserdocui.PlaylistBrowserController[source]¶
Bases:
TypedDocUIController[Playlists,OpenPlaylist|Customize]Doc-ui controller for the playlist browser.
- fulfill_route(route: AnyPlaylistRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- classmethod get_local_action_type() type[PlaylistLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[PlaylistRoute][source]¶
Return the family class for the routes we handle.
- get_window_toolbar_visibility() Literal['menu_full', 'menu_minimal'][source]¶
Which toolbar our windows show.
Everything by default. Settings-style pages reachable mid-game typically return
'menu_minimal'unlessbauiv1.in_main_menu(), as the classic settings windows do.
- run_local_action(action: AnyPlaylistLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
- class bauiv1lib.playlist.browserdocui.PlaylistLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the playlist browser local-actions.
- classmethod get_action_types() tuple[type[DocUILocalActionBase], ...][source]¶
Return all concrete local-actions in this family.
Must be overridden by each family class; see
get_route_types().
- class bauiv1lib.playlist.browserdocui.PlaylistRoute[source]¶
Bases:
DocUIRouteFamily class for the playlist browser routes.
- classmethod get_route_types() tuple[type[DocUIRoute], ...][source]¶
Return all concrete routes in this family.
Must be overridden by each family class. A family generally defines a union alias of its routes (which also gives handlers
assert_neverexhaustiveness) and returnsfamily_members()of it here.
- classmethod get_window_layout() WindowLayout[source]¶
The layout windows browsing to this route open with.
browse()uses this unless told otherwise, so a route whose page is best shown at some layout declares it once rather than at every link.Defaults to
WIDE, which is the same size at every ui-scale, so a one-off page (a confirmation, a dialog) never ends up as a big mostly-empty window.LARGE, which grows to fill more of the screen at medium/large ui-scale, is for pages built to use that room (store listings and the like), and they ask for it explicitly.
- class bauiv1lib.playlist.browserdocui.PlaylistSelectController[source]¶
Bases:
PlaylistBrowserControllerThe playlist browser for picking a private-party playlist.
Open it at
Playlistsroutes withselectset (the play page’s select mode does). Its own class keeps these windows distinct from the play flow’s for navigation, and it shows a minimal toolbar (as the legacy select flow did): we’re mid-errand for the gather window.
- class bauiv1lib.playlist.browserdocui.Playlists(kind: SessionKind, select: bool = False)[source]¶
Bases:
PlaylistRouteThe playlists of one kind.
- kind: SessionKind¶
bauiv1lib.playlist.customizebrowser module¶
Provides UI for viewing/creating/editing playlists.
- class bauiv1lib.playlist.customizebrowser.PlaylistCustomizeBrowserWindow(sessiontype: type[bs.Session], transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, select_playlist: str | None = None)[source]¶
Bases:
MainWindowWindow for viewing a playlist.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.playlist.edit module¶
Provides a window for editing individual game playlists.
- class bauiv1lib.playlist.edit.PlaylistEditWindow(editcontroller: PlaylistEditController, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None)[source]¶
Bases:
MainWindowWindow for editing an individual game playlist.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.playlist.editcontroller module¶
Defines a controller for wrangling playlist edit UIs.
- class bauiv1lib.playlist.editcontroller.PlaylistEditController(sessiontype: type[Session], from_window: MainWindow, *, existing_playlist_name: str | None = None, playlist: list[dict[str, Any]] | None = None, playlist_name: str | None = None)[source]¶
Bases:
objectCoordinates various UIs involved in playlist editing.
- add_game_pressed(from_window: MainWindow) None[source]¶
(internal)
- add_game_type_selected(gametype: type[GameActivity], from_window: MainWindow) None[source]¶
(internal)
- edit_game_pressed(from_window: MainWindow) None[source]¶
Should be called by supplemental UIs when a game is to be edited.
bauiv1lib.playlist.editgame module¶
Provides UI for editing a game config.
- class bauiv1lib.playlist.editgame.PlaylistEditGameWindow(gametype: type[GameActivity], sessiontype: type[Session], config: dict[str, Any] | None, completion_call: Callable[[dict[str, Any] | None, MainWindow], Any], default_selection: str | None = None, transition: str | None = 'in_right', origin_widget: Widget | None = None, edit_info: dict[str, Any] | None = None)[source]¶
Bases:
MainWindowWindow for editing a game config.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.playlist.mapselect module¶
Provides UI for selecting maps in playlists.
- class bauiv1lib.playlist.mapselect.PlaylistMapSelectWindow(gametype: type[bs.GameActivity], sessiontype: type[bs.Session], config: dict[str, Any], edit_info: dict[str, Any], completion_call: Callable[[dict[str, Any] | None, bui.MainWindow], Any], transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, select_get_more_maps_button: bool = False)[source]¶
Bases:
MainWindowWindow to select a map.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).