示例#1
0
 def setClubLadderChevron(self, club):
     ladderInfo = club.getLadderInfo()
     if ladderInfo.isInLadder():
         chevron = getLadderChevron256x256(ladderInfo.getDivision())
     else:
         chevron = getLadderChevron256x256()
     self.__data['ladderIconSource'] = chevron
 def setClubLadderChevron(self, club):
     ladderInfo = club.getLadderInfo()
     if ladderInfo.isInLadder():
         chevron = getLadderChevron256x256(ladderInfo.getDivision())
     else:
         chevron = getLadderChevron256x256()
     self.__data['ladderIconSource'] = chevron
示例#3
0
 def fillDefault(self):
     self.__data['ladderIconSource'] = getLadderChevron256x256()
     self.__data['isRequestWaitingTextVisible'] = True
     self.__data['requestWaitingText'] = text_styles.alert('#cybersport:window/intro/unavailableWaiting')
     self.setClubLabel(_ms(CYBERSPORT.WINDOW_INTRO_TEAM_HEADER_STATICTEAMS))
     self.setClubDescription(text_styles.error('#cybersport:window/intro/team/description/unavailable'), isBackVisible=True)
     self.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ASSEMBLETEAM), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_ASSEMBLETEAM, enabled=False)
示例#4
0
 def __setData(self, club):
     ladderInfo = club.getLadderInfo()
     seasonDossier = club.getSeasonDossier()
     totalStats = seasonDossier.getTotalStats()
     battlesNumData, winsPercentData, attackDamageEfficiency, defenceDamageEfficiency = _makeStats(
         totalStats)
     battleCounts = totalStats.getBattlesCount()
     ladderIconSource = getLadderChevron256x256(
         ladderInfo.getDivision() if battleCounts else None)
     globalStats = seasonDossier.getGlobalStats()
     registeredDate = text_styles.main(
         BigWorld.wg_getShortDateFormat(club.getCreationTime()))
     registeredText = text_styles.standard(
         _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_REGISTERED,
             date=registeredDate))
     lastBattleText = _getLastBattleText(battleCounts, globalStats)
     bestTanksText = text_styles.stats(
         CYBERSPORT.STATICFORMATIONSUMMARYVIEW_BESTTANKS)
     bestMapsText = text_styles.stats(
         CYBERSPORT.STATICFORMATIONSUMMARYVIEW_BESTMAPS)
     notEnoughTanksText = notEnoughMapsText = text_styles.standard(
         CYBERSPORT.STATICFORMATIONSUMMARYVIEW_NOTENOUGHTANKSMAPS)
     bestTanks = _getVehiclesList(totalStats)
     bestMaps = _getMapsList(totalStats)
     noAwardsText = text_styles.stats(
         CYBERSPORT.STATICFORMATIONSUMMARYVIEW_NOAWARDS)
     ribbonSource = RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_RIBBON
     self.as_setDataS({
         'clubId': club.getClubDbID(),
         'placeText': _getPositionText(ladderInfo),
         'leagueDivisionText': _getDivisionText(ladderInfo),
         'ladderPtsText': _getLadderPointsText(ladderInfo),
         'bestTanksText': bestTanksText,
         'bestMapsText': bestMapsText,
         'notEnoughTanksText': notEnoughTanksText,
         'notEnoughMapsText': notEnoughMapsText,
         'registeredText': registeredText,
         'lastBattleText': lastBattleText,
         'ladderIconSource': ladderIconSource,
         'noAwardsText': noAwardsText,
         'ribbonSource': ribbonSource,
         'battlesNumData': battlesNumData,
         'winsPercentData': winsPercentData,
         'attackDamageEfficiencyData': attackDamageEfficiency,
         'defenceDamageEfficiencyData': defenceDamageEfficiency,
         'bestTanks': bestTanks,
         'notEnoughTanksTFVisible': not len(bestTanks),
         'bestMaps': bestMaps,
         'notEnoughMapsTFVisible': not len(bestMaps),
         'achievements': _makeAchievements(seasonDossier),
         'bestTanksGroupWidth': BEST_TANKS_GROUP_WIDTH,
         'bestMapsGroupWidth': BEST_MAPS_GROUP_WIDTH
     })
     return
 def fillDefault(self):
     self.__data['ladderIconSource'] = getLadderChevron256x256()
     self.__data['isRequestWaitingTextVisible'] = True
     self.__data['requestWaitingText'] = text_styles.alert(
         '#cybersport:window/intro/unavailableWaiting')
     self.setClubLabel(_ms(CYBERSPORT.WINDOW_INTRO_TEAM_HEADER_STATICTEAMS))
     self.setClubDescription(text_styles.error(
         '#cybersport:window/intro/team/description/unavailable'),
                             isBackVisible=True)
     self.showCreateButton(_ms(
         CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ASSEMBLETEAM),
                           TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_ASSEMBLETEAM,
                           enabled=False)
