Exemple #1
0
    def announceCompletion(self, sound=True):

        # even though there are technically achievements when we're not signed in,
        # lets not show them (otherwise we tend to get confusing 'controller connected'
        # achievements popping up while waiting to log in which can be confusing..
        if bsInternal._getAccountState() != 'SIGNED_IN':
            return

        # if we're being freshly complete, display/report it and whatnot
        if not [self, sound] in gAchievementsToDisplay:
            gAchievementsToDisplay.append([self, sound])

        # if there's no achievement display timer going, kick one off
        # (if one's already running it will pick this up before it dies)
        global gAchievementDisplayTimer
        global gLastAchievementDisplayTime
        # need to check last time too; its possible our timer wasn't able to clear itself if an
        # activity died and took it down with it..
        if ((gAchievementDisplayTimer is None
             or bs.getRealTime() - gLastAchievementDisplayTime > 2000)
                and bs.getActivity(exceptionOnNone=False) is not None):
            gAchievementDisplayTimer = bs.Timer(1000,
                                                _displayNextAchievement,
                                                repeat=True,
                                                timeType='net')
            _displayNextAchievement()  # show the first immediately
Exemple #2
0
 def _generatePress(self):
     if bsInternal._getAccountState() != 'SIGNED_IN':
         bsUI.showSignInPrompt()
         return
     bs.screenMessage(
         bs.Lstr(resource='gatherWindow.requestingAPromoCodeText'),
         color=(0, 1, 0))
     bsInternal._addTransaction({
         'type': 'ACCOUNT_LINK_CODE_REQUEST',
         'expireTime': time.time() + 5
     })
     bsInternal._runTransactions()
Exemple #3
0
 def _tryFetchingNews(self):
     if bsInternal._getAccountState() == 'SIGNED_IN':
         self._fetchNews()
         self._fetchTimer = None