def _getHeaderData(self, data):
     headerParams = []
     if self.lobbyContext.getServerSettings().isStrongholdsEnabled():
         headerParams.append(PUtils.getTotalBattlesHeaderParam(self.__fortBattlesTargetData, PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES))
         headerParams.append(PUtils.packLditItemData(PUtils.getFormattedWinsEfficiency(self.__fortBattlesTargetData), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLESWINSEFFICIENCY, 'wins40x32.png'))
     else:
         headerParams.append(PUtils.packLditItemData(str(PUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_BATTLES, 'battles40x32.png'))
         headerParams.append(PUtils.packLditItemData(str(PUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_WINSEFFICIENCY, 'wins40x32.png'))
     headerParams.append(PUtils.getTotalBattlesHeaderParam(data[0], PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE))
     headerParams.append(PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIEWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIEWINSEFFICIENCY, 'wins40x32.png'))
     return headerParams
Exemplo n.º 2
0
 def _getHeaderData(self, data):
     headerParams = []
     if isFortificationBattlesEnabled():
         headerParams.append(PUtils.getTotalBattlesHeaderParam(self.__fortBattlesTargetData, PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES))
         headerParams.append(PUtils.packLditItemData(PUtils.getFormattedWinsEfficiency(self.__fortBattlesTargetData), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLESWINSEFFICIENCY, 'wins40x32.png'))
     else:
         headerParams.append(PUtils.packLditItemData(str(PUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_BATTLES, 'battles40x32.png'))
         headerParams.append(PUtils.packLditItemData(str(PUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_WINSEFFICIENCY, 'wins40x32.png'))
     headerParams.append(PUtils.getTotalBattlesHeaderParam(data[0], PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE))
     headerParams.append(PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIEWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIEWINSEFFICIENCY, 'wins40x32.png'))
     headerParams.append(PUtils.packLditItemData(str(self.__avgFortSortiesLoot), PROFILE.SECTION_STATISTICS_SCORES_FORT_RESOURCE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_RESOURCE, 'resources40x32.png'))
     return headerParams
Exemplo n.º 3
0
 def _getHeaderData(self, data):
     return (PUtils.getTotalBattlesHeaderParam(data[0], PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(self._damageEfficiency, PROFILE.SECTION_STATISTICS_DETAILED_DAMAGECOEFFICIENT, PROFILE.PROFILE_PARAMS_TOOLTIP_DAMAGECOEFF, 'dmgRatio40x32.png', PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(self._dmgDealt), BigWorld.wg_getIntegralFormat(self._dmgReceived)))),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP),
      PUtils.packLditItemData(self._avgAssistDmg, PROFILE.SECTION_STATISTICS_SCORES_AVGASSISTEDDAMAGE, PROFILE.PROFILE_PARAMS_TOOLTIP_AVGASSISTEDDAMAGE, 'assist40x32.png'),
      PUtils.packLditItemData(BigWorld.wg_getNiceNumberFormat(self._armorUsingEfficiency), PROFILE.SECTION_STATISTICS_SCORES_ARMORUSING, PROFILE.PROFILE_PARAMS_TOOLTIP_ARMORUSING, 'armorUsing40x32.png', self._armorUsingToolTipData))
