本文整理汇总了Python中gui.Scaleform.daapi.view.AchievementsUtils.AchievementsUtils类的典型用法代码示例。如果您正苦于以下问题:Python AchievementsUtils类的具体用法?Python AchievementsUtils怎么用?Python AchievementsUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AchievementsUtils类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _sendAccountData
def _sendAccountData(self, targetData, accountDossier):
outcome = ProfileUtils.packProfileDossierInfo(targetData)
outcome['avgDamage'] = ProfileUtils.getValueOrUnavailable(targetData.getAvgDamage())
outcome['maxDestroyed'] = targetData.getMaxFrags()
vehicle = g_itemsCache.items.getItemByCD(targetData.getMaxFragsVehicle())
outcome['maxDestroyedByVehicle'] = vehicle.shortUserName if vehicle is not None else ''
outcome['globalRating'] = self.getGlobalRating(self._databaseID)
totalStats = accountDossier.getTotalStats()
outcome['significantAchievements'] = AchievementsUtils.packAchievementList(totalStats.getSignificantAchievements(), accountDossier, self._userID is None, False)
outcome['nearestAchievements'] = AchievementsUtils.packAchievementList(totalStats.getNearestAchievements(), accountDossier, self._userID is None, True)
self.as_responseDossierS(self._battlesType, outcome)
return
示例2: _receiveVehicleDossier
def _receiveVehicleDossier(self, vehicleIntCD, databaseId):
vehDossier = g_itemsCache.items.getVehicleDossier(vehicleIntCD, databaseId)
achievementsList = None
specialMarksStats = []
if self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_ALL:
stats = vehDossier.getRandomStats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
if g_itemsCache.items.getItemByCD(int(vehicleIntCD)).level > 4:
specialMarksStats.append(AchievementsUtils.packAchievement(stats.getAchievement(MARK_ON_GUN_RECORD), vehDossier.getDossierType(), dumpDossier(vehDossier), self._userID is None))
elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_TEAM:
stats = vehDossier.getTeam7x7Stats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_STATICTEAM:
stats = vehDossier.getRated7x7Stats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_HISTORICAL:
stats = vehDossier.getHistoricalStats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_FORTIFICATIONS_SORTIES:
stats = vehDossier.getFortSortiesStats()
elif self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_FORTIFICATIONS_BATTLES:
stats = vehDossier.getFortBattlesStats()
else:
raise ValueError('Profile Technique: Unknown battle type: ' + self._battlesType)
if achievementsList is not None:
achievementsList.insert(0, specialMarksStats)
preparedStatistics = DetailedStatisticsUtils.getStatistics(stats, self._userID is None)
if self._battlesType == PROFILE.PROFILE_DROPDOWN_LABELS_FORTIFICATIONS_BATTLES:
preparedStatistics[0]['data'][0]['tooltip'] = PROFILE.PROFILE_PARAMS_TOOLTIP_DIF_FORT_BATTLESCOUNT
self.as_responseVehicleDossierS({'detailedData': preparedStatistics,
'achievements': achievementsList})
return
示例3: __getAchievementsList
def __getAchievementsList(self, targetData, vehDossier):
packedList = []
achievements = targetData.getAchievements(True)
for achievementBlockList in achievements:
packedList.append(AchievementsUtils.packAchievementList(achievementBlockList, vehDossier.getDossierType(), dumpDossier(vehDossier), self._userID is None, True, ACHIEVEMENTS_ALIASES.GREY_COUNTER))
return packedList
示例4: _makeAchievements
def _makeAchievements(dossier):
return AchievementsUtils.packAchievementList(
dossier.getTotalStats().getSignificantAchievements(),
dossier.getDossierType(),
dumpDossier(dossier),
True,
False,
)
示例5: getVO
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}}
示例6: _sendAccountData
def _sendAccountData(self, targetData, accountDossier):
super(ProfileAwards, self)._sendAccountData(targetData, accountDossier)
achievements = targetData.getAchievements()
totalItemsList = []
for block in achievements:
totalItemsList.append(len(block))
if self.__achievementsFilter == PROFILE.SECTION_AWARDS_DROPDOWN_LABELS_INPROCESS:
achievements = targetData.getAchievements(isInDossier=True)
elif self.__achievementsFilter == PROFILE.SECTION_AWARDS_DROPDOWN_LABELS_NONE:
achievements = targetData.getAchievements(isInDossier=False)
packedList = []
for achievementBlockList in achievements:
packedList.append(AchievementsUtils.packAchievementList(achievementBlockList, accountDossier.getDossierType(), dumpDossier(accountDossier), self._userID is None))
self.as_responseDossierS(self._battlesType, {'achievementsList': packedList,
'totalItemsList': totalItemsList,
'battlesCount': targetData.getBattlesCount()}, '', '')
示例7: _receiveVehicleDossier
def _receiveVehicleDossier(self, vehicleIntCD, databaseId):
vehDossier = g_itemsCache.items.getVehicleDossier(vehicleIntCD, databaseId)
achievementsList = None
specialMarksStats = []
if self._battlesType == PROFILE_DROPDOWN_KEYS.ALL:
stats = vehDossier.getRandomStats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
if g_itemsCache.items.getItemByCD(int(vehicleIntCD)).level > 4:
specialMarksStats.append(AchievementsUtils.packAchievement(stats.getAchievement(MARK_ON_GUN_RECORD), vehDossier.getDossierType(), dumpDossier(vehDossier), self._userID is None))
elif self._battlesType == PROFILE_DROPDOWN_KEYS.TEAM:
stats = vehDossier.getTeam7x7Stats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
elif self._battlesType == PROFILE_DROPDOWN_KEYS.STATICTEAM:
stats = vehDossier.getRated7x7Stats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
elif self._battlesType == PROFILE_DROPDOWN_KEYS.HISTORICAL:
stats = vehDossier.getHistoricalStats()
achievementsList = self.__getAchievementsList(stats, vehDossier)
elif self._battlesType == PROFILE_DROPDOWN_KEYS.FORTIFICATIONS_SORTIES:
stats = vehDossier.getFortSortiesStats()
elif self._battlesType == PROFILE_DROPDOWN_KEYS.FORTIFICATIONS_BATTLES:
stats = vehDossier.getFortBattlesStats()
elif self._battlesType == PROFILE_DROPDOWN_KEYS.CLAN:
stats = vehDossier.getGlobalMapStats()
elif self._battlesType == PROFILE_DROPDOWN_KEYS.FALLOUT:
stats = vehDossier.getFalloutStats()
else:
raise ValueError('Profile Technique: Unknown battle type: ' + self._battlesType)
if achievementsList is not None:
achievementsList.insert(0, specialMarksStats)
if self._battlesType == PROFILE_DROPDOWN_KEYS.FORTIFICATIONS_BATTLES:
layout = FORT_STATISTICS_LAYOUT
elif self._battlesType == PROFILE_DROPDOWN_KEYS.FALLOUT:
layout = FALLOUT_STATISTICS_LAYOUT
else:
layout = STATISTICS_LAYOUT
preparedStatistics = DetailedStatisticsUtils.getStatistics(stats, self._userID is None, layout)
self.as_responseVehicleDossierS({'detailedData': preparedStatistics,
'achievements': achievementsList})
return
示例8: _makeAchievements
def _makeAchievements(dossier, club):
achievements = dossier.getTotalStats().getAchievements()
mergedList = list(itertools.chain(*achievements))
isForClubMember = club.hasMember(getAccountDatabaseID())
return AchievementsUtils.packAchievementList(mergedList, dossier.getDossierType(), dumpDossier(dossier), isForClubMember, True)
示例9: __packAchievement
def __packAchievement(achieve, dossierCompDescr):
commonData = AchievementsUtils.getCommonAchievementData(achieve, constants.DOSSIER_TYPE.TANKMAN, dossierCompDescr)
commonData['counterType'] = AchievementsUtils.getCounterType(achieve)
return commonData
示例10: _packAchievement
def _packAchievement(cls, achieve, isUnique = False):
return AchievementsUtils.getBattleResultAchievementData(achieve, achieve.getName(), [], isUnique)
示例11: __makeAchievements
def __makeAchievements(self, dossier, club):
achievements = dossier.getTotalStats().getAchievements()
mergedList = list(itertools.chain(*achievements))
isForClubMember = club.getMember(getPlayerDatabaseID()) is not None
return AchievementsUtils.packAchievementList(mergedList, dossier.getDossierType(), dumpDossier(dossier), isForClubMember, True)