def _getDetailedData(self, data): targetData = data[0] dataList = [] if isFortificationBattlesEnabled(): dataList.append(_getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTBATTLES, self.__fortBattlesTargetData, isCurrentUser=self._isCurrentUser, layout=FORT_STATISTICS_LAYOUT)) dataList.append(_getDetailedStatisticsData(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTSORTIE, targetData, isCurrentUser=self._isCurrentUser)) specificData = [] battlesCount = self.__fortBattlesTargetData.getBattlesCount() lossesCount = self.__fortBattlesTargetData.getLossesCount() winsCount = self.__fortBattlesTargetData.getWinsCount() formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount) specificDataColumn1 = [] if isFortificationBattlesEnabled(): specificDataColumn1.append(PUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTBATTLES, (DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTTOTALBATTLES, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES, PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount)))), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLESTOTALWINS, PUtils.getFormattedWinsEfficiency(self.__fortBattlesTargetData), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLESWINS), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_LOOTING, self.__fortMiscTargetData.getEnemyBasePlunderNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_LOOTING), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_ATTACKS, self.__fortMiscTargetData.getAttackNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_ATTACKS), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_DEFENCES, self.__fortMiscTargetData.getDefenceHours(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_DEFENCES)))) battlesCount = targetData.getBattlesCount() lossesCount = targetData.getLossesCount() winsCount = targetData.getWinsCount() drawsCount = targetData.getDrawsCount() formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount) specificDataColumn1.append(PUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTSORTIE, (DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE, PUtils.createToolTipData((BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount), BigWorld.wg_getIntegralFormat(drawsCount)))), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIETOTALWINS, self._formattedWinsEfficiency, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIEWINS)))) specificData.append(specificDataColumn1) resourcesDataList = [DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_AVGRESOURCES, self.__avgFortSortiesLoot, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_AVGRESOURCES), DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(self.__totalSortiesLoot), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_TOTALRESOURCES)] specificDataColumn2 = [] if isFortificationBattlesEnabled(): resourcesDataList.append(DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(self.__fortMiscTargetData.getLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_TOTALRESOURCES)) resourcesDataList.append(DSUtils.getDetailedDataObject(PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_MAXRESOURCES, BigWorld.wg_getIntegralFormat(self.__fortMiscTargetData.getMaxLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_MAXRESOURCES)) specificDataColumn2.append(PUtils.getLabelDataObject(PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_RESOURCE, resourcesDataList)) specificData.append(specificDataColumn2) dataList.append(PUtils.getLabelViewTypeDataObject(PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_SPECIFIC, specificData, PUtils.VIEW_TYPE_TABLES)) return dataList
def _getInitData(self): dropDownProvider = [PROFILE.PROFILE_DROPDOWN_LABELS_ALL, PROFILE.PROFILE_DROPDOWN_LABELS_HISTORICAL, PROFILE.PROFILE_DROPDOWN_LABELS_TEAM] if isFortificationEnabled(): dropDownProvider.append(PROFILE.PROFILE_DROPDOWN_LABELS_FORTIFICATIONS_SORTIES) if isFortificationBattlesEnabled(): dropDownProvider.append(PROFILE.PROFILE_DROPDOWN_LABELS_FORTIFICATIONS_BATTLES) return {'dropDownProvider': dropDownProvider}
def onIntelligenceClick(self): isDefenceHourEnabled = self.fortCtrl.getFort().isDefenceHourEnabled() if not isFortificationBattlesEnabled(): isDefenceHourEnabled = False alias = FORTIFICATION_ALIASES.FORT_INTELLIGENCE_NOT_AVAILABLE_WINDOW elif not isDefenceHourEnabled: alias = FORTIFICATION_ALIASES.FORT_INTELLIGENCE_NOT_AVAILABLE_WINDOW else: alias = FORTIFICATION_ALIASES.FORT_INTELLIGENCE_WINDOW self.fireEvent(events.LoadViewEvent(alias, ctx={'isDefenceHourEnabled': isDefenceHourEnabled}), EVENT_BUS_SCOPE.LOBBY) self.__intelligenceArrowVisible = False self.as_setTutorialArrowVisibilityS(FORTIFICATION_ALIASES.TUTORIAL_ARROW_INTELLIGENCE, self.__intelligenceArrowVisible)
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
def _getInitData(self): dropDownProvider = [self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.ALL), self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.HISTORICAL), self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.TEAM), self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.STATICTEAM), self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.CLAN)] if isFortificationEnabled(): dropDownProvider.append(self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.FORTIFICATIONS_SORTIES)) if isFortificationBattlesEnabled(): dropDownProvider.append(self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.FORTIFICATIONS_BATTLES)) return {'dropDownProvider': dropDownProvider, 'tableHeader': self._getTableHeader()}
def __init__(self, ctx = None): super(FortModernizationWindow, self).__init__() self.__uid = ctx.get('data', None) self.intBuildingID = None self._buildingDescr = None self.__buildingLevel = None self.nextLevel = None self.__baseBuildingLevel = None self.__progress = None self.__hpTotalVal = None self.__hpVal = None self.__defResVal = None self.__maxDerResVal = None self.__cost = None self.__defencePeriod = False self.__isFortBattleAvailable = isFortificationBattlesEnabled()
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
def onIntelligenceClick(self): isDefenceHourEnabled = self.fortCtrl.getFort().isDefenceHourEnabled() if not isFortificationBattlesEnabled(): isDefenceHourEnabled = False alias = FORTIFICATION_ALIASES.FORT_INTELLIGENCE_NOT_AVAILABLE_WINDOW elif not isDefenceHourEnabled: alias = FORTIFICATION_ALIASES.FORT_INTELLIGENCE_NOT_AVAILABLE_WINDOW else: alias = FORTIFICATION_ALIASES.FORT_INTELLIGENCE_WINDOW self.fireEvent( events.LoadViewEvent( alias, ctx={'isDefenceHourEnabled': isDefenceHourEnabled}), EVENT_BUS_SCOPE.LOBBY) self.__intelligenceArrowVisible = False self.as_setTutorialArrowVisibilityS( FORTIFICATION_ALIASES.TUTORIAL_ARROW_INTELLIGENCE, self.__intelligenceArrowVisible)
def _getInitData(self): dropDownProvider = [ self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.ALL), self._dataProviderEntryAutoTranslate( PROFILE_DROPDOWN_KEYS.HISTORICAL), self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.TEAM), self._dataProviderEntryAutoTranslate( PROFILE_DROPDOWN_KEYS.STATICTEAM), self._dataProviderEntryAutoTranslate(PROFILE_DROPDOWN_KEYS.CLAN) ] if isFortificationEnabled(): dropDownProvider.append( self._dataProviderEntryAutoTranslate( PROFILE_DROPDOWN_KEYS.FORTIFICATIONS_SORTIES)) if isFortificationBattlesEnabled(): dropDownProvider.append( self._dataProviderEntryAutoTranslate( PROFILE_DROPDOWN_KEYS.FORTIFICATIONS_BATTLES)) return { 'dropDownProvider': dropDownProvider, 'tableHeader': self._getTableHeader() }
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})
def _isSupported(self, orderID): if not isFortificationBattlesEnabled(): if orderID in (FORT_ORDER_TYPE.EVACUATION, FORT_ORDER_TYPE.REQUISITION): return False return True
def isFortificationBattleAvailable(self): return isFortificationBattlesEnabled()
def _getDetailedData(self, data): targetData = data[0] dataList = [] if isFortificationBattlesEnabled(): fortBattlesDetaildStatisticsTabData = _getDetailedStatisticsData( PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTBATTLES, self.__fortBattlesTargetData, isCurrentUser=self._isCurrentUser) discToolTip = PROFILE.PROFILE_PARAMS_TOOLTIP_DIF_FORT_BATTLESCOUNT fortBattlesDetaildStatisticsTabData['data'][0][0]['data'][0][ 'tooltip'] = discToolTip dataList.append(fortBattlesDetaildStatisticsTabData) dataList.append( _getDetailedStatisticsData( PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_FORTSORTIE, targetData, isCurrentUser=self._isCurrentUser)) specificData = [] battlesCount = self.__fortBattlesTargetData.getBattlesCount() lossesCount = self.__fortBattlesTargetData.getLossesCount() winsCount = self.__fortBattlesTargetData.getWinsCount() battlesToolTipData = [ BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount) ] formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount) specificDataColumn1 = [] if isFortificationBattlesEnabled(): specificDataColumn1.append( PUtils.getLabelDataObject( PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTBATTLES, [ DSUtils.getDetailedDataObject( PROFILE.SECTION_STATISTICS_SCORES_FORTTOTALBATTLES, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_BATTLES, PUtils.createToolTipData(battlesToolTipData)), DSUtils.getDetailedDataObject( PROFILE. SECTION_STATISTICS_SCORES_FORTBATTLESTOTALWINS, PUtils.getFormattedWinsEfficiency( self.__fortBattlesTargetData), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLESWINS), DSUtils.getDetailedDataObject( PROFILE.SECTION_STATISTICS_SCORES_LOOTING, self.__fortMiscTargetData. getEnemyBasePlunderNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_LOOTING), DSUtils.getDetailedDataObject( PROFILE. SECTION_STATISTICS_SCORES_FORTBATTLES_ATTACKS, self.__fortMiscTargetData.getAttackNumber(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_ATTACKS ), DSUtils.getDetailedDataObject( PROFILE. SECTION_STATISTICS_SCORES_FORTBATTLES_DEFENCES, self.__fortMiscTargetData.getDefenceHours(), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_DEFENCES ) ])) battlesCount = targetData.getBattlesCount() lossesCount = targetData.getLossesCount() winsCount = targetData.getWinsCount() drawsCount = PUtils.getDrawCount(battlesCount, lossesCount, winsCount) battlesToolTipData = [ BigWorld.wg_getIntegralFormat(winsCount), BigWorld.wg_getIntegralFormat(lossesCount), BigWorld.wg_getIntegralFormat(drawsCount) ] formattedBattlesCount = BigWorld.wg_getIntegralFormat(battlesCount) specificDataColumn1.append( PUtils.getLabelDataObject( PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_FORTSORTIE, [ DSUtils.getDetailedDataObject( PROFILE.SECTION_STATISTICS_SCORES_FORT_SORTIE, formattedBattlesCount, PROFILE.PROFILE_PARAMS_TOOLTIP_FORT_SORTIE, PUtils.createToolTipData(battlesToolTipData)), DSUtils.getDetailedDataObject( PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIETOTALWINS, self._formattedWinsEfficiency, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIEWINS) ])) specificData.append(specificDataColumn1) resourcesDataList = [] resourcesDataList.append( DSUtils.getDetailedDataObject( PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_AVGRESOURCES, self.__avgFortSortiesLoot, PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_AVGRESOURCES)) resourcesDataList.append( DSUtils.getDetailedDataObject( PROFILE.SECTION_STATISTICS_SCORES_FORTSORTIES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat(self.__totalSortiesLoot), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTSORTIES_TOTALRESOURCES)) if isFortificationBattlesEnabled(): resourcesDataList.append( DSUtils.getDetailedDataObject( PROFILE. SECTION_STATISTICS_SCORES_FORTBATTLES_TOTALRESOURCES, BigWorld.wg_getIntegralFormat( self.__fortMiscTargetData.getLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_TOTALRESOURCES)) resourcesDataList.append( DSUtils.getDetailedDataObject( PROFILE.SECTION_STATISTICS_SCORES_FORTBATTLES_MAXRESOURCES, BigWorld.wg_getIntegralFormat( self.__fortMiscTargetData.getMaxLootInBattles()), PROFILE.PROFILE_PARAMS_TOOLTIP_FORTBATTLES_MAXRESOURCES)) specificData.append([ PUtils.getLabelDataObject( PROFILE.SECTION_STATISTICS_BODYPARAMS_LABEL_RESOURCE, resourcesDataList) ]) dataList.append( PUtils.getLabelViewTypeDataObject( PROFILE.SECTION_STATISTICS_BODYBAR_LABEL_SPECIFIC, specificData, PUtils.VIEW_TYPE_TABLES)) return dataList