Exemplo n.º 4
0
 def _getHeaderData(self, data):
     targetData = data[0]
     return (
         PUtils.getTotalBattlesHeaderParam(
             targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES,
             PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
         PUtils.packLditItemData(
             self._formattedWinsEfficiency,
             PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS,
             PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
         _packAvgDmgLditItemData(self._avgDmg),
         _packAvgXPLditItemData(self._avgXP),
         PUtils.packLditItemData(
             self._maxXP_formattedStr,
             PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE,
             PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png',
             PUtils.getVehicleRecordTooltipData(
                 targetData.getMaxXpVehicle)),
         PUtils.packLditItemData(
             self._damageEfficiency, PROFILE.
             SECTION_STATISTICS_SCORES_CLAN_SUMMARYDAMAGECOEFFICIENT,
             PROFILE.PROFILE_PARAMS_TOOLTIP_CLAN_SUMMARYDAMAGECOEFFICIENT,
             'dmgRatio40x32.png',
             PUtils.createToolTipData(
                 (BigWorld.wg_getIntegralFormat(self._dmgDealt),
                  BigWorld.wg_getIntegralFormat(self._dmgReceived)))))
Exemplo n.º 5
0
    def _getHeaderData(self, data):
        targetData = data[0]
        histBattleFieldAchievesCount = 0
        for record in layouts.HISTORY_BATTLEFIELD_GROUP:
            achieve = targetData.getAchievement(record)
            if achieve.isInDossier():
                histBattleFieldAchievesCount += 1

        histBattleFieldAchievesCount = BigWorld.wg_getIntegralFormat(
            histBattleFieldAchievesCount)
        return (PUtils.getTotalBattlesHeaderParam(
            targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES,
            PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
                PUtils.packLditItemData(
                    self._formattedWinsEfficiency,
                    PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS,
                    PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
                PUtils.packLditItemData(
                    histBattleFieldAchievesCount,
                    PROFILE.SECTION_STATISTICS_SCORES_ACHIEVEMENTSCOUNT,
                    PROFILE.PROFILE_PARAMS_TOOLTIP_ACHIEVEMENTSCOUNT,
                    'honors40x32.png'),
                PUtils.packLditItemData(
                    BigWorld.wg_getIntegralFormat(len(
                        targetData.getVehicles())),
                    PROFILE.SECTION_STATISTICS_SCORES_USEDTECHNICS,
                    PROFILE.PROFILE_PARAMS_TOOLTIP_USEDTECHNICS,
                    'techRatio40x32.png'))
Exemplo n.º 6
0
 def _getHeaderData(self, data):
     targetData = data[0]
     avgPointsPercent = PUtils.formatFloatPercent(
         PUtils.getValueOrUnavailable(targetData.getStepsEfficiency()))
     avgPointsTooltipData = (BigWorld.wg_getIntegralFormat(
         targetData.getStepsCount()),
                             BigWorld.wg_getIntegralFormat(
                                 targetData.getBattlesCount()))
     return (PUtils.getTotalBattlesHeaderParam(
         targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES,
         PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
             PUtils.packLditItemData(
                 BigWorld.wg_getIntegralFormat(targetData.getLadderPts()),
                 PROFILE.SECTION_STATISTICS_SCORES_RANKED_POINTS,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_RANKED_POINTS,
                 'rankPoints40x32.png'),
             PUtils.packLditItemData(
                 avgPointsPercent,
                 PROFILE.SECTION_STATISTICS_SCORES_RANKED_AVGPOINTS,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_RANKED_AVGPOINTS,
                 'rankStageFactor40x32.png',
                 PUtils.createToolTipData(avgPointsTooltipData)),
             _packAvgDmgLditItemData(self._avgDmg),
             _packAvgXPLditItemData(self._avgXP),
             PUtils.packLditItemData(
                 BigWorld.wg_getNiceNumberFormat(
                     PUtils.getValueOrUnavailable(
                         targetData.getAvgFrags())),
                 PROFILE.SECTION_STATISTICS_SCORES_RANKED_AVGFRAGS,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_RANKED_AVGFRAGS,
                 'icon_statistics_average_frags_40x32.png'))
Exemplo n.º 7
0
 def _getHeaderData(self, data):
     targetData = data[0]
     accountDossier = data[1]
     numTotalRandomVehicles = self._getListOfUniqueVehicles(
         targetData, accountDossier)
     return (PUtils.getTotalBattlesHeaderParam(
         targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES,
         PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
             PUtils.packLditItemData(
                 self._formattedWinsEfficiency,
                 PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
             _packAvgDmgLditItemData(self._avgDmg),
             _packAvgXPLditItemData(self._avgXP),
             PUtils.packLditItemData(
                 self._maxXP_formattedStr,
                 PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png',
                 PUtils.getVehicleRecordTooltipData(
                     targetData.getMaxXpVehicle)),
             PUtils.packLditItemData(
                 style.makeMarksOfMasteryText(
                     BigWorld.wg_getIntegralFormat(
                         targetData.getMarksOfMastery()[3]),
                     numTotalRandomVehicles),
                 PROFILE.SECTION_STATISTICS_SCORES_COOLSIGNS,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_MARKOFMASTERY,
                 'markOfMastery40x32.png'))
 def _getHeaderData(self, data):
     return (PUtils.getTotalBattlesHeaderParam(data[0], PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(self._damageEfficiency, PROFILE.SECTION_STATISTICS_DETAILED_DAMAGECOEFFICIENT, PROFILE.PROFILE_PARAMS_TOOLTIP_DAMAGECOEFF, 'dmgRatio40x32.png', PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(self._dmgDealt), BigWorld.wg_getIntegralFormat(self._dmgReceived)))),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP),
      PUtils.packLditItemData(self._avgAssistDmg, PROFILE.SECTION_STATISTICS_SCORES_AVGASSISTEDDAMAGE, PROFILE.PROFILE_PARAMS_TOOLTIP_AVGASSISTEDDAMAGE, 'assist40x32.png'),
      PUtils.packLditItemData(BigWorld.wg_getNiceNumberFormat(self._armorUsingEfficiency), PROFILE.SECTION_STATISTICS_SCORES_ARMORUSING, PROFILE.PROFILE_PARAMS_TOOLTIP_ARMORUSING, 'armorUsing40x32.png', self._armorUsingToolTipData))
Exemplo n.º 9
0
 def _getHeaderData(self, data):
     targetData = data[0]
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP),
      PUtils.packLditItemData(self._maxXP_formattedStr, PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE, PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png', PUtils.getVehicleRecordTooltipData(targetData.getMaxXpVehicle)),
      PUtils.packLditItemData(BigWorld.wg_getIntegralFormat(targetData.getMarksOfMastery()[3]), PROFILE.SECTION_STATISTICS_SCORES_COOLSIGNS, PROFILE.PROFILE_PARAMS_TOOLTIP_MARKOFMASTERY, 'markOfMastery40x32.png'))
Exemplo n.º 10
0
 def _getHeaderData(self, data):
     targetData = data[0]
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_DIF_FALLOUT_BATTLESCOUNT),
      self.__packAvgVictoryPointsData(self.__avgVictoryPoints),
      _packAvgXPLditItemData(self._avgXP),
      self.__packAvgDmgData(self._avgDmg),
      self.__packMaxVictoryPoints(self.__maxVictoryPoints),
      self.__packKDR(self.__kdr, self.__kills, self.__consumablesKills, self.__deaths))
 def _getHeaderData(self, data):
     targetData = data[0]
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_DIF_FALLOUT_BATTLESCOUNT),
      self.__packAvgVictoryPointsData(self.__avgVictoryPoints),
      _packAvgXPLditItemData(self._avgXP),
      self.__packAvgDmgData(self._avgDmg),
      self.__packMaxVictoryPoints(self.__maxVictoryPoints),
      self.__packKDR(self.__kdr, self.__kills, self.__consumablesKills, self.__deaths))
Exemplo n.º 12
0
 def _getHeaderData(self, data):
     targetData = data[0]
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP),
      PUtils.packLditItemData(self._maxXP_formattedStr, PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE, PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png', PUtils.getVehicleRecordTooltipData(targetData.getMaxXpVehicle)),
      PUtils.packLditItemData(self._damageEfficiency, PROFILE.SECTION_STATISTICS_SCORES_CLAN_SUMMARYDAMAGECOEFFICIENT, PROFILE.PROFILE_PARAMS_TOOLTIP_CLAN_SUMMARYDAMAGECOEFFICIENT, 'dmgRatio40x32.png', PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(self._dmgDealt), BigWorld.wg_getIntegralFormat(self._dmgReceived)))))
Exemplo n.º 13
0
 def _getHeaderData(self, data):
     headerParams = []
     if isFortificationBattlesEnabled():
         headerParams.append(
             PUtils.getTotalBattlesHeaderParam(
                 self.__fortBattlesTargetData,
                 PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES))
         headerParams.append(
             PUtils.packLditItemData(
                 PUtils.getFormattedWinsEfficiency(
                     self.__fortBattlesTargetData), PROFILE.
                 SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLESWINSEFFICIENCY,
                 'wins40x32.png'))
     else:
         headerParams.append(
             PUtils.packLditItemData(
                 str(PUtils.UNAVAILABLE_VALUE),
                 PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES,
                 PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_BATTLES,
                 'battles40x32.png'))
         headerParams.append(
             PUtils.packLditItemData(
                 str(PUtils.UNAVAILABLE_VALUE), PROFILE.
                 SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY,
                 PROFILE.
                 PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_WINSEFFICIENCY,
                 'wins40x32.png'))
     headerParams.append(
         PUtils.getTotalBattlesHeaderParam(
             data[0], PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE,
             PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE))
     headerParams.append(
         PUtils.packLditItemData(
             self._formattedWinsEfficiency,
             PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIEWINSEFFICIENCY,
             PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIEWINSEFFICIENCY,
             'wins40x32.png'))
     headerParams.append(
         PUtils.packLditItemData(
             str(self.__avgFortSortiesLoot),
             PROFILE.SECTION_STATISTICS_SCORES_FORT_RESOURCE,
             PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_RESOURCE,
             'resources40x32.png'))
     return headerParams