示例#6
0
 def __setData(self, club):
     ladderInfo = club.getLadderInfo()
     seasonDossier = club.getSeasonDossier()
     totalStats = seasonDossier.getTotalStats()
     battlesNumData, winsPercentData, attackDamageEfficiency, defenceDamageEfficiency = _makeStats(totalStats)
     battleCounts = totalStats.getBattlesCount()
     ladderIconSource = getLadderChevron256x256(ladderInfo.getDivision() if battleCounts else None)
     globalStats = seasonDossier.getGlobalStats()
     registeredDate = text_styles.main(BigWorld.wg_getShortDateFormat(club.getCreationTime()))
     registeredText = text_styles.standard(
         _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_REGISTERED, date=registeredDate)
     )
     lastBattleText = _getLastBattleText(battleCounts, globalStats)
     bestTanksText = text_styles.stats(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_BESTTANKS)
     bestMapsText = text_styles.stats(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_BESTMAPS)
     notEnoughTanksText = notEnoughMapsText = text_styles.standard(
         CYBERSPORT.STATICFORMATIONSUMMARYVIEW_NOTENOUGHTANKSMAPS
     )
     bestTanks = _getVehiclesList(totalStats)
     bestMaps = _getMapsList(totalStats)
     noAwardsText = text_styles.stats(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_NOAWARDS)
     ribbonSource = RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_RIBBON
     self.as_setDataS(
         {
             "clubId": club.getClubDbID(),
             "placeText": _getPositionText(ladderInfo),
             "leagueDivisionText": _getDivisionText(ladderInfo),
             "ladderPtsText": _getLadderPointsText(ladderInfo),
             "bestTanksText": bestTanksText,
             "bestMapsText": bestMapsText,
             "notEnoughTanksText": notEnoughTanksText,
             "notEnoughMapsText": notEnoughMapsText,
             "registeredText": registeredText,
             "lastBattleText": lastBattleText,
             "ladderIconSource": ladderIconSource,
             "noAwardsText": noAwardsText,
             "ribbonSource": ribbonSource,
             "battlesNumData": battlesNumData,
             "winsPercentData": winsPercentData,
             "attackDamageEfficiencyData": attackDamageEfficiency,
             "defenceDamageEfficiencyData": defenceDamageEfficiency,
             "bestTanks": bestTanks,
             "notEnoughTanksTFVisible": not len(bestTanks),
             "bestMaps": bestMaps,
             "notEnoughMapsTFVisible": not len(bestMaps),
             "achievements": _makeAchievements(seasonDossier),
             "bestTanksGroupWidth": BEST_TANKS_GROUP_WIDTH,
             "bestMapsGroupWidth": BEST_MAPS_GROUP_WIDTH,
         }
     )
     return
 def __packLadderState(self, club):
     hasBattlesInSeason = club.wasInRatedBattleThisSeason() and self._hasLadderInfo
     if not isSeasonInProgress():
         title = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERSTATUS_NOSEASON
         message = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERMSG_NOSEASON
     elif not hasBattlesInSeason:
         title = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERSTATUS_NOBATTLES
         message = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERMSG_NOBATTLES
     else:
         title = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERSTATUS_INLADDER
         message = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERMSG_INLADDER
     return {'showStateMessage': not hasBattlesInSeason,
      'stateMessage': {'title': text_styles.middleTitle(title),
                       'message': text_styles.main(message),
                       'iconPath': getLadderChevron256x256()}}
示例#8
0
 def __packLadderState(self, club):
     hasBattlesInSeason = club.wasInRatedBattleThisSeason(
     ) and self._hasLadderInfo
     if not isSeasonInProgress():
         title = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERSTATUS_NOSEASON
         message = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERMSG_NOSEASON
     elif not hasBattlesInSeason:
         title = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERSTATUS_NOBATTLES
         message = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERMSG_NOBATTLES
     else:
         title = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERSTATUS_INLADDER
         message = CYBERSPORT.STATICFORMATION_LADDERVIEW_LADDERMSG_INLADDER
     return {
         'showStateMessage': not hasBattlesInSeason,
         'stateMessage': {
             'title': text_styles.middleTitle(title),
             'message': text_styles.main(message),
             'iconPath': getLadderChevron256x256()
         }
     }