Beispiel #1
0
def _getDivisionText(ladderInfo):
    if ladderInfo.isInLadder():
        leagueStr = text_styles.warning(getLeagueString(ladderInfo.getLeague()))
        divisionStr = text_styles.warning(getDivisionString(ladderInfo.division))
        return text_styles.middleTitle(_ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_LADDER_LEAGUEDIVISION, league=leagueStr, division=divisionStr))
    else:
        return text_styles.alert(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_NOTENOUGHGAMES_WARNING)
Beispiel #2
0
def getLadderChevronIconName(division=None):
    from gui.clubs.formatters import getDivisionString
    if division is not None:
        return '%d%s' % (getLeagueByDivision(division) + 1,
                         getDivisionString(division))
    else:
        return 'no_ladder'
Beispiel #3
0
def getLadderChevronIconName(division = None):
    from gui.clubs.formatters import getDivisionString
    if division is not None:
        return '%d%s' % (getLeagueByDivision(division) + 1, getDivisionString(division))
    else:
        return 'no_ladder'
        return
Beispiel #4
0
def _getLadderChevronIcon(iconSize, division = None):
    from gui.clubs.formatters import getDivisionString
    if division is not None:
        imgFileName = '%d%s' % (getLeagueByDivision(division) + 1, getDivisionString(division))
    else:
        imgFileName = 'no_ladder'
    return '%s/%d/%s.png' % (LADDER_CHEVRON_ICON_PATH, iconSize, imgFileName)
 def __getDivisionText(self, ladderInfo):
     if ladderInfo.isInLadder():
         divisionStr = getDivisionString(ladderInfo.division)
         leagueStr = getLeagueString(ladderInfo.getLeague())
         return text_styles.highTitle(
             _ms(CYBERSPORT.STATICFORMATION_LADDERVIEW_DIVISIONNAME_TEXT,
                 division=divisionStr,
                 league=leagueStr))
     return ''
Beispiel #6
0
 def getVO(self, club = None, currentState = None, profile = None):
     if club is None or currentState is None or profile is None:
         return
     else:
         _ms = i18n.makeString
         ladderInfo = club.getLadderInfo()
         if ladderInfo.isInLadder():
             ladderLeagueStr = getLeagueString(ladderInfo.getLeague())
             ladderDivStr = getDivisionString(ladderInfo.getDivision())
             ladderInfoStr = text_styles.middleTitle(_ms(CYBERSPORT.WINDOW_STATICRALLYINFO_LADDERINFO, league=ladderLeagueStr, division=ladderDivStr))
         else:
             ladderInfoStr = ''
         dossier = club.getTotalDossier()
         clubTotalStats = dossier.getTotalStats()
         isButtonDisabled = False
         buttonLabel = '#cyberSport:window/staticRallyInfo/joinBtnLabel'
         buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/join'
         buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/join'
         limits = currentState.getLimits()
         canSendApp, appReason = limits.canSendApplication(profile, club)
         if currentState.getStateID() == CLIENT_CLUB_STATE.SENT_APP:
             if currentState.getClubDbID() == club.getClubDbID():
                 buttonLabel = '#cyberSport:window/staticRallyInfo/cancelBtnLabel'
                 buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/inProcess'
                 buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/inProcess'
             else:
                 isButtonDisabled = True
                 buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/inProcessOther'
                 buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/inProcessOther'
         elif currentState.getStateID() == CLIENT_CLUB_STATE.HAS_CLUB:
             isButtonDisabled = True
             buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/alreadyJoined'
             buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/alreadyJoined'
         elif not canSendApp:
             isButtonDisabled = True
             buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/applicationCooldown'
             buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/applicationCooldown'
         return {'battlesCount': self.__getIndicatorData(clubTotalStats.getBattlesCount(), BigWorld.wg_getIntegralFormat, _ms(CYBERSPORT.WINDOW_STATICRALLYINFO_STATSBATTLESCOUNT), RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_BATTLES40X32, TOOLTIPS.CYBERSPORT_STATICRALLYINFO_STATSBATTLESCOUNT),
          'winsPercent': self.__getIndicatorData(clubTotalStats.getWinsEfficiency(), ProfileUtils.formatFloatPercent, _ms(CYBERSPORT.WINDOW_STATICRALLYINFO_STATICRALLY_STATSWINSPERCENT), RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_WINS40X32, TOOLTIPS.CYBERSPORT_STATICRALLYINFO_STATSWINSPERCENT),
          'ladderIcon': getLadderChevron128x128(ladderInfo.getDivision()),
          'ladderInfo': ladderInfoStr,
          'joinInfo': text_styles.main(_ms(buttonInfo)),
          'joinBtnLabel': _ms(buttonLabel),
          'joinBtnTooltip': buttonTooltip,
          'joinBtnDisabled': isButtonDisabled,
          'noAwardsText': CYBERSPORT.WINDOW_STATICRALLYINFO_NOAWARDS,
          'achievements': AchievementsUtils.packAchievementList(clubTotalStats.getTopAchievements(3), dossier.getDossierType(), dumpDossier(dossier), False, False),
          'rallyInfo': {'icon': None,
                        'name': text_styles.highTitle(club.getUserName()),
                        'profileBtnLabel': CYBERSPORT.RALLYINFO_PROFILEBTN_LABEL,
                        'profileBtnTooltip': TOOLTIPS.RALLYINFO_PROFILEBTN,
                        'description': text_styles.main(html.escape(club.getUserShortDescription())),
                        'ladderIcon': None,
                        'id': club.getClubDbID(),
                        'showLadder': False}}