Exemplo n.º 14
0
 def _getHeaderData(self, data):
     targetData = data[0]
     stepsEfficiency = targetData.getStepsEfficiency()
     avgPointsPercent = PUtils.formatFloatPercent(stepsEfficiency) if stepsEfficiency > 0 else PUtils.UNAVAILABLE_SYMBOL
     stepsCount = targetData.getStepsCount()
     stepsCount = backport.getIntegralFormat(stepsCount) if stepsCount >= 0 else PUtils.UNAVAILABLE_SYMBOL
     avgPointsTooltipData = (stepsCount, backport.getIntegralFormat(targetData.getBattlesCount()))
     return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
      PUtils.packLditItemData(avgPointsPercent, PROFILE.SECTION_STATISTICS_SCORES_RANKED_AVGPOINTS, PROFILE.PROFILE_PARAMS_TOOLTIP_RANKED_AVGPOINTS, 'rankStageFactor40x32.png', PUtils.createToolTipData(avgPointsTooltipData)),
      _packAvgDmgLditItemData(self._avgDmg),
      _packAvgXPLditItemData(self._avgXP))
Exemplo n.º 15
0
    def _getHeaderData(self, data):
        targetData = data[0]
        histBattleFieldAchievesCount = 0
        for record in layouts.HISTORY_BATTLEFIELD_GROUP:
            achieve = targetData.getAchievement(record)
            if achieve.isInDossier():
                histBattleFieldAchievesCount += 1

        histBattleFieldAchievesCount = BigWorld.wg_getIntegralFormat(histBattleFieldAchievesCount)
        return (PUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT),
         PUtils.packLditItemData(self._formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'),
         PUtils.packLditItemData(histBattleFieldAchievesCount, PROFILE.SECTION_STATISTICS_SCORES_ACHIEVEMENTSCOUNT, PROFILE.PROFILE_PARAMS_TOOLTIP_ACHIEVEMENTSCOUNT, 'honors40x32.png'),
         PUtils.packLditItemData(BigWorld.wg_getIntegralFormat(len(targetData.getVehicles())), PROFILE.SECTION_STATISTICS_SCORES_USEDTECHNICS, PROFILE.PROFILE_PARAMS_TOOLTIP_USEDTECHNICS, 'techRatio40x32.png'))
