From 0dbec6ffa4866a9b9dea38e1f0c5203d62256d39 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Mon, 13 Apr 2020 21:03:10 -0700 Subject: [PATCH] Fixed a timing issue with final cymbal on coop score screen --- assets/src/ba_data/python/bastd/activity/coopscorescreen.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/src/ba_data/python/bastd/activity/coopscorescreen.py b/assets/src/ba_data/python/bastd/activity/coopscorescreen.py index a1ed3fa2..b2cfc2b0 100644 --- a/assets/src/ba_data/python/bastd/activity/coopscorescreen.py +++ b/assets/src/ba_data/python/bastd/activity/coopscorescreen.py @@ -144,7 +144,7 @@ class CoopScoreScreen(ba.Activity): self._fail_message: Optional[ba.Lstr] = settings['fail_message'] assert isinstance(self._fail_message, (ba.Lstr, type(None))) - self._begin_time = ba.time() + self._begin_time: Optional[float] = None self._score_order: str if 'score_order' in settings: @@ -517,6 +517,8 @@ class CoopScoreScreen(ba.Activity): # pylint: disable=too-many-locals super().on_begin() + self._begin_time = ba.time() + # Calc whether the level is complete and other stuff. levels = self._campaign.get_levels() level = self._campaign.get_level(self._level_name) @@ -891,6 +893,7 @@ class CoopScoreScreen(ba.Activity): # pylint: disable=too-many-branches # pylint: disable=too-many-statements # delay a bit if results come in too fast + assert self._begin_time is not None base_delay = max(0, 1.9 - (ba.time() - self._begin_time)) ts_height = 300 ts_h_offs = -550 @@ -1011,6 +1014,7 @@ class CoopScoreScreen(ba.Activity): return with ba.Context(self): # Delay a bit if results come in too fast. + assert self._begin_time is not None base_delay = max(0, 2.7 - (ba.time() - self._begin_time)) v_offs = 20 if results is None: