当前位置: 首页>>代码示例>>Python>>正文


Python Tankman.getRoleBigIconPath方法代码示例

本文整理汇总了Python中gui.shared.gui_items.Tankman.getRoleBigIconPath方法的典型用法代码示例。如果您正苦于以下问题:Python Tankman.getRoleBigIconPath方法的具体用法?Python Tankman.getRoleBigIconPath怎么用?Python Tankman.getRoleBigIconPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.shared.gui_items.Tankman的用法示例。


在下文中一共展示了Tankman.getRoleBigIconPath方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: packTankman

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
def packTankman(tankman, isCountPermanentSkills=True):
    def vehicleIcon(vDescr, subtype=""):
        return _ICONS_MASK % {"type": "vehicle", "subtype": subtype, "unicName": vDescr.name.replace(":", "-")}

    nativeVehicleData = {
        "typeCompDescr": tankman.vehicleNativeDescr.type.compactDescr,
        "userName": Vehicle.getShortUserName(tankman.vehicleNativeDescr.type),
        "icon": vehicleIcon(tankman.vehicleNativeDescr),
        "iconContour": vehicleIcon(tankman.vehicleNativeDescr, "contour/"),
    }
    currentVehicleData = None
    if tankman.isInTank:
        currentVehicleData = {
            "inventoryID": tankman.vehicleInvID,
            "typeCompDescr": tankman.vehicleDescr.type.compactDescr,
            "userName": Vehicle.getShortUserName(tankman.vehicleDescr.type),
            "icon": vehicleIcon(tankman.vehicleDescr),
            "iconContour": vehicleIcon(tankman.vehicleDescr, "contour/"),
        }
    skills = []
    tManFreeSkillsNum = tankman.descriptor.freeSkillsNumber
    startSkillNumber = 0 if isCountPermanentSkills else tManFreeSkillsNum
    tManSkills = tankman.skills
    for i in range(startSkillNumber, len(tManSkills)):
        skills.append(packTankmanSkill(tManSkills[i], isPermanent=True if i < tManFreeSkillsNum else False))

    return {
        "strCD": cPickle.dumps(tankman.strCD),
        "inventoryID": tankman.invID,
        "nationID": tankman.nationID,
        "firstUserName": tankman.firstUserName,
        "lastUserName": tankman.lastUserName,
        "roleName": tankman.descriptor.role,
        "rankUserName": tankman.rankUserName,
        "roleUserName": tankman.roleUserName,
        "skills": skills,
        "efficiencyRoleLevel": tankman.efficiencyRoleLevel,
        "realRoleLevel": tankman.realRoleLevel,
        "roleLevel": tankman.roleLevel,
        "icon": {
            "big": Tankman.getBigIconPath(tankman.nationID, tankman.descriptor.iconID),
            "small": Tankman.getSmallIconPath(tankman.nationID, tankman.descriptor.iconID),
            "barracks": Tankman.getBarracksIconPath(tankman.nationID, tankman.descriptor.iconID),
        },
        "iconRole": {
            "big": Tankman.getRoleBigIconPath(tankman.descriptor.role),
            "medium": Tankman.getRoleMediumIconPath(tankman.descriptor.role),
            "small": Tankman.getRoleSmallIconPath(tankman.descriptor.role),
        },
        "iconRank": {
            "big": Tankman.getRankBigIconPath(tankman.nationID, tankman.descriptor.rankID),
            "small": Tankman.getRankSmallIconPath(tankman.nationID, tankman.descriptor.rankID),
        },
        "isInTank": tankman.isInTank,
        "newSkillsCount": tankman.newSkillCount,
        "nativeVehicle": nativeVehicleData,
        "currentVehicle": currentVehicleData,
    }
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:60,代码来源:serializers.py

