def updateBubble(self): browserView = self.__getBrowserView() if browserView: return AccountSettings.setCounters(REFERRAL_COUNTER, self.getBubbleCount() + 1) self.__updateBubbleEvent()
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()
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()
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
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
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()
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()
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)
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()
def resetCounters(self): AccountSettings.setCounters(CLAN_NOTIFICATION_COUNTERS, {}) self.onClanNotificationUpdated()
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)