Пример #1
0
 def __getDescriptionTooltip(self):
     category = self.__rewardByRank.getRewardCategoryNumber(self._top.getMyPosition())
     if category is not None:
         return
     else:
         method = self._event.getMethod()
         amount = self._top.getLastInLeaderboardValue()
         parameter = self._event.getObjectiveParameter()
         return makeParameterTooltipVO(method, amount, parameter)
Пример #2
0
 def __getRibbonTooltip(self):
     category = self.__rewardByRank.getRewardCategoryNumber(self._top.getMyPosition())
     if category:
         minimum, maximum = self.__rewardByRank.getCategoryMinMax(category)
         return makeTooltip(body=_ms(EVENT_BOARDS.TOOLTIP_TOP_REWARDGROUP, group=int2roman(category), min=minimum, max=maximum))
     method = self._event.getMethod()
     amount = self._top.getLastInLeaderboardValue()
     parameter = self._event.getObjectiveParameter()
     return makeParameterTooltipVO(method, amount, parameter)
Пример #3
0
 def __updateStatus(self):
     event = self.__eventData
     playerState = self.__playerState
     myInfo = self.__myInfo
     state = playerState.getPlayerState() if playerState else None
     canJoin = playerState.getCanJoin() if playerState else True
     stateReasons = playerState.getPlayerStateReasons(
     ) if playerState else []
     joined = state is _es.JOINED
     cardinality = event.getCardinality()
     battleCount = myInfo.battlesCount if myInfo else 0
     notFull = cardinality is not None and battleCount < cardinality
     outOfScore = not myInfo.fullData.getIsInsideViewsize(
     ) if myInfo else False
     visible = True
     title = ''
     tooltip = None
     showPoints = False
     titleTooltip = None
     buttonVisible = False
     buttonEnabled = False
     buttonLabel = TOOLTIPS.ELEN_BUTTON_REGISTRATION_STARTED_HEADER
     buttonTooltip = makeTooltip(
         buttonLabel, TOOLTIPS.ELEN_BUTTON_REGISTRATION_STARTED_BODY)
     method = event.getMethod()
     if event.isFinished():
         if not joined:
             title = getStatusTitleStyle(
                 _ms(EVENT_BOARDS.EXCEL_PARTICIPATE_NOTPARTICIPATED))
         elif notFull:
             title = getStatusTitleStyle(
                 _ms(EVENT_BOARDS.EXCEL_PARTICIPATE_NOTPARTICIPATED))
         elif outOfScore:
             showPoints = True
             title = getStatusTitleStyle(
                 _ms(EVENT_BOARDS.STATUS_CANTJOIN_REASON_OUTOFRATING))
         else:
             visible = False
     elif joined:
         if notFull:
             showPoints = True
             count = getStatusCountStyle(str(cardinality - battleCount))
             title = getStatusTitleStyle(
                 _ms(EVENT_BOARDS.EXCEL_HEADER_REASON_BATTLESLEFT,
                     number=count))
         elif outOfScore:
             showPoints = True
             title = getStatusTitleStyle(
                 _ms(EVENT_BOARDS.STATUS_CANTJOIN_REASON_OUTOFRATING))
         else:
             visible = False
     elif event.isRegistrationFinished():
         title = formatErrorTextWithIcon(
             EVENT_BOARDS.STATUS_CANTJOIN_REASON_ENDREGISTRATION)
         tooltip = makeTooltip(
             EVENT_BOARDS.STATUS_CANTJOIN_REASON_ENDREGISTRATION,
             EVENT_BOARDS.STATUS_CANTJOIN_REASON_ENDREGISTRATION_TOOLTIP)
     elif canJoin:
         buttonVisible = _psr.SPECIALACCOUNT not in stateReasons
         buttonEnabled = True
     else:
         title, tooltip, buttonVisible = makeCantJoinReasonTextVO(
             event, self.__playerData)
     if joined and outOfScore and notFull and not event.isFinished():
         amount = myInfo.fullData.getLastInLeaderboardValue()
         parameter = event.getObjectiveParameter()
         titleTooltip = makeParameterTooltipVO(method, amount, parameter)
     playerName = getattr(BigWorld.player(), 'name', '')
     playerName = getFullName(playerName, myInfo.fullData.getClanTag(),
                              myInfo.fullData.getClanColor())
     myPosition = self.__myInfo.rank
     self.as_setStatusVisibleS(visible)
     self.as_setMyPlaceVisibleS(not visible and myPosition is not None)
     if visible:
         p1 = myInfo.fullData.getP1()
         p2 = myInfo.fullData.getP2()
         p3 = myInfo.fullData.getP3()
         self.as_setStatusDataS(
             makeEventBoardsTableViewStatusVO(title, tooltip, playerName,
                                              p1, p2, p3, showPoints,
                                              buttonLabel, buttonTooltip,
                                              buttonVisible, buttonEnabled,
                                              titleTooltip, method))
     return