示例2: packTankman

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
def packTankman(tankman, isCountPermanentSkills = True):

    def vehicleIcon(vDescr, subtype = ''):
        return _ICONS_MASK % {'type': 'vehicle',
         'subtype': subtype,
         'unicName': vDescr.name.replace(':', '-')}

    nativeVehicleData = {'typeCompDescr': tankman.vehicleNativeDescr.type.compactDescr,
     'userName': Vehicle.getShortUserName(tankman.vehicleNativeDescr.type),
     'icon': vehicleIcon(tankman.vehicleNativeDescr),
     'iconContour': vehicleIcon(tankman.vehicleNativeDescr, 'contour/')}
    currentVehicleData = None
    if tankman.isInTank:
        currentVehicleData = {'inventoryID': tankman.vehicleInvID,
         'typeCompDescr': tankman.vehicleDescr.type.compactDescr,
         'userName': Vehicle.getShortUserName(tankman.vehicleDescr.type),
         'icon': vehicleIcon(tankman.vehicleDescr),
         'iconContour': vehicleIcon(tankman.vehicleDescr, 'contour/')}
    skills = []
    tManFreeSkillsNum = tankman.descriptor.freeSkillsNumber
    startSkillNumber = 0 if isCountPermanentSkills else tManFreeSkillsNum
    tManSkills = tankman.skills
    for i in range(startSkillNumber, len(tManSkills)):
        skills.append(packTankmanSkill(tManSkills[i], isPermanent=True if i < tManFreeSkillsNum else False))

    return {'strCD': cPickle.dumps(tankman.strCD),
     'inventoryID': tankman.invID,
     'nationID': tankman.nationID,
     'firstUserName': tankman.firstUserName,
     'lastUserName': tankman.lastUserName,
     'roleName': tankman.descriptor.role,
     'rankUserName': tankman.rankUserName,
     'roleUserName': tankman.roleUserName,
     'skills': skills,
     'efficiencyRoleLevel': tankman.efficiencyRoleLevel,
     'realRoleLevel': tankman.realRoleLevel,
     'roleLevel': tankman.roleLevel,
     'icon': {'big': Tankman.getBigIconPath(tankman.nationID, tankman.descriptor.iconID),
              'small': Tankman.getSmallIconPath(tankman.nationID, tankman.descriptor.iconID),
              'barracks': Tankman.getBarracksIconPath(tankman.nationID, tankman.descriptor.iconID)},
     'iconRole': {'big': Tankman.getRoleBigIconPath(tankman.descriptor.role),
                  'medium': Tankman.getRoleMediumIconPath(tankman.descriptor.role),
                  'small': Tankman.getRoleSmallIconPath(tankman.descriptor.role)},
     'iconRank': {'big': Tankman.getRankBigIconPath(tankman.nationID, tankman.descriptor.rankID),
                  'small': Tankman.getRankSmallIconPath(tankman.nationID, tankman.descriptor.rankID)},
     'isInTank': tankman.isInTank,
     'newSkillsCount': tankman.newSkillCount,
     'nativeVehicle': nativeVehicleData,
     'currentVehicle': currentVehicleData}
开发者ID:webiumsk,项目名称:WOT-0.9.15.1,代码行数:51,代码来源:serializers.py

示例3: _packTankmanData

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
def _packTankmanData(tankman):
    tankmanVehicle = g_itemsCache.items.getItemByCD(tankman.vehicleNativeDescr.type.compactDescr)
    if tankman.isInTank:
        vehicle = g_itemsCache.items.getVehicle(tankman.vehicleInvID)
        if vehicle is None:
            LOG_ERROR('Cannot find vehicle for tankman: ', tankman, tankman.descriptor.role, tankman.vehicle.name, tankman.firstname, tankman.lastname)
            return
        vehicleID = vehicle.invID
        slot = tankman.vehicleSlotIdx
        isLocked, msg = _getTankmanLockMessage(vehicle)
        actionBtnEnabled = not isLocked
        isInCurrentTank = g_currentVehicle.isPresent() and tankmanVehicle.invID == g_currentVehicle.invID
        isInSelfVehicle = vehicle.shortUserName == tankmanVehicle.shortUserName
        isInSelfVehicleType = vehicle.type == tankmanVehicle.type
    else:
        isLocked, msg = False, ''
        actionBtnEnabled = True
        isInCurrentTank = False
        vehicleID = None
        slot = None
        isInSelfVehicle = True
        isInSelfVehicleType = True
    data = {'firstName': tankman.firstUserName,
     'lastName': tankman.lastUserName,
     'rank': tankman.rankUserName,
     'specializationLevel': tankman.realRoleLevel[0],
     'role': tankman.roleUserName,
     'vehicleType': tankmanVehicle.shortUserName,
     'iconFile': tankman.icon,
     'rankIconFile': tankman.iconRank,
     'roleIconFile': Tankman.getRoleBigIconPath(tankman.descriptor.role),
     'contourIconFile': tankmanVehicle.iconContour,
     'tankmanID': tankman.invID,
     'nationID': tankman.nationID,
     'typeID': tankmanVehicle.innationID,
     'roleType': tankman.descriptor.role,
     'tankType': tankmanVehicle.type,
     'inTank': tankman.isInTank,
     'compact': str(tankman.invID),
     'lastSkillLevel': tankman.descriptor.lastSkillLevel,
     'actionBtnEnabled': actionBtnEnabled,
     'inCurrentTank': isInCurrentTank,
     'vehicleID': vehicleID,
     'slot': slot,
     'locked': isLocked,
     'lockMessage': msg,
     'isInSelfVehicleClass': isInSelfVehicleType,
     'isInSelfVehicleType': isInSelfVehicle}
    return data
