preflight doing preflight things again

This commit is contained in:
TrialTemp 2024-01-09 12:47:52 -06:00
parent ddc00c764d
commit 3ca2f2b5c3
2 changed files with 20 additions and 23 deletions

View File

@ -347,8 +347,8 @@ class CoopSession(Session):
if not (env.demo or env.arcade): if not (env.demo or env.arcade):
if ( if (
self.tournament_id is not None and self.tournament_id is not None
activity.session._submit_score and activity.session._submit_score
): ):
self._custom_menu_ui = [ self._custom_menu_ui = [
{ {

View File

@ -88,13 +88,13 @@ class TournamentEntryWindow(PopupWindow):
# Show the practice button as long as we're not # Show the practice button as long as we're not
# restarting while on a paid tournament run. # restarting while on a paid tournament run.
from bascenev1lib.activity.coopscore import CoopScoreScreen from bascenev1lib.activity.coopscore import CoopScoreScreen
self._do_practice = (
self._tournament_activity is None or self._do_practice = self._tournament_activity is None or isinstance(
isinstance(self._tournament_activity, CoopScoreScreen) self._tournament_activity, CoopScoreScreen
) )
off_p = 0 if not self._do_practice else 48 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. # Creates our root_widget.
super().__init__( super().__init__(
@ -260,10 +260,7 @@ class TournamentEntryWindow(PopupWindow):
self._pay_with_ad_btn = None self._pay_with_ad_btn = None
btn_size = (150, 45) btn_size = (150, 45)
btn_pos = ( btn_pos = (self._width / 2 - btn_size[0] / 2, self._width / 2 - 110)
self._width / 2 - btn_size[0]/2,
self._width / 2 - 110
)
if self._do_practice: if self._do_practice:
self._practice_button = bui.buttonwidget( self._practice_button = bui.buttonwidget(
parent=self.root_widget, parent=self.root_widget,
@ -553,7 +550,7 @@ class TournamentEntryWindow(PopupWindow):
text=bui.charstr(bui.SpecialChar.TICKET) + t_str, 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 assert bui.app.classic is not None
if self._launched: if self._launched:
return return
@ -563,22 +560,22 @@ class TournamentEntryWindow(PopupWindow):
# If they gave us an existing, non-consistent # If they gave us an existing, non-consistent
# practice activity, just restart it. # practice activity, just restart it.
if ( if (
self._tournament_activity is not None and self._tournament_activity is not None
not practice == self._tournament_activity.session._submit_score and not practice == self._tournament_activity.session._submit_score
): ):
try: try:
if not practice: if not practice:
bui.apptimer(0.1, bui.getsound('cashRegister').play) bui.apptimer(0.1, bui.getsound('cashRegister').play)
bui.screenmessage( bui.screenmessage(
bui.Lstr( bui.Lstr(
translate=('serverResponses', 'Entering tournament...') translate=(
'serverResponses',
'Entering tournament...',
)
), ),
color=(0, 1, 0), color=(0, 1, 0),
) )
bui.apptimer( bui.apptimer(0 if practice else 0.3, self._transition_out)
0 if practice else 0.3,
self._transition_out
)
launched = True launched = True
with self._tournament_activity.context: with self._tournament_activity.context:
self._tournament_activity.end( self._tournament_activity.end(