Example #1
0
def _makeMapVO(idx, mapID, mapInfo):
    label = str(idx + 1) + '.'
    mapName = text_styles.main(getArenaFullName(mapID))
    winsEfficiency = mapInfo.wins / float(mapInfo.battlesCount) * 100
    winsEfficiencyStr = BigWorld.wg_getNiceNumberFormat(winsEfficiency) + '%'
    return {'label': text_styles.standard(label + ' ' + mapName),
     'value': text_styles.stats(winsEfficiencyStr)}
Example #2
0
    def onPrbListReceived(self, prebattles):
        listData = []
        playersTotal = 0
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            playersTotal += item.playersCount
            listData.append({
                'id':
                item.prbID,
                'comment':
                item.getCensoredComment(),
                'arena':
                getArenaFullName(item.arenaTypeID),
                'count':
                item.playersCount,
                'total':
                arena.maxPlayersInTeam,
                'owner':
                item.getCreatorFullName(),
                'creatorName':
                item.creator,
                'creatorClan':
                item.clanAbbrev,
                'creatorIgrType':
                item.creatorIgrType,
                'creatorRegion':
                g_lobbyContext.getRegionCode(item.creatorDbId),
                'icon':
                formatters.getMapIconPath(arena, prefix='small/'),
                'disabled':
                not item.isOpened
            })

        self.sendData(listData, playersTotal)
Example #3
0
    def __onTrainingsListReceived(self, prebattles):
        result = []
        totalPlayersCount = 0
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            totalPlayersCount += item.playersCount
            result.append({
                'id':
                item.prbID,
                'comment':
                item.getCensoredComment(),
                'arena':
                getArenaFullName(item.arenaTypeID),
                'count':
                item.playersCount,
                'total':
                arena.maxPlayersInTeam,
                'owner':
                item.getCreatorFullName(),
                'icon':
                formatters.getMapIconPath(arena, prefix='small/'),
                'disabled':
                not item.isOpened
            })

        self.as_setListS(result, totalPlayersCount)
Example #4
0
def _makeMapVO(idx, mapID, mapInfo):
    label = str(idx + 1) + '.'
    mapName = text_styles.main(getArenaFullName(mapID))
    winsEfficiency = mapInfo.wins / float(mapInfo.battlesCount) * 100
    winsEfficiencyStr = BigWorld.wg_getNiceNumberFormat(winsEfficiency) + '%'
    return {
        'label': text_styles.standard(label + ' ' + mapName),
        'value': text_styles.stats(winsEfficiencyStr)
    }
Example #5
0
    def __onTrainingsListReceived(self, prebattles):
        result = []
        totalPlayersCount = 0
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            totalPlayersCount += item.playersCount
            result.append({'id': item.prbID,
             'comment': item.getCensoredComment(),
             'arena': getArenaFullName(item.arenaTypeID),
             'count': item.playersCount,
             'total': arena.maxPlayersInTeam,
             'owner': item.getCreatorFullName(),
             'icon': formatters.getMapIconPath(arena, prefix='small/'),
             'disabled': not item.isOpened})

        self.as_setListS(result, totalPlayersCount)
Example #6
0
    def onLegacyListReceived(self, prebattles):
        if Waiting.isOpened('Flash'):
            Waiting.hide('Flash')
        listData = []
        playersTotal = 0
        addObservers = self.prbEntity.getEntityType() in OBSERVERS_BONUS_TYPES
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            playersTotal += item.playersCount
            maxPlayersInTeam = arena.maxPlayersInTeam
            if addObservers:
                maxPlayersInTeam += PREBATTLE_MAX_OBSERVERS_IN_TEAM
            badge = item.getBadge()
            badgeVO = badge.getBadgeVO(
                ICONS_SIZES.X24, {'isAtlasSource': False}) if badge else {}
            listData.append({
                'id':
                item.prbID,
                'comment':
                item.getCensoredComment(),
                'arena':
                getArenaFullName(item.arenaTypeID),
                'count':
                item.playersCount,
                'total':
                maxPlayersInTeam,
                'owner':
                item.getCreatorFullName(),
                'creatorName':
                item.creator,
                'creatorClan':
                item.clanAbbrev,
                'creatorIgrType':
                item.creatorIgrType,
                'creatorRegion':
                self._lobbyContext.getRegionCode(item.creatorDbId),
                'icon':
                formatters.getMapIconPath(arena, prefix='small/'),
                'disabled':
                not item.isOpened,
                'badgeVisualVO':
                badgeVO
            })

        self.sendData(listData, playersTotal)
Example #7
0
    def onPrbListReceived(self, prebattles):
        listData = []
        playersTotal = 0
        for item in prebattles:
            arena = ArenaType.g_cache[item.arenaTypeID]
            playersTotal += item.playersCount
            listData.append({'id': item.prbID,
             'comment': item.getCensoredComment(),
             'arena': getArenaFullName(item.arenaTypeID),
             'count': item.playersCount,
             'total': arena.maxPlayersInTeam,
             'owner': item.getCreatorFullName(),
             'creatorName': item.creator,
             'creatorClan': item.clanAbbrev,
             'creatorIgrType': item.creatorIgrType,
             'creatorRegion': g_lobbyContext.getRegionCode(item.creatorDbId),
             'icon': formatters.getMapIconPath(arena, prefix='small/'),
             'disabled': not item.isOpened})

        self.sendData(listData, playersTotal)