def updateBubble(self):
     browserView = self.__getBrowserView()
     if browserView:
         return
     AccountSettings.setCounters(REFERRAL_COUNTER,
                                 self.getBubbleCount() + 1)
     self.__updateBubbleEvent()
コード例 #2
0
 def __onEntitlementEvent(self):
     currEventsCount = self.__rankedController.getEntitlementEvents()
     oldEventsCount = AccountSettings.getCounters(RANKED_ENTITLEMENT_EVENTS_AMOUNT)
     AccountSettings.setCounters(RANKED_ENTITLEMENT_EVENTS_AMOUNT, currEventsCount)
     if currEventsCount > oldEventsCount:
         AccountSettings.setCounters(RANKED_SHOP_COUNTER, 1)
         self.__resetCounters(self._selectedItemID)
         self.__updateCounters()
コード例 #3
0
 def setCounters(self, alias, count, isIncrement=False):
     if not self.__enabled:
         return
     counters = self.getCounters()
     if isIncrement:
         count = counters.get(alias, 0) + count
     counters[alias] = count if count >= 0 else 0
     AccountSettings.setCounters(CLAN_NOTIFICATION_COUNTERS, counters)
     self.onClanNotificationUpdated()
コード例 #4
0
 def __onYearAwardPointsUpdate(self):
     if not AccountSettings.getSettings(RANKED_AWARDS_BUBBLE_YEAR_REACHED):
         points = self.__rankedController.getYearRewardPoints()
         for minPoints, maxPoints in self.__rankedController.getYearAwardsPointsMap().itervalues():
             if maxPoints >= points >= minPoints:
                 AccountSettings.setCounters(RANKED_AWARDS_COUNTER, 1)
                 AccountSettings.setSettings(RANKED_AWARDS_BUBBLE_YEAR_REACHED, True)
                 self.__resetCounters(self._selectedItemID)
                 self.__updateCounters()
                 break
コード例 #5
0
 def __widgetWasShown(self, _):
     model = self._model()
     if model is None:
         return
     else:
         model.removeNotification(NOTIFICATION_TYPE.PROGRESSIVE_REWARD, ProgressiveRewardDecorator.ENTITY_ID)
         if self.__seniorityAwardsIsActive():
             AccountSettings.setCounters(SENIORITY_AWARDS_COUNTER, 1)
         else:
             AccountSettings.setNotifications(PROGRESSIVE_REWARD_VISITED, True)
         return
コード例 #6
0
 def _updateYearRewardCounters(self):
     isNeedUpdate = False
     if AccountSettings.getCounters(RANKED_AWARDS_COUNTER) > 0:
         AccountSettings.setCounters(RANKED_AWARDS_COUNTER, 0)
         isNeedUpdate = True
     if not AccountSettings.getSettings(RANKED_CURRENT_AWARDS_BUBBLE_YEAR_REACHED):
         AccountSettings.setSettings(RANKED_CURRENT_AWARDS_BUBBLE_YEAR_REACHED, True)
         isNeedUpdate = True
     if not AccountSettings.getSettings(RANKED_AWARDS_BUBBLE_YEAR_REACHED):
         AccountSettings.setSettings(RANKED_AWARDS_BUBBLE_YEAR_REACHED, True)
         isNeedUpdate = True
     if isNeedUpdate:
         self._updateCounters()
コード例 #7
0
 def __resetCounters(self, selectedItemID):
     if selectedItemID == RANKEDBATTLES_CONSTS.RANKED_BATTLES_REWARDS_ID:
         if AccountSettings.getCounters(RANKED_AWARDS_COUNTER) > 0:
             AccountSettings.setCounters(RANKED_AWARDS_COUNTER, 0)
     elif selectedItemID == RANKEDBATTLES_CONSTS.RANKED_BATTLES_INFO_ID:
         AccountSettings.setCounters(RANKED_INFO_COUNTER, 0)
     elif selectedItemID == RANKEDBATTLES_CONSTS.RANKED_BATTLES_YEAR_RATING_ID:
         AccountSettings.setCounters(RANKED_YEAR_RATING_COUNTER, 0)
     elif selectedItemID == RANKEDBATTLES_CONSTS.RANKED_BATTLES_SHOP_ID:
         AccountSettings.setCounters(RANKED_SHOP_COUNTER, 0)
     self.__updateCounters()
コード例 #8
0
    def __onYearAwardPointsUpdate(self):
        isNeedToReset = False
        if not AccountSettings.getSettings(RANKED_AWARDS_BUBBLE_YEAR_REACHED):
            completedYearQuest = self.__rankedController.getCompletedYearQuest(
            )
            receivedPoints = completedYearQuest.keys(
            )[0] if completedYearQuest else 0
            points = self.__rankedController.getYearRewardPoints(
            ) or receivedPoints
            for minPoints, maxPoints in self.__rankedController.getYearAwardsPointsMap(
            ).itervalues():
                if maxPoints >= points >= minPoints:
                    counter = self.__rankedController.getYearRewardCount() or 1
                    AccountSettings.setCounters(RANKED_AWARDS_COUNTER, counter)
                    isNeedToReset = True
                    break

        elif not AccountSettings.getSettings(
                RANKED_CURRENT_AWARDS_BUBBLE_YEAR_REACHED):
            counter = self.__rankedController.getYearRewardCount()
            AccountSettings.setCounters(RANKED_AWARDS_COUNTER, counter)
            isNeedToReset = True
        if isNeedToReset:
            self.__resetCounters(self._selectedItemID)
コード例 #9
0
def _setSettingsToStorage(value):
    AccountSettings.setCounters(NEW_HOF_COUNTER, value)
 def __resetBubbleCount(self):
     AccountSettings.setCounters(REFERRAL_COUNTER, 0)
     self.__updateBubbleEvent()
 def __resetBubbleCount(self):
     AccountSettings.setCounters(REFERRAL_COUNTER, 0)
     self.__uiSpamController.setVisited(REFERRAL_COUNTER)
     self.__updateBubbleEvent()
コード例 #12
0
 def resetCounters(self):
     AccountSettings.setCounters(CLAN_NOTIFICATION_COUNTERS, {})
     self.onClanNotificationUpdated()
コード例 #13
0
def storeLastSeenStep(vehicleIntCD, stepID):
    lastSeenSteps = AccountSettings.getCounters(VPP_ENTRY_POINT_LAST_SEEN_STEP)
    lastSeenSteps.update({vehicleIntCD: stepID})
    AccountSettings.setCounters(VPP_ENTRY_POINT_LAST_SEEN_STEP, lastSeenSteps)