Beispiel #7
0
 def getVO(self, club = None, currentState = None, profile = None):
     if club is None or currentState is None or profile is None:
         return
     else:
         _ms = i18n.makeString
         ladderInfo = club.getLadderInfo()
         if ladderInfo.isInLadder():
             ladderLeagueStr = getLeagueString(ladderInfo.getLeague())
             ladderDivStr = getDivisionString(ladderInfo.getDivision())
             ladderInfoStr = text_styles.middleTitle(_ms(CYBERSPORT.WINDOW_STATICRALLYINFO_LADDERINFO, league=ladderLeagueStr, division=ladderDivStr))
         else:
             ladderInfoStr = ''
         dossier = club.getTotalDossier()
         clubTotalStats = dossier.getTotalStats()
         isButtonDisabled = False
         buttonLabel = '#cyberSport:window/staticRallyInfo/joinBtnLabel'
         buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/join'
         buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/join'
         limits = currentState.getLimits()
         canSendApp, appReason = limits.canSendApplication(profile, club)
         if currentState.getStateID() == CLIENT_CLUB_STATE.SENT_APP:
             if currentState.getClubDbID() == club.getClubDbID():
                 buttonLabel = '#cyberSport:window/staticRallyInfo/cancelBtnLabel'
                 buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/inProcess'
                 buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/inProcess'
             else:
                 isButtonDisabled = True
                 buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/inProcessOther'
                 buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/inProcessOther'
         elif currentState.getStateID() == CLIENT_CLUB_STATE.HAS_CLUB:
             isButtonDisabled = True
             buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/alreadyJoined'
             buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/alreadyJoined'
         elif not canSendApp:
             isButtonDisabled = True
             buttonTooltip = '#tooltips:cyberSport/staticRallyInfo/joinBtn/applicationCooldown'
             buttonInfo = '#cyberSport:window/staticRallyInfo/joinInfo/applicationCooldown'
         return {'battlesCount': self.__getIndicatorData(clubTotalStats.getBattlesCount(), BigWorld.wg_getIntegralFormat, _ms(CYBERSPORT.WINDOW_STATICRALLYINFO_STATSBATTLESCOUNT), RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_BATTLES40X32, TOOLTIPS.CYBERSPORT_STATICRALLYINFO_STATSBATTLESCOUNT),
          'winsPercent': self.__getIndicatorData(clubTotalStats.getWinsEfficiency(), ProfileUtils.formatFloatPercent, _ms(CYBERSPORT.WINDOW_STATICRALLYINFO_STATICRALLY_STATSWINSPERCENT), RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_WINS40X32, TOOLTIPS.CYBERSPORT_STATICRALLYINFO_STATSWINSPERCENT),
          'ladderIcon': getLadderChevron128x128(ladderInfo.getDivision()),
          'ladderInfo': ladderInfoStr,
          'joinInfo': text_styles.main(_ms(buttonInfo)),
          'joinBtnLabel': _ms(buttonLabel),
          'joinBtnTooltip': buttonTooltip,
          'joinBtnDisabled': isButtonDisabled,
          'noAwardsText': CYBERSPORT.WINDOW_STATICRALLYINFO_NOAWARDS,
          'achievements': AchievementsUtils.packAchievementList(clubTotalStats.getTopAchievements(3), dossier.getDossierType(), dumpDossier(dossier), False, False),
          'rallyInfo': {'icon': None,
                        'name': text_styles.highTitle(club.getUserName()),
                        'profileBtnLabel': CYBERSPORT.RALLYINFO_PROFILEBTN_LABEL,
                        'profileBtnTooltip': TOOLTIPS.RALLYINFO_PROFILEBTN,
                        'description': text_styles.main(html.escape(club.getUserShortDescription())),
                        'ladderIcon': None,
                        'id': club.getClubDbID(),
                        'showLadder': False}}
def _getDivisionText(ladderInfo):
    if ladderInfo.isInLadder():
        leagueStr = text_styles.warning(getLeagueString(
            ladderInfo.getLeague()))
        divisionStr = text_styles.warning(
            getDivisionString(ladderInfo.division))
        return text_styles.middleTitle(
            _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_LADDER_LEAGUEDIVISION,
                league=leagueStr,
                division=divisionStr))
    else:
        return text_styles.alert(
            CYBERSPORT.STATICFORMATIONSUMMARYVIEW_NOTENOUGHGAMES_WARNING)
Beispiel #9
0
def getAnimationDivisionIcon(league, division):
    return '../maps/icons/library/cybersport/animation/division/%s%s.png' % (getLeagueString(league), getDivisionString(division).lower())
 def __getDivisionText(self, ladderInfo):
     if ladderInfo.isInLadder():
         divisionStr = getDivisionString(ladderInfo.division)
         leagueStr = getLeagueString(ladderInfo.getLeague())
         return text_styles.highTitle(_ms(CYBERSPORT.STATICFORMATION_LADDERVIEW_DIVISIONNAME_TEXT, division=divisionStr, league=leagueStr))
     return ''
Beispiel #11
0
 def getDivisionString(self):
     return club_fmts.getDivisionString(self.division)
Beispiel #12
0
 def getDivisionString(self):
     return club_fmts.getDivisionString(self.division)
Beispiel #13
0
def getAnimationDivisionIcon(league, division):
    return '../maps/icons/library/cybersport/animation/division/%s%s.png' % (
        getLeagueString(league), getDivisionString(division).lower())