mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-24 07:53:30 +08:00
preflight doing preflight things again
This commit is contained in:
parent
ddc00c764d
commit
3ca2f2b5c3
@ -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 = [
|
||||
{
|
||||
|
||||
@ -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()
|
||||
self._on_cancel()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user