Exemplo n.º 1
0
 def _play_press(self) -> None:
     # pylint: disable=cyclic-import
     from bastd.ui.play import PlayWindow
     self._save_state()
     ba.containerwidget(edit=self._root_widget, transition='out_left')
     ba.app.ui.set_main_menu_window(
         PlayWindow(origin_widget=self._start_button).get_root_widget())
Exemplo n.º 2
0
 def playlist_select(self, origin_widget: ba.Widget) -> None:
     """Called by the private-hosting tab to select a playlist."""
     from bastd.ui.play import PlayWindow
     self._save_state()
     ba.containerwidget(edit=self._root_widget, transition='out_left')
     ba.app.ui.selecting_private_party_playlist = True
     ba.app.ui.set_main_menu_window(
         PlayWindow(origin_widget=origin_widget).get_root_widget())
Exemplo n.º 3
0
    def _on_back_press(self) -> None:
        # pylint: disable=cyclic-import
        from bastd.ui.play import PlayWindow

        # Store our selected playlist if that's changed.
        if self._selected_playlist is not None:
            prev_sel = ba.app.config.get(self._pvars.config_name +
                                         ' Playlist Selection')
            if self._selected_playlist != prev_sel:
                cfg = ba.app.config
                cfg[self._pvars.config_name +
                    ' Playlist Selection'] = self._selected_playlist
                cfg.commit()

        self._save_state()
        ba.containerwidget(edit=self._root_widget,
                           transition=self._transition_out)
        ba.app.main_menu_window = (PlayWindow(
            transition='in_left').get_root_widget())