コード例 #1
0
    def __prepareAndPassVehiclesData(self):
        values = []
        for vehicleCD in g_itemsCache.items.stats.eliteVehicles:
            try:
                vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
                if not vehicle.xp:
                    continue
                values.append({'id': vehicle.intCD,
                 'vehicleType': getVehicleTypeAssetPath(vehicle.type),
                 'vehicleName': vehicle.shortUserName,
                 'xp': vehicle.xp,
                 'xpStrValue': BigWorld.wg_getIntegralFormat(vehicle.xp),
                 'isSelectCandidate': vehicle.isFullyElite,
                 'vehicleIco': vehicle.iconSmall,
                 'nationIco': getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31)})
            except:
                continue

        labelBuilder = builder().addStyledText('middleTitle', i18n.makeString(MENU.EXCHANGE_RATE))
        if self.__xpForFree is not None:
            labelBuilder.addStyledText(self.__getActionStyle(), i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_LABEL))
            labelBuilder.addStyledText('expText', i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_VALUE, icon=icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ELITEXPICON_2), forFree=BigWorld.wg_getNiceNumberFormat(self.__xpForFree)))
        exchangeHeaderData = {'labelText': labelBuilder.render(),
         'rateFromIcon': ICON_TEXT_FRAMES.GOLD,
         'rateToIcon': ICON_TEXT_FRAMES.ELITE_XP,
         'rateFromTextColor': self.app.colorManager.getColorScheme('textColorGold').get('rgb'),
         'rateToTextColor': self.app.colorManager.getColorScheme('textColorCredits').get('rgb')}
        vehicleData = {'isHaveElite': bool(values),
         'vehicleList': values,
         'tableHeader': self._getTableHeader(),
         'xpForFree': self.__xpForFree,
         'exchangeHeaderData': exchangeHeaderData}
        self.as_vehiclesDataChangedS(vehicleData)
        return
コード例 #2
0
    def __prepareAndPassVehiclesData(self):
        values = []
        for vehicleCD in g_itemsCache.items.stats.eliteVehicles:
            try:
                vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
                if not vehicle.xp:
                    continue
                values.append({'id': vehicle.intCD,
                 'vehicleType': getVehicleTypeAssetPath(vehicle.type),
                 'vehicleName': vehicle.shortUserName,
                 'xp': vehicle.xp,
                 'isSelectCandidate': vehicle.isFullyElite,
                 'vehicleIco': vehicle.iconSmall,
                 'nationIco': getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31)})
            except:
                continue

        labelBuilder = builder().addStyledText('middleTitle', i18n.makeString(MENU.EXCHANGE_RATE))
        if self.__xpForFree is not None:
            labelBuilder.addStyledText(self.__getActionStyle(), i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_LABEL))
            labelBuilder.addStyledText('expText', i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_VALUE, icon=icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ELITEXPICON_2), forFree=BigWorld.wg_getNiceNumberFormat(self.__xpForFree)))
        vehicleData = {'isHaveElite': bool(values),
         'vehicleList': values,
         'tableHeader': self._getTableHeader(),
         'xpForFree': self.__xpForFree,
         'rateLabel': labelBuilder.render(),
         'xpAction': g_itemsCache.items.shop.isXPConversionActionActive}
        self.as_vehiclesDataChangedS(vehicleData)
        return
コード例 #3
0
    def __prepareAndPassVehiclesData(self):
        values = []
        for vehicleCD in g_itemsCache.items.stats.eliteVehicles:
            try:
                vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
                if not vehicle.xp:
                    continue
                values.append({'id': vehicle.intCD,
                 'vehicleType': getVehicleTypeAssetPath(vehicle.type),
                 'vehicleName': vehicle.shortUserName,
                 'xp': vehicle.xp,
                 'xpStrValue': BigWorld.wg_getIntegralFormat(vehicle.xp),
                 'isSelectCandidate': vehicle.isFullyElite,
                 'vehicleIco': vehicle.iconSmall,
                 'nationIco': getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31)})
            except:
                continue

        labelBuilder = builder().addStyledText('middleTitle', i18n.makeString(MENU.EXCHANGE_RATE))
        if self.__xpForFree is not None:
            labelBuilder.addStyledText(self.__getActionStyle(), i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_LABEL))
            labelBuilder.addStyledText('expText', i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_VALUE, icon=icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ELITEXPICON_2), forFree=BigWorld.wg_getNiceNumberFormat(self.__xpForFree)))
        exchangeHeaderData = {'labelText': labelBuilder.render(),
         'rateFromIcon': ICON_TEXT_FRAMES.GOLD,
         'rateToIcon': ICON_TEXT_FRAMES.ELITE_XP,
         'rateFromTextColor': self.app.colorManager.getColorScheme('textColorGold').get('rgb'),
         'rateToTextColor': self.app.colorManager.getColorScheme('textColorCredits').get('rgb')}
        vehicleData = {'isHaveElite': bool(values),
         'vehicleList': values,
         'tableHeader': self._getTableHeader(),
         'xpForFree': self.__xpForFree,
         'exchangeHeaderData': exchangeHeaderData}
        self.as_vehiclesDataChangedS(vehicleData)
        return
コード例 #4
0
    def __prepareAndPassVehiclesData(self):
        eliteVcls = g_itemsCache.items.stats.eliteVehicles
        xps = g_itemsCache.items.stats.vehiclesXPs
        unlocks = g_itemsCache.items.stats.unlocks
        values = []

        def getSmallIcon(vehType):
            return '../maps/icons/vehicle/small/%s.png' % vehType.name.replace(
                ':', '-')

        for vehicleCD in eliteVcls:
            vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
            if vehicle.descriptor.type.compactDescr in eliteVcls:
                xp = xps.get(vehicle.descriptor.type.compactDescr, 0)
                if not xp:
                    continue
                isSelectCandidate = getVehicleEliteState(
                    vehicle, eliteVcls,
                    unlocks) == VEHICLE_ELITE_STATE.FULLY_ELITE
                vehicleInfo = dict(
                    id=vehicle.intCD,
                    vehicleType=getVehicleTypeAssetPath(vehicle.type),
                    vehicleName=vehicle.shortUserName,
                    xp=xp,
                    isSelectCandidate=isSelectCandidate,
                    vehicleIco=getSmallIcon(vehicle.descriptor.type),
                    nationIco=getNationsAssetPath(
                        vehicle.nationID,
                        namePrefix=NATION_ICON_PREFIX_131x31))
                values.append(vehicleInfo)

        self.as_vehiclesDataChangedS(bool(values), values)
コード例 #5
0
    def __prepareAndPassVehiclesData(self):
        values = []
        for vehicleCD in g_itemsCache.items.stats.eliteVehicles:
            try:
                vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
                if not vehicle.xp:
                    continue
                values.append({
                    'id':
                    vehicle.intCD,
                    'vehicleType':
                    getVehicleTypeAssetPath(vehicle.type),
                    'vehicleName':
                    vehicle.shortUserName,
                    'xp':
                    vehicle.xp,
                    'isSelectCandidate':
                    vehicle.isFullyElite,
                    'vehicleIco':
                    vehicle.iconSmall,
                    'nationIco':
                    getNationsAssetPath(vehicle.nationID,
                                        namePrefix=NATION_ICON_PREFIX_131x31)
                })
            except:
                continue

        labelBuilder = builder().addStyledText(
            'middleTitle', i18n.makeString(MENU.EXCHANGE_RATE))
        if self.__xpForFree is not None:
            labelBuilder.addStyledText(
                self.__getActionStyle(),
                i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_LABEL))
            labelBuilder.addStyledText(
                'expText',
                i18n.makeString(
                    MENU.EXCHANGEXP_AVAILABLE_FORFREE_VALUE,
                    icon=icons.makeImageTag(
                        RES_ICONS.MAPS_ICONS_LIBRARY_ELITEXPICON_2),
                    forFree=BigWorld.wg_getNiceNumberFormat(self.__xpForFree)))
        vehicleData = {
            'isHaveElite': bool(values),
            'vehicleList': values,
            'tableHeader': self._getTableHeader(),
            'xpForFree': self.__xpForFree,
            'rateLabel': labelBuilder.render(),
            'xpAction': g_itemsCache.items.shop.isXPConversionActionActive
        }
        self.as_vehiclesDataChangedS(vehicleData)
コード例 #6
0
    def __prepareAndPassVehiclesData(self):
        values = []
        for vehicleCD in g_itemsCache.items.stats.eliteVehicles:
            try:
                vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
                if not vehicle.xp:
                    continue
                values.append({'id': vehicle.intCD,
                 'vehicleType': getVehicleTypeAssetPath(vehicle.type),
                 'vehicleName': vehicle.shortUserName,
                 'xp': vehicle.xp,
                 'isSelectCandidate': vehicle.isFullyElite,
                 'vehicleIco': vehicle.iconSmall,
                 'nationIco': getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31)})
            except:
                continue

        self.as_vehiclesDataChangedS(bool(values), values)
コード例 #7
0
    def __prepareAndPassVehiclesData(self):
        values = []
        for vehicleCD in g_itemsCache.items.stats.eliteVehicles:
            try:
                vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
                if not vehicle.xp:
                    continue
                values.append(
                    {
                        "id": vehicle.intCD,
                        "vehicleType": getVehicleTypeAssetPath(vehicle.type),
                        "vehicleName": vehicle.shortUserName,
                        "xp": vehicle.xp,
                        "isSelectCandidate": vehicle.isFullyElite,
                        "vehicleIco": vehicle.iconSmall,
                        "nationIco": getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31),
                    }
                )
            except:
                continue

        labelBuilder = builder().addStyledText("middleTitle", i18n.makeString(MENU.EXCHANGE_RATE))
        if self.__xpForFree is not None:
            labelBuilder.addStyledText(
                self.__getActionStyle(), i18n.makeString(MENU.EXCHANGEXP_AVAILABLE_FORFREE_LABEL)
            )
            labelBuilder.addStyledText(
                "expText",
                i18n.makeString(
                    MENU.EXCHANGEXP_AVAILABLE_FORFREE_VALUE,
                    icon=icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ELITEXPICON_2),
                    forFree=BigWorld.wg_getNiceNumberFormat(self.__xpForFree),
                ),
            )
        vehicleData = {
            "isHaveElite": bool(values),
            "vehicleList": values,
            "tableHeader": self._getTableHeader(),
            "xpForFree": self.__xpForFree,
            "rateLabel": labelBuilder.render(),
        }
        self.as_vehiclesDataChangedS(vehicleData)
        return
コード例 #8
0
    def __prepareAndPassVehiclesData(self):
        eliteVcls = g_itemsCache.items.stats.eliteVehicles
        xps = g_itemsCache.items.stats.vehiclesXPs
        unlocks = g_itemsCache.items.stats.unlocks
        values = []

        def getSmallIcon(vehType):
            return '../maps/icons/vehicle/small/%s.png' % vehType.name.replace(':', '-')

        for vehicleCD in eliteVcls:
            vehicle = g_itemsCache.items.getItemByCD(vehicleCD)
            if vehicle.descriptor.type.compactDescr in eliteVcls:
                xp = xps.get(vehicle.descriptor.type.compactDescr, 0)
                if not xp:
                    continue
                isSelectCandidate = getVehicleEliteState(vehicle, eliteVcls, unlocks) == VEHICLE_ELITE_STATE.FULLY_ELITE
                vehicleInfo = dict(id=vehicle.intCD, vehicleType=getVehicleTypeAssetPath(vehicle.type), vehicleName=vehicle.shortUserName, xp=xp, isSelectCandidate=isSelectCandidate, vehicleIco=getSmallIcon(vehicle.descriptor.type), nationIco=getNationsAssetPath(vehicle.nationID, namePrefix=NATION_ICON_PREFIX_131x31))
                values.append(vehicleInfo)

        self.as_vehiclesDataChangedS(bool(values), values)