def _on_achievements_press(self) -> None: from bastd.ui import achievements # only allow this for all-time or the current season # (we currently don't keep specific achievement data for old seasons) if self._season == 'a' or self._is_current_season: achievements.AchievementsWindow( position=(self._power_ranking_achievements_button. get_screen_space_center())) else: ba.screenmessage(ba.Lstr( resource='achievementsUnavailableForOldSeasonsText', fallback_resource='unavailableText'), color=(1, 0, 0)) ba.playsound(ba.getsound('error'))
def _on_achievements_press(self) -> None: # pylint: disable=cyclic-import from bastd.ui import achievements account_state = _ba.get_v1_account_state() account_type = (_ba.get_v1_account_type() if account_state == 'signed_in' else 'unknown') # for google play we use the built-in UI; otherwise pop up our own if account_type == 'Google Play': ba.timer(0.15, ba.Call(_ba.show_online_score_ui, 'achievements'), timetype=ba.TimeType.REAL) elif account_type != 'unknown': assert self._achievements_button is not None achievements.AchievementsWindow( position=self._achievements_button.get_screen_space_center()) else: print('ERROR: unknown account type in on_achievements_press:', account_type)