def __updateHeader(self): event = self.__eventData name = event.getName() eType = event.getType() leaderboard = self.__leaderboard leaderboardValue = event.getLeaderboard(self.__leaderboardID) if event.isFinished(): date = BigWorld.wg_getLongDateFormat(event.getEndDateTs()) status = text_styles.main( _ms(EVENT_BOARDS.TIME_EVENTFINISHED, date=date)) statusTooltip = None elif leaderboard: recalculationTS = leaderboard.getLastLeaderboardRecalculationTS() recalculationInterval = leaderboard.getRecalculationInterval() interval = int(recalculationInterval / ONE_MINUTE) status = text_styles.main(formatUpdateTime(recalculationTS)) statusTooltip = _ms(TOOLTIPS.SUMMARY_STATUS_TOOLTIP, interval=interval) else: status = None statusTooltip = None self.as_setHeaderDataS( makeTableViewHeaderVO(eType, leaderboardValue, name, status, statusTooltip)) return
def getStatusData(self): event = self._event playerData = self._playerData anyTops = any(self.topInfos) title = '' registrationTooltip = '' description1 = '' description2 = '' isRegistration = self.isRegistration() isRegistrationButtonEnabled = True isRegistrationTop = False started = self._event.isStarted() titleTooltip = None buttonRegistrationLabel = '' description1Tooltip = '' description2Tooltip = '' if event.isFinished() and not anyTops: title = text_styles.main(EVENT_BOARDS.STATUS_PARTICIPATE_NOTPARTICIPATED) elif self._joined: title = text_styles.highTitle(EVENT_BOARDS.STATUS_BESTRESULTS_MANY) if self._topMeta: recalculationTS = self._topMeta.getLastLeaderboardRecalculationTS() if recalculationTS is not None: if not event.isFinished(): description1 = text_styles.standard(formatUpdateTime(recalculationTS)) recalculationInterval = self._topMeta.getRecalculationInterval() if recalculationInterval is not None: interval = int(recalculationInterval / ONE_MINUTE) description1Tooltip = makeTooltip(_ms(TOOLTIPS.SUMMARY_STATUS_TOOLTIP, interval=interval)) if not anyTops: description2 = formatAttentionTextWithIcon(text_styles.neutral(EVENT_BOARDS.STATUS_PARTICIPATE_NEEDMOREBATTLES)) elif not self._canJoin: title, titleTooltip, isRegistration = makeCantJoinReasonTextVO(event, playerData) if _psr.SPECIALACCOUNT in self._stateReasons or _psr.WASUNREGISTERED in self._stateReasons: title = '' titleTooltip = None buttonRegistrationLabel = EVENT_BOARDS.EXCEL_PARTICIPATE_JOIN isRegistrationButtonEnabled = False else: isRegistrationTop = True if started: buttonRegistrationLabel = EVENT_BOARDS.EXCEL_PARTICIPATE_JOIN registrationTooltip = TOOLTIPS.ELEN_BUTTON_REGISTRATION_STARTED else: buttonRegistrationLabel = EVENT_BOARDS.TABLE_SELECTREGISTRATIONBTN registrationTooltip = TOOLTIPS.ELEN_BUTTON_REGISTRATION_NOTSTARTED return {'title': title, 'description1': description1, 'description2': description2, 'isRegistrationTop': isRegistrationTop, 'isRegistration': isRegistration, 'isRegistrationEnabled': isRegistrationButtonEnabled, 'registrationTooltip': registrationTooltip, 'titleTooltip': titleTooltip, 'ratingTooltip': makeTooltip(TOOLTIPS.ELEN_BUTTON_RAITING_HEADER, TOOLTIPS.ELEN_BUTTON_RAITING_BODY), 'isRating': started, 'buttonRegistrationLabel': buttonRegistrationLabel, 'description1Tooltip': description1Tooltip, 'description2Tooltip': description2Tooltip}
def getHeader(self): recalculationTS = self._leaderboard.getLastLeaderboardRecalculationTS() status = formatUpdateTime( recalculationTS) if not self._event.isFinished() else '' title = getFullName(self._excelItem.getName(), self._excelItem.getClanTag(), self._excelItem.getClanColor()) return { 'title': title, 'description': self._getDescription(), 'description2': self._getDescription2(), 'status': status, 'isTable': self.isTable(), 'isSquad': self._event.getIsSquadAllowed(), 'statusTooltip': self._getStatusTooltip() if not self._event.isFinished() else '' }