From 3ca2f2b5c3af1759cf8dbae29922699e5cbab109 Mon Sep 17 00:00:00 2001 From: TrialTemp Date: Tue, 9 Jan 2024 12:47:52 -0600 Subject: [PATCH] preflight doing preflight things again --- .../ba_data/python/bascenev1/_coopsession.py | 6 +-- .../python/bauiv1lib/tournamententry.py | 37 +++++++++---------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/assets/ba_data/python/bascenev1/_coopsession.py b/src/assets/ba_data/python/bascenev1/_coopsession.py index 268b8ae8..abfa3771 100644 --- a/src/assets/ba_data/python/bascenev1/_coopsession.py +++ b/src/assets/ba_data/python/bascenev1/_coopsession.py @@ -64,7 +64,7 @@ class CoopSession(Session): submit_score = classic.coop_session_args['submit_score'] else: submit_score = True - + # print('FIXME: COOP SESSION WOULD CALC DEPS.') depsets: Sequence[bascenev1.DependencySet] = [] @@ -347,8 +347,8 @@ class CoopSession(Session): if not (env.demo or env.arcade): if ( - self.tournament_id is not None and - activity.session._submit_score + self.tournament_id is not None + and activity.session._submit_score ): self._custom_menu_ui = [ { diff --git a/src/assets/ba_data/python/bauiv1lib/tournamententry.py b/src/assets/ba_data/python/bauiv1lib/tournamententry.py index fee7c0b9..bfac56bc 100644 --- a/src/assets/ba_data/python/bauiv1lib/tournamententry.py +++ b/src/assets/ba_data/python/bauiv1lib/tournamententry.py @@ -88,13 +88,13 @@ class TournamentEntryWindow(PopupWindow): # Show the practice button as long as we're not # restarting while on a paid tournament run. from bascenev1lib.activity.coopscore import CoopScoreScreen - self._do_practice = ( - self._tournament_activity is None or - isinstance(self._tournament_activity, CoopScoreScreen) + + self._do_practice = self._tournament_activity is None or isinstance( + self._tournament_activity, CoopScoreScreen ) - + off_p = 0 if not self._do_practice else 48 - self._height += (off_p*0.933) + self._height += off_p * 0.933 # Creates our root_widget. super().__init__( @@ -260,10 +260,7 @@ class TournamentEntryWindow(PopupWindow): self._pay_with_ad_btn = None btn_size = (150, 45) - btn_pos = ( - self._width / 2 - btn_size[0]/2, - self._width / 2 - 110 - ) + btn_pos = (self._width / 2 - btn_size[0] / 2, self._width / 2 - 110) if self._do_practice: self._practice_button = bui.buttonwidget( parent=self.root_widget, @@ -553,7 +550,7 @@ class TournamentEntryWindow(PopupWindow): text=bui.charstr(bui.SpecialChar.TICKET) + t_str, ) - def _launch(self, practice = False) -> None: + def _launch(self, practice=False) -> None: assert bui.app.classic is not None if self._launched: return @@ -563,22 +560,22 @@ class TournamentEntryWindow(PopupWindow): # If they gave us an existing, non-consistent # practice activity, just restart it. if ( - self._tournament_activity is not None and - not practice == self._tournament_activity.session._submit_score + self._tournament_activity is not None + and not practice == self._tournament_activity.session._submit_score ): try: if not practice: bui.apptimer(0.1, bui.getsound('cashRegister').play) bui.screenmessage( bui.Lstr( - translate=('serverResponses', 'Entering tournament...') + translate=( + 'serverResponses', + 'Entering tournament...', + ) ), color=(0, 1, 0), ) - bui.apptimer( - 0 if practice else 0.3, - self._transition_out - ) + bui.apptimer(0 if practice else 0.3, self._transition_out) launched = True with self._tournament_activity.context: self._tournament_activity.end( @@ -714,7 +711,7 @@ class TournamentEntryWindow(PopupWindow): 'tournament_entry', on_completion_call=bui.WeakCall(self._on_ad_complete), ) - + def on_practice_press(self) -> None: plus = bui.app.plus assert plus is not None @@ -722,7 +719,7 @@ class TournamentEntryWindow(PopupWindow): # If we're already entering, ignore. if self._entering: return - + # Deny if it looks like the tourney has ended. if self._seconds_remaining == 0: bui.screenmessage( @@ -810,4 +807,4 @@ class TournamentEntryWindow(PopupWindow): def on_popup_cancel(self) -> None: bui.getsound('swish').play() - self._on_cancel() \ No newline at end of file + self._on_cancel()