def __updateCounters(self): awardsCounter = main_page_vos.getBubbleLabel( AccountSettings.getCounters(RANKED_AWARDS_COUNTER)) infoCounter = main_page_vos.getBubbleLabel( AccountSettings.getCounters(RANKED_INFO_COUNTER)) yearRatingCounter = main_page_vos.getBubbleLabel( AccountSettings.getCounters(RANKED_YEAR_RATING_COUNTER)) shopCounter = main_page_vos.getBubbleLabel( AccountSettings.getCounters(RANKED_SHOP_COUNTER)) self.as_setCountersS( main_page_vos.getCountersData(self.__rankedController, awardsCounter, infoCounter, yearRatingCounter, shopCounter))
def getCountersInfo(self, cmd): ids = cmd.id_list or _COUNTER_IDS_MAP.keys() counters = AccountSettings.getCounters(NEW_LOBBY_TAB_COUNTER) return { id: counters.get(_COUNTER_IDS_MAP[id]) for id in ids if id in _COUNTER_IDS_MAP }
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 needToShowCounter(vehicle): showCounter = False if vehicle.xp > 0 and vehicle.postProgressionAvailability(unlockOnly=True).result: purchasableStep = vehicle.postProgression.getFirstPurchasableStep(ExtendedMoney(xp=vehicle.xp)) if purchasableStep is not None: lastSeenSteps = AccountSettings.getCounters(VPP_ENTRY_POINT_LAST_SEEN_STEP) showCounter = lastSeenSteps.get(vehicle.intCD, None) != purchasableStep.stepID return showCounter
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 _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 __update(self): model = self._model() if model is None: return else: model.removeNotificationsByType(NOTIFICATION_TYPE.PROGRESSIVE_REWARD) wasVisited = AccountSettings.getNotifications(PROGRESSIVE_REWARD_VISITED) if self.__seniorityAwardsIsActive(): wasVisited = wasVisited and AccountSettings.getCounters(SENIORITY_AWARDS_COUNTER) if wasVisited: return progressiveConfig = self.__lobbyContext.getServerSettings().getProgressiveRewardConfig() if not progressiveConfig.isEnabled or self.__bootcampController.isInBootcamp(): return model.addNotification(ProgressiveRewardDecorator()) return
def _getSettingsFromStorage(): return AccountSettings.getCounters(NEW_HOF_COUNTER)
def getBubbleCount(self): return AccountSettings.getCounters(REFERRAL_COUNTER)
def getBubbleCount(self): count = AccountSettings.getCounters(REFERRAL_COUNTER) return 0 if count and self.__uiSpamController.shouldBeHidden( REFERRAL_COUNTER) and not self.isFirstIndication() else count
def getCounters(self, aliases=None): counters = AccountSettings.getCounters(CLAN_NOTIFICATION_COUNTERS) return counters if not aliases else { elem: counters.get(elem, 0) for elem in aliases }
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)
def _updateCounters(self): self.as_setCountersS([{'componentId': _RBC.RANKED_BATTLES_REWARDS_YEAR_ID, 'count': main_page_vos.getBubbleLabel(AccountSettings.getCounters(RANKED_AWARDS_COUNTER))}])
def _populate(self): super(RankedBattlesRewardsView, self)._populate() self.__rankedController.onUpdated += self._update self.setActiveTab() self.as_setCountersS([{'componentId': _RBC.RANKED_BATTLES_REWARDS_YEAR_ID, 'count': main_page_vos.getBubbleLabel(AccountSettings.getCounters(RANKED_AWARDS_COUNTER))}])