bastd.appdelegate

Provide our delegate for high level app functionality.

 1# Released under the MIT License. See LICENSE for details.
 2#
 3"""Provide our delegate for high level app functionality."""
 4from __future__ import annotations
 5
 6from typing import TYPE_CHECKING
 7
 8import ba
 9
10if TYPE_CHECKING:
11    from typing import Any, Callable
12
13
14class AppDelegate(ba.AppDelegate):
15    """Defines handlers for high level app functionality."""
16
17    def create_default_game_settings_ui(
18            self, gameclass: type[ba.GameActivity],
19            sessiontype: type[ba.Session], settings: dict | None,
20            completion_call: Callable[[dict | None], Any]) -> None:
21        """(internal)"""
22
23        # Replace the main window once we come up successfully.
24        from bastd.ui.playlist.editgame import PlaylistEditGameWindow
25        ba.app.ui.clear_main_menu_window(transition='out_left')
26        ba.app.ui.set_main_menu_window(
27            PlaylistEditGameWindow(
28                gameclass,
29                sessiontype,
30                settings,
31                completion_call=completion_call).get_root_widget())
class AppDelegate(ba._appdelegate.AppDelegate):
15class AppDelegate(ba.AppDelegate):
16    """Defines handlers for high level app functionality."""
17
18    def create_default_game_settings_ui(
19            self, gameclass: type[ba.GameActivity],
20            sessiontype: type[ba.Session], settings: dict | None,
21            completion_call: Callable[[dict | None], Any]) -> None:
22        """(internal)"""
23
24        # Replace the main window once we come up successfully.
25        from bastd.ui.playlist.editgame import PlaylistEditGameWindow
26        ba.app.ui.clear_main_menu_window(transition='out_left')
27        ba.app.ui.set_main_menu_window(
28            PlaylistEditGameWindow(
29                gameclass,
30                sessiontype,
31                settings,
32                completion_call=completion_call).get_root_widget())

Defines handlers for high level app functionality.

AppDelegate()