Exemplo n.º 16
0
 def _getHeaderData(self, data):
     return (PUtils.getTotalBattlesHeaderParam(
         data, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_LABEL,
         FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_TOOLTIP),
             PUtils.packLditItemData(
                 PUtils.getFormattedWinsEfficiency(data),
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_LABEL,
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_TOOLTIP,
                 'wins40x32.png'),
             PUtils.packLditItemData(
                 PUtils.formatEfficiency(data.getBattlesCount(),
                                         data.getAvgLoot),
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_LABEL,
                 FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_TOOLTIP,
                 'avgDefes40x32.png'))
 def __updateSortieData(self):
     ms = i18n.makeString
     dossier = self.fortCtrl.getFort().getFortDossier()
     sortiesStats = dossier.getSortiesStats()
     totalRes = sortiesStats.getLoot()
     defresValueStr = str(BigWorld.wg_getIntegralFormat(totalRes)) + ' '
     formattedDefresValue = ''.join((text_styles.defRes(defresValueStr), icons.nut()))
     middleBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getMiddleBattlesCount())
     championshipBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getChampionBattlesCount())
     absoluteBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getAbsoluteBattlesCount())
     self.__data.update({'clanName': g_clanCache.clanTag,
      'sortieBattlesCount': ProfileUtils.getTotalBattlesHeaderParam(sortiesStats, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_TOOLTIP),
      'sortieWins': ProfileUtils.packLditItemData(ProfileUtils.getFormattedWinsEfficiency(sortiesStats), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_TOOLTIP, 'wins40x32.png'),
      'sortieAvgDefres': ProfileUtils.packLditItemData(ProfileUtils.formatEfficiency(sortiesStats.getBattlesCount(), sortiesStats.getAvgLoot), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_TOOLTIP, 'avgDefes40x32.png'),
      'sortieBattlesStats': [{'value': self.__getMiddleTitleText(middleBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_MIDDLEBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(championshipBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_CHAMPIONBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(absoluteBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_ABSOLUTEBATTLESCOUNT_LABEL)}],
      'sortieDefresStats': [{'value': formattedDefresValue,
                             'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_DEFRES_LOOTINSORTIES_LABEL)}]})
Exemplo n.º 18
0
 def __updateSortieData(self):
     ms = i18n.makeString
     dossier = self.fortCtrl.getFort().getFortDossier()
     sortiesStats = dossier.getSortiesStats()
     totalRes = sortiesStats.getLoot()
     defresValueStr = str(BigWorld.wg_getIntegralFormat(totalRes)) + ' '
     formattedDefresValue = ''.join((text_styles.defRes(defresValueStr), icons.nut()))
     middleBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getMiddleBattlesCount())
     championshipBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getChampionBattlesCount())
     absoluteBattlesCount = BigWorld.wg_getIntegralFormat(sortiesStats.getAbsoluteBattlesCount())
     self.__data.update({'clanName': g_clanCache.clanTag,
      'sortieBattlesCount': ProfileUtils.getTotalBattlesHeaderParam(sortiesStats, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_TOOLTIP),
      'sortieWins': ProfileUtils.packLditItemData(ProfileUtils.getFormattedWinsEfficiency(sortiesStats), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_TOOLTIP, 'wins40x32.png'),
      'sortieAvgDefres': ProfileUtils.packLditItemData(ProfileUtils.formatEfficiency(sortiesStats.getBattlesCount(), sortiesStats.getAvgLoot), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_TOOLTIP, 'avgDefes40x32.png'),
      'sortieBattlesStats': [{'value': self.__getMiddleTitleText(middleBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_MIDDLEBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(championshipBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_CHAMPIONBATTLESCOUNT_LABEL)}, {'value': self.__getMiddleTitleText(absoluteBattlesCount),
                              'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLES_ABSOLUTEBATTLESCOUNT_LABEL)}],
      'sortieDefresStats': [{'value': formattedDefresValue,
                             'label': ms(FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_DEFRES_LOOTINSORTIES_LABEL)}]})
Exemplo n.º 19
0
    def _sendAccountData(self, targetData, accountDossier):
        formattedWinsEfficiency = ProfileUtils.getFormattedWinsEfficiency(targetData)
        dmgDealt = targetData.getDamageDealt()
        dmgReceived = targetData.getDamageReceived()
        damageEfficiency = BigWorld.wg_getNiceNumberFormat(ProfileUtils.getValueOrUnavailable(targetData.getDamageEfficiency()))
        damageBlockedByArmor = targetData.getDamageBlockedByArmor()
        potentialDamageReceived = targetData.getPotentialDamageReceived()
        pResDmg = potentialDamageReceived - damageBlockedByArmor
        armorUsingEfficiency = ProfileUtils.getValueOrUnavailable(targetData.getArmorUsingEfficiency())
        avgXP = ProfileUtils.getValueOrUnavailable(targetData.getAvgXP())
        avgDmg = ProfileUtils.getValueOrUnavailable(targetData.getAvgDamage())
        maxXP = targetData.getMaxXp()
        maxXP_formattedStr = BigWorld.wg_getIntegralFormat(maxXP)
        armorUsingToolTipData = ProfileUtils.createToolTipData([ProfileUtils.getAvgDamageBlockedValue(targetData)])
        avgAssistDmg = BigWorld.wg_getNiceNumberFormat(ProfileUtils.getValueOrUnavailable(targetData.getDamageAssistedEfficiency()))
        vehicles = targetData.getVehicles()
        vehiclesLen = len(vehicles)
        headerParams = []
        dataList = []
        if self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_TEAM:
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_TEAM)
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT))
            headerParams.append(ProfileUtils.packLditItemData(damageEfficiency, PROFILE.SECTION_STATISTICS_DETAILED_DAMAGECOEFFICIENT, PROFILE.PROFILE_PARAMS_TOOLTIP_DAMAGECOEFF, 'dmgRatio40x32.png', {'tooltipData': ProfileUtils.createToolTipData((BigWorld.wg_getIntegralFormat(dmgDealt), BigWorld.wg_getIntegralFormat(dmgReceived)))}, HeaderItemsTypes.VALUES))
            headerParams.append(self.__packAvgDmgLditItemData(avgDmg))
            headerParams.append(self.__packAvgXPLditItemData(avgXP))
            headerParams.append(ProfileUtils.packLditItemData(avgAssistDmg, PROFILE.SECTION_STATISTICS_SCORES_AVGASSISTEDDAMAGE, PROFILE.PROFILE_PARAMS_TOOLTIP_AVGASSISTEDDAMAGE, 'assist40x32.png'))
            headerParams.append(ProfileUtils.packLditItemData(BigWorld.wg_getNiceNumberFormat(armorUsingEfficiency), PROFILE.SECTION_STATISTICS_SCORES_ARMORUSING, PROFILE.PROFILE_PARAMS_TOOLTIP_ARMORUSING, 'armorUsing40x32.png', {'tooltipData': armorUsingToolTipData}, HeaderItemsTypes.VALUES))
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_DETAILED, targetData))
            dataList.append(self.__getChartsData(targetData))
        elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_HISTORICAL:
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT))
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_HISTORICAL)
            histBattleFieldAchievesCount = 0
            for record in layouts.HISTORY_BATTLEFIELD_GROUP:
                achieve = targetData.getAchievement(record)
                if achieve.isInDossier():
                    histBattleFieldAchievesCount += 1

            histBattleFieldAchievesCount = BigWorld.wg_getIntegralFormat(histBattleFieldAchievesCount)
            histBattleFieldAchievesCountTotal = BigWorld.wg_getIntegralFormat(len(layouts.HISTORY_BATTLEFIELD_GROUP))
            headerParams.append(ProfileUtils.packLditItemData(formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'))
            headerParams.append(ProfileUtils.packLditItemData(histBattleFieldAchievesCount, PROFILE.SECTION_STATISTICS_SCORES_ACHIEVEMENTSCOUNT, PROFILE.PROFILE_PARAMS_TOOLTIP_ACHIEVEMENTSCOUNT, 'honors40x32.png', {'total': histBattleFieldAchievesCountTotal}, HeaderItemsTypes.RATIO))
            headerParams.append(ProfileUtils.packLditItemData(BigWorld.wg_getIntegralFormat(vehiclesLen), PROFILE.SECTION_STATISTICS_SCORES_USEDTECHNICS, PROFILE.PROFILE_PARAMS_TOOLTIP_USEDTECHNICS, 'techRatio40x32.png'))
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_DETAILED, targetData))
        elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_FORTIFICATIONS:
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_FORTIFICATIONS)
            fortBattlesTargetData = accountDossier.getFortBattlesStats()
            fortMiscTargetData = accountDossier.getFortMiscStats()
            if isFortificationBattlesEnabled():
                headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(fortBattlesTargetData, PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES))
                headerParams.append(ProfileUtils.packLditItemData(ProfileUtils.getFormattedWinsEfficiency(fortBattlesTargetData), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLESWINSEFFICIENCY, 'wins40x32.png'))
            else:
                headerParams.append(ProfileUtils.packLditItemData(str(ProfileUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_BATTLES, 'battles40x32.png'))
                headerParams.append(ProfileUtils.packLditItemData(str(ProfileUtils.UNAVAILABLE_VALUE), PROFILE.SECTION_STATISTICS_SCORES_FORT_BATTLESWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_UNAVAILABLE_FORT_WINSEFFICIENCY, 'wins40x32.png'))
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE))
            headerParams.append(ProfileUtils.packLditItemData(formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIEWINSEFFICIENCY, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIEWINSEFFICIENCY, 'wins40x32.png'))
            totalSortiesLoot = fortMiscTargetData.getLootInSorties()
            avgFortSortiesLoot = self.__getFortAvgLoot(targetData, totalSortiesLoot)
            headerParams.append(ProfileUtils.packLditItemData(str(avgFortSortiesLoot), PROFILE.SECTION_STATISTICS_SCORES_FORT_RESOURCE, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_RESOURCE, 'resources40x32.png'))
            if isFortificationBattlesEnabled():
                fortBattlesDetaildStatisticsTabData = self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTBATTLES, fortBattlesTargetData)
                fortBattlesDetaildStatisticsTabData['data'][0][0]['data'][0]['tooltip'] = PROFILE.PROFILE_PARAMS_TOOLTIP_DIF_FORT_BATTLESCOUNT
                dataList.append(fortBattlesDetaildStatisticsTabData)
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTSORTIE, targetData))
            specificData = []
            battlesCount = fortBattlesTargetData.getBattlesCount()
            lossesCount = fortBattlesTargetData.getLossesCount()
            winsCount = fortBattlesTargetData.getWinsCount()
            battlesToolTipData = [BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount)]
            formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount)
            specificDataColumn1 = []
            if isFortificationBattlesEnabled():
                specificDataColumn1.append(ProfileUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTBATTLES, [DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTTOTALBATTLES, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES, ProfileUtils.createToolTipData(battlesToolTipData)),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLESTOTALWINS, ProfileUtils.getFormattedWinsEfficiency(fortBattlesTargetData), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLESWINS),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_LOOTING, fortMiscTargetData.getEnemyBasePlunderNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_LOOTING),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_ATTACKS, fortMiscTargetData.getAttackNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_ATTACKS),
                 DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_DEFENCES, fortMiscTargetData.getDefenceHours(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_DEFENCES)]))
            battlesCount = targetData.getBattlesCount()
            lossesCount = targetData.getLossesCount()
            winsCount = targetData.getWinsCount()
            drawsCount = ProfileUtils.getDrawCount(battlesCount, lossesCount, winsCount)
            battlesToolTipData = [BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount), BigWorld.wg_getIntegralFormat(drawsCount)]
            formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount)
            specificDataColumn1.append(ProfileUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTSORTIE, [DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE, ProfileUtils.createToolTipData(battlesToolTipData)), DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIETOTALWINS, formattedWinsEfficiency, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIEWINS)]))
            specificData.append(specificDataColumn1)
            resourcesDataList = []
            resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_AVGRESOURCES, avgFortSortiesLoot, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_AVGRESOURCES))
            resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(totalSortiesLoot), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_TOTALRESOURCES))
            if isFortificationBattlesEnabled():
                resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(fortMiscTargetData.getLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_TOTALRESOURCES))
                resourcesDataList.append(DetailedStatisticsUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_MAXRESOURCES, BigWorld.wg_getIntegralFormat(fortMiscTargetData.getMaxLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_MAXRESOURCES))
            specificData.append([ProfileUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_RESOURCE, resourcesDataList)])
            dataList.append(ProfileUtils.getLabelViewTypeDataObject(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_SPECIFIC, specificData, ProfileUtils.VIEW_TYPE_TABLES))
        else:
            maxExpToolTipData = ProfileUtils.getVehicleRecordTooltipData(targetData.getMaxXpVehicle)
            headerText = i18n.makeString(PROFILE.SECTION_STATISTICS_HEADERTEXT_ALL)
            headerParams.append(ProfileUtils.getTotalBattlesHeaderParam(targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES, PROFILE.PROFILE_PARAMS_TOOLTIP_BATTLESCOUNT))
            headerParams.append(ProfileUtils.packLditItemData(formattedWinsEfficiency, PROFILE.SECTION_STATISTICS_SCORES_TOTALWINS, PROFILE.PROFILE_PARAMS_TOOLTIP_WINS, 'wins40x32.png'))
            headerParams.append(self.__packAvgDmgLditItemData(avgDmg))
            headerParams.append(self.__packAvgXPLditItemData(avgXP))
            headerParams.append(ProfileUtils.packLditItemData(maxXP_formattedStr, PROFILE.SECTION_STATISTICS_SCORES_MAXEXPERIENCE, PROFILE.PROFILE_PARAMS_TOOLTIP_MAXEXP, 'maxExp40x32.png', {'tooltipData': maxExpToolTipData}, HeaderItemsTypes.VALUES))
            headerParams.append(ProfileUtils.packLditItemData(BigWorld.wg_getIntegralFormat(targetData.getMarksOfMastery()[3]), PROFILE.SECTION_STATISTICS_SCORES_COOLSIGNS, PROFILE.PROFILE_PARAMS_TOOLTIP_MARKOFMASTERY, 'markOfMastery40x32.png', {'total': BigWorld.wg_getIntegralFormat(vehiclesLen)}, HeaderItemsTypes.RATIO))
            dataList.append(self.__getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_DETAILED, targetData))
            dataList.append(self.__getChartsData(targetData))
        bodyParams = {'dataList': dataList}
        self.as_responseDossierS(self._battlesType, {'headerText': headerText,
         'headerParams': headerParams,
         'bodyParams': bodyParams})
Exemplo n.º 20
0
 def __packBattleCount(self):
     return PUtils.getTotalBattlesHeaderParam(
         self.__targetData, PROFILE.SECTION_STATISTICS_SCORES_TOTALBATTLES,
         PROFILE.PROFILE_PARAMS_TOOLTIP_BRBATTLESCOUNT)
Exemplo n.º 21
0
 def _getHeaderData(self, data):
     return (PUtils.getTotalBattlesHeaderParam(data, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_BATTLESCOUNT_TOOLTIP), PUtils.packLditItemData(PUtils.getFormattedWinsEfficiency(data), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_WINS_TOOLTIP, 'wins40x32.png'), PUtils.packLditItemData(PUtils.formatEfficiency(data.getBattlesCount(), data.getAvgLoot), FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_LABEL, FORTIFICATIONS.CLANSTATS_PARAMS_SORTIE_AVGDEFRES_TOOLTIP, 'avgDefes40x32.png'))