开发者ID:aevitas,项目名称:wotsdk,代码行数:51,代码来源:barracksbarracks.py

示例4: packTankman

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
def packTankman(tankman, isCountPermanentSkills = True):

    def vehicleIcon(vDescr, subtype = ''):
        return _ICONS_MASK % {'type': 'vehicle',
         'subtype': subtype,
         'unicName': vDescr.name.replace(':', '-')}

    nativeVehicleData = {'typeCompDescr': tankman.vehicleNativeDescr.type.compactDescr,
     'userName': tankman.vehicleNativeDescr.type.shortUserString,
     'icon': vehicleIcon(tankman.vehicleNativeDescr),
     'iconContour': vehicleIcon(tankman.vehicleNativeDescr, 'contour/')}
    currentVehicleData = None
    if tankman.isInTank:
        currentVehicleData = {'inventoryID': tankman.vehicleInvID,
         'typeCompDescr': tankman.vehicleDescr.type.compactDescr,
         'userName': tankman.vehicleDescr.type.shortUserString,
         'icon': vehicleIcon(tankman.vehicleDescr),
         'iconContour': vehicleIcon(tankman.vehicleDescr, 'contour/')}
    skills = []
    for skill in tankman.skills:
        if not (skill.name == 'brotherhood' and tankman.descriptor.isFemale and not isCountPermanentSkills):
            skills.append(packTankmanSkill(skill))

    return {'strCD': cPickle.dumps(tankman.strCD),
     'inventoryID': tankman.invID,
     'nationID': tankman.nationID,
     'firstUserName': tankman.firstUserName,
     'lastUserName': tankman.lastUserName,
     'roleName': tankman.descriptor.role,
     'rankUserName': tankman.rankUserName,
     'roleUserName': tankman.roleUserName,
     'skills': skills,
     'efficiencyRoleLevel': tankman.efficiencyRoleLevel,
     'realRoleLevel': tankman.realRoleLevel,
     'roleLevel': tankman.roleLevel,
     'icon': {'big': Tankman.getBigIconPath(tankman.nationID, tankman.descriptor.iconID),
              'small': Tankman.getSmallIconPath(tankman.nationID, tankman.descriptor.iconID),
              'barracks': Tankman.getBarracksIconPath(tankman.nationID, tankman.descriptor.iconID)},
     'iconRole': {'big': Tankman.getRoleBigIconPath(tankman.descriptor.role),
                  'medium': Tankman.getRoleMediumIconPath(tankman.descriptor.role),
                  'small': Tankman.getRoleSmallIconPath(tankman.descriptor.role)},
     'iconRank': {'big': Tankman.getRankBigIconPath(tankman.nationID, tankman.descriptor.rankID),
                  'small': Tankman.getRankSmallIconPath(tankman.nationID, tankman.descriptor.rankID)},
     'isInTank': tankman.isInTank,
     'newSkillsCount': tankman.newSkillCount,
     'nativeVehicle': nativeVehicleData,
     'currentVehicle': currentVehicleData}
开发者ID:webiumsk,项目名称:WoT,代码行数:49,代码来源:serializers.py

