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,
19        gameclass: type[ba.GameActivity],
20        sessiontype: type[ba.Session],
21        settings: dict | None,
22        completion_call: Callable[[dict | None], Any],
23    ) -> None:
24        """(internal)"""
25
26        # Replace the main window once we come up successfully.
27        from bastd.ui.playlist.editgame import PlaylistEditGameWindow
28
29        ba.app.ui.clear_main_menu_window(transition='out_left')
30        ba.app.ui.set_main_menu_window(
31            PlaylistEditGameWindow(
32                gameclass,
33                sessiontype,
34                settings,
35                completion_call=completion_call,
36            ).get_root_widget()
37        )
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,
20        gameclass: type[ba.GameActivity],
21        sessiontype: type[ba.Session],
22        settings: dict | None,
23        completion_call: Callable[[dict | None], Any],
24    ) -> None:
25        """(internal)"""
26
27        # Replace the main window once we come up successfully.
28        from bastd.ui.playlist.editgame import PlaylistEditGameWindow
29
30        ba.app.ui.clear_main_menu_window(transition='out_left')
31        ba.app.ui.set_main_menu_window(
32            PlaylistEditGameWindow(
33                gameclass,
34                sessiontype,
35                settings,
36                completion_call=completion_call,
37            ).get_root_widget()
38        )

Defines handlers for high level app functionality.

AppDelegate()