示例5: updateTankmen

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
    def updateTankmen(self):
        Waiting.show('updateTankmen')
        if g_currentVehicle.isPresent():
            tankmen = g_itemsCache.items.getTankmen()
            vehicle = g_currentVehicle.item
            commander_bonus = vehicle.bonuses['commander']
            roles = []
            lessMastered = 0
            tankmenDescrs = dict(vehicle.crew)
            for slotIdx, tman in vehicle.crew:
                if slotIdx > 0 and tman is not None and (tankmenDescrs[lessMastered] is None or compareMastery(tankmenDescrs[lessMastered].descriptor, tman.descriptor) > 0):
                    lessMastered = slotIdx
                role = vehicle.descriptor.type.crewRoles[slotIdx][0]
                roles.append({'tankmanID': tman.invID if tman is not None else None,
                 'roleType': role,
                 'role': convert(getSkillsConfig()[role]['userString']),
                 'roleIcon': Tankman.getRoleBigIconPath(role),
                 'nationID': vehicle.nationID,
                 'typeID': vehicle.innationID,
                 'slot': slotIdx,
                 'vehicleType': vehicle.shortUserName,
                 'tankType': vehicle.type,
                 'vehicleElite': vehicle.isPremium or vehicle.isPremiumIGR,
                 'roles': list(vehicle.descriptor.type.crewRoles[slotIdx])})

            tankmenData = []
            for tankman in tankmen.itervalues():
                if tankman.isInTank and tankman.vehicleInvID != vehicle.invID:
                    continue
                tankmanVehicle = g_itemsCache.items.getItemByCD(tankman.vehicleNativeDescr.type.compactDescr)
                bonus_role_level = commander_bonus if tankman.descriptor.role != 'commander' else 0.0
                skills_count = len(list(ACTIVE_SKILLS))
                skillsList = []
                for skill in tankman.skills:
                    skillsList.append({'tankmanID': tankman.invID,
                     'id': str(tankman.skills.index(skill)),
                     'name': skill.userName,
                     'desc': skill.description,
                     'icon': skill.icon,
                     'level': skill.level,
                     'active': skill.isEnable and skill.isActive})

                newSkillsCount, lastNewSkillLvl = tankman.newSkillCount
                if newSkillsCount > 0:
                    skillsList.append({'buy': True,
                     'tankmanID': tankman.invID,
                     'level': lastNewSkillLvl})
                tankmanData = {'firstName': tankman.firstUserName,
                 'lastName': tankman.lastUserName,
                 'rank': tankman.rankUserName,
                 'specializationLevel': tankman.realRoleLevel[0],
                 'role': tankman.roleUserName,
                 'vehicleType': tankmanVehicle.shortUserName,
                 'iconFile': tankman.icon,
                 'rankIconFile': tankman.iconRank,
                 'roleIconFile': Tankman.getRoleBigIconPath(tankman.descriptor.role),
                 'contourIconFile': tankmanVehicle.iconContour,
                 'tankmanID': tankman.invID,
                 'nationID': tankman.nationID,
                 'typeID': tankmanVehicle.innationID,
                 'inTank': tankman.isInTank,
                 'roleType': tankman.descriptor.role,
                 'tankType': tankmanVehicle.type,
                 'efficiencyLevel': tankman.efficiencyRoleLevel,
                 'bonus': bonus_role_level,
                 'lastSkillLevel': tankman.descriptor.lastSkillLevel,
                 'isLessMastered': vehicle.crewIndices.get(tankman.invID) == lessMastered and vehicle.isXPToTman,
                 'compact': tankman.strCD,
                 'availableSkillsCount': skills_count,
                 'skills': skillsList}
                tankmenData.append(tankmanData)

            self.as_tankmenResponseS({'roles': roles,
             'tankmen': tankmenData})
            dogName = ''
            if 'dog' in g_itemsCache.items.getItemByCD(g_currentVehicle.item.intCD).tags:
                dogName = MENU.HANGAR_CREW_RODY_DOG_NAME
            self.as_dogResponseS(dogName)
        Waiting.hide('updateTankmen')
        return
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:82,代码来源:crew.py

示例6: __updateTankmen

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
    def __updateTankmen(self, *args):
        tankmen = g_itemsCache.items.getTankmen().values()
        slots = g_itemsCache.items.stats.tankmenBerthsCount
        berths = g_itemsCache.items.stats.tankmenBerthsCount
        berthPrice = g_itemsCache.items.shop.getTankmanBerthPrice(berths)
        defaultBerthPrice = g_itemsCache.items.shop.defaults.getTankmanBerthPrice(berths)
        tankmenList = list()
        tankmenInBarracks = 0
        tankmenInSlots = 0
        action = None
        if berthPrice[0] != defaultBerthPrice[0]:
            action = {'type': ACTION_TOOLTIPS_TYPE.ECONOMICS,
             'key': 'berthsPrices',
             'isBuying': True,
             'state': (None, ACTION_TOOLTIPS_STATE.DISCOUNT),
             'newPrice': (0, berthPrice[0]),
             'oldPrice': (0, defaultBerthPrice[0])}
        tankmenList.append({'buy': True,
         'price': BigWorld.wg_getGoldFormat(berthPrice[0]),
         'actionPriceData': action,
         'count': berthPrice[1]})
        for tankman in sorted(tankmen, TankmenComparator(g_itemsCache.items.getVehicle)):
            if not tankman.isInTank:
                tankmenInBarracks += 1
            slot, vehicleID, vehicleInnationID, vehicle = (None, None, None, None)
            if tankman.isInTank:
                vehicle = g_itemsCache.items.getVehicle(tankman.vehicleInvID)
                vehicleID = vehicle.invID
                vehicleInnationID = vehicle.innationID
                if vehicle is None:
                    LOG_ERROR('Cannot find vehicle for tankman: ', tankman, tankman.descriptor.role, tankman.vehicle.name, tankman.firstname, tankman.lastname)
                    continue
                slot = tankman.vehicleSlotIdx
            if self.filter['nation'] != -1 and tankman.nationID != self.filter['nation'] or self.filter['role'] != 'None' and tankman.descriptor.role != self.filter['role'] or self.filter['tankType'] != 'None' and tankman.vehicleNativeType != self.filter['tankType'] or self.filter['location'] == 'tanks' and tankman.isInTank != True or self.filter['location'] == 'barracks' and tankman.isInTank == True or self.filter['nationID'] is not None and (self.filter['location'] != str(vehicleInnationID) or self.filter['nationID'] != str(tankman.nationID)):
                continue
            isLocked, msg = self.getTankmanLockMessage(vehicle) if tankman.isInTank else (False, '')
            tankmanVehicle = g_itemsCache.items.getItemByCD(tankman.vehicleNativeDescr.type.compactDescr)
            isInCurrentTank = tankmanVehicle.invID == g_currentVehicle.invID if tankman.isInTank and g_currentVehicle.isPresent() else False
            tankmenList.append({'firstname': tankman.firstUserName,
             'lastname': tankman.lastUserName,
             'rank': tankman.rankUserName,
             'specializationLevel': tankman.realRoleLevel[0],
             'role': tankman.roleUserName,
             'vehicleType': tankmanVehicle.shortUserName,
             'iconFile': tankman.icon,
             'rankIconFile': tankman.iconRank,
             'roleIconFile': Tankman.getRoleBigIconPath(tankman.descriptor.role),
             'contourIconFile': tankmanVehicle.iconContour,
             'tankmanID': tankman.invID,
             'nationID': tankman.nationID,
             'typeID': tankmanVehicle.innationID,
             'slot': slot,
             'roleType': tankman.descriptor.role,
             'tankType': tankmanVehicle.type,
             'inTank': tankman.isInTank,
             'inCurrentTank': isInCurrentTank,
             'vehicleID': vehicleID,
             'compact': str(tankman.invID),
             'locked': isLocked,
             'lockMessage': msg,
             'vehicleBroken': vehicle.repairCost > 0 if tankman.isInTank else None,
             'isInSelfVehicleClass': vehicle.type == tankmanVehicle.type if tankman.isInTank else True,
             'isInSelfVehicleType': vehicle.shortUserName == tankmanVehicle.shortUserName if tankman.isInTank else True})

        tankmenInSlots = len(tankmenList) - 1
        if tankmenInBarracks < slots:
            tankmenList.insert(1, {'empty': True,
             'freePlaces': slots - tankmenInBarracks})
        self.as_setTankmenS(len(tankmen), tankmenInSlots, slots, tankmenInBarracks, tankmenList)
        return
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:72,代码来源:barracks.py

示例7: __updateTankmen

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
    def __updateTankmen(self, *args):
        tankmen = g_itemsCache.items.getTankmen().values()
        slots = g_itemsCache.items.stats.tankmenBerthsCount
        berths = g_itemsCache.items.stats.tankmenBerthsCount
        berthPrice = g_itemsCache.items.shop.getTankmanBerthPrice(berths)
        defaultBerthPrice = g_itemsCache.items.shop.defaults.getTankmanBerthPrice(berths)
        tankmenList = list()
        tankmenInBarracks = 0
        tankmenInSlots = 0
        action = None
        if berthPrice[0] != defaultBerthPrice[0]:
            action = {
                "type": ACTION_TOOLTIPS_TYPE.ECONOMICS,
                "key": "berthsPrices",
                "isBuying": True,
                "state": (None, ACTION_TOOLTIPS_STATE.DISCOUNT),
                "newPrice": (0, berthPrice[0]),
                "oldPrice": (0, defaultBerthPrice[0]),
            }
        tankmenList.append(
            {
                "buy": True,
                "price": BigWorld.wg_getGoldFormat(berthPrice[0]),
                "actionPriceData": action,
                "count": berthPrice[1],
            }
        )
        for tankman in sorted(tankmen, TankmenComparator(g_itemsCache.items.getVehicle)):
            if not tankman.isInTank:
                tankmenInBarracks += 1
            slot, vehicleID, vehicleInnationID, vehicle = (None, None, None, None)
            if tankman.isInTank:
                vehicle = g_itemsCache.items.getVehicle(tankman.vehicleInvID)
                vehicleID = vehicle.invID
                vehicleInnationID = vehicle.innationID
                if vehicle is None:
                    LOG_ERROR(
                        "Cannot find vehicle for tankman: ",
                        tankman,
                        tankman.descriptor.role,
                        tankman.vehicle.name,
                        tankman.firstname,
                        tankman.lastname,
                    )
                    continue
                slot = tankman.vehicleSlotIdx
            if (
                self.filter["nation"] != -1
                and tankman.nationID != self.filter["nation"]
                or self.filter["role"] != "None"
                and tankman.descriptor.role != self.filter["role"]
                or self.filter["tankType"] != "None"
                and tankman.vehicleNativeType != self.filter["tankType"]
                or self.filter["location"] == "tanks"
                and tankman.isInTank != True
                or self.filter["location"] == "barracks"
                and tankman.isInTank == True
                or self.filter["nationID"] is not None
                and (
                    self.filter["location"] != str(vehicleInnationID)
                    or self.filter["nationID"] != str(tankman.nationID)
                )
            ):
                continue
            isLocked, msg = self.getTankmanLockMessage(vehicle) if tankman.isInTank else (False, "")
            tankmanVehicle = g_itemsCache.items.getItemByCD(tankman.vehicleNativeDescr.type.compactDescr)
            isInCurrentTank = (
                tankmanVehicle.invID == g_currentVehicle.invID
                if tankman.isInTank and g_currentVehicle.isPresent()
                else False
            )
            tankmenList.append(
                {
                    "firstname": tankman.firstUserName,
                    "lastname": tankman.lastUserName,
                    "rank": tankman.rankUserName,
                    "specializationLevel": tankman.realRoleLevel[0],
                    "role": tankman.roleUserName,
                    "vehicleType": tankmanVehicle.shortUserName,
                    "iconFile": tankman.icon,
                    "rankIconFile": tankman.iconRank,
                    "roleIconFile": Tankman.getRoleBigIconPath(tankman.descriptor.role),
                    "contourIconFile": tankmanVehicle.iconContour,
                    "tankmanID": tankman.invID,
                    "nationID": tankman.nationID,
                    "typeID": tankmanVehicle.innationID,
                    "slot": slot,
                    "roleType": tankman.descriptor.role,
                    "tankType": tankmanVehicle.type,
                    "inTank": tankman.isInTank,
                    "inCurrentTank": isInCurrentTank,
                    "vehicleID": vehicleID,
                    "compact": str(tankman.invID),
                    "locked": isLocked,
                    "lockMessage": msg,
                    "vehicleBroken": vehicle.repairCost > 0 if tankman.isInTank else None,
                    "isInSelfVehicleClass": vehicle.type == tankmanVehicle.type if tankman.isInTank else True,
                    "isInSelfVehicleType": vehicle.shortUserName == tankmanVehicle.shortUserName
                    if tankman.isInTank
                    else True,
#.........这里部分代码省略.........
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:103,代码来源:barracks.py

示例8: updateTankmen

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleBigIconPath [as 别名]
    def updateTankmen(self):
        Waiting.show("updateTankmen")
        if g_currentVehicle.isPresent():
            tankmen = g_itemsCache.items.getTankmen()
            vehicle = g_currentVehicle.item
            commander_bonus = vehicle.bonuses["commander"]
            roles = []
            lessMastered = 0
            tankmenDescrs = dict(vehicle.crew)
            for slotIdx, tman in vehicle.crew:
                if (
                    slotIdx > 0
                    and tman is not None
                    and (
                        tankmenDescrs[lessMastered] is None
                        or compareMastery(tankmenDescrs[lessMastered].descriptor, tman.descriptor) > 0
                    )
                ):
                    lessMastered = slotIdx
                role = vehicle.descriptor.type.crewRoles[slotIdx][0]
                roles.append(
                    {
                        "tankmanID": tman.invID if tman is not None else None,
                        "roleType": role,
                        "role": convert(getSkillsConfig()[role]["userString"]),
                        "roleIcon": Tankman.getRoleBigIconPath(role),
                        "nationID": vehicle.nationID,
                        "typeID": vehicle.innationID,
                        "slot": slotIdx,
                        "vehicleType": vehicle.shortUserName,
                        "tankType": vehicle.type,
                        "vehicleElite": vehicle.isPremium or vehicle.isPremiumIGR,
                        "roles": list(vehicle.descriptor.type.crewRoles[slotIdx]),
                    }
                )

            tankmenData = []
            for tankman in tankmen.itervalues():
                if tankman.isInTank and tankman.vehicleInvID != vehicle.invID:
                    continue
                tankmanVehicle = g_itemsCache.items.getItemByCD(tankman.vehicleNativeDescr.type.compactDescr)
                bonus_role_level = commander_bonus if tankman.descriptor.role != "commander" else 0.0
                skills_count = len(list(ACTIVE_SKILLS))
                skillsList = []
                for skill in tankman.skills:
                    skillsList.append(
                        {
                            "tankmanID": tankman.invID,
                            "id": str(tankman.skills.index(skill)),
                            "name": skill.userName,
                            "desc": skill.description,
                            "icon": skill.icon,
                            "level": skill.level,
                            "active": skill.isEnable and skill.isActive,
                        }
                    )

                newSkillsCount, lastNewSkillLvl = tankman.newSkillCount
                if newSkillsCount > 0:
                    skillsList.append({"buy": True, "tankmanID": tankman.invID, "level": lastNewSkillLvl})
                tankmanData = {
                    "firstName": tankman.firstUserName,
                    "lastName": tankman.lastUserName,
                    "rank": tankman.rankUserName,
                    "specializationLevel": tankman.realRoleLevel[0],
                    "role": tankman.roleUserName,
                    "vehicleType": tankmanVehicle.shortUserName,
                    "iconFile": tankman.icon,
                    "rankIconFile": tankman.iconRank,
                    "roleIconFile": Tankman.getRoleBigIconPath(tankman.descriptor.role),
                    "contourIconFile": tankmanVehicle.iconContour,
                    "tankmanID": tankman.invID,
                    "nationID": tankman.nationID,
                    "typeID": tankmanVehicle.innationID,
                    "inTank": tankman.isInTank,
                    "roleType": tankman.descriptor.role,
                    "tankType": tankmanVehicle.type,
                    "efficiencyLevel": tankman.efficiencyRoleLevel,
                    "bonus": bonus_role_level,
                    "lastSkillLevel": tankman.descriptor.lastSkillLevel,
                    "isLessMastered": vehicle.crewIndices.get(tankman.invID) == lessMastered and vehicle.isXPToTman,
                    "compact": tankman.strCD,
                    "availableSkillsCount": skills_count,
                    "skills": skillsList,
                }
                tankmenData.append(tankmanData)

            self.as_tankmenResponseS({"roles": roles, "tankmen": tankmenData})
            dogName = ""
            if "dog" in g_itemsCache.items.getItemByCD(g_currentVehicle.item.intCD).tags:
                dogName = MENU.HANGAR_CREW_RODY_DOG_NAME
            self.as_dogResponseS(dogName)
        Waiting.hide("updateTankmen")
        return
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:96,代码来源:crew.py


注:本文中的gui.shared.gui_items.Tankman.getRoleBigIconPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。