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


Python Tankman.getRoleMediumIconPath方法代码示例

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


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

示例1: packTankman

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleMediumIconPath [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 getRoleMediumIconPath [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: packTankman

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleMediumIconPath [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

示例4: onVehicleSelected

# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleMediumIconPath [as 别名]
    def onVehicleSelected(self, vehTypeCompDescr):
        self.__selectedVehicleCD = int(vehTypeCompDescr)
        selectedVehicle = self.__items.getItemByCD(self.__selectedVehicleCD)
        data = []
        for role in selectedVehicle.descriptor.type.crewRoles:
            mainRole = role[0]
            criteria = REQ_CRITERIA.TANKMAN.NATIVE_TANKS([self.__selectedVehicleCD]) | REQ_CRITERIA.TANKMAN.ROLES([mainRole])
            roleTankmen = self.__items.getTankmen(criteria).values()
            sameTankmen = len(roleTankmen)
            roleSlotIsTaken = _isRoleSlotTaken(roleTankmen, selectedVehicle, mainRole)
            roleStr = Tankman.getRoleUserName(mainRole)
            isAvailable = self.__tankman.descriptor.role != mainRole
            data.append({'id': mainRole,
             'name': roleStr,
             'icon': Tankman.getRoleMediumIconPath(mainRole),
             'available': isAvailable,
             'warningHeader': _getTooltipHeader(sameTankmen, isAvailable),
             'warningBody': _getTooltipBody(sameTankmen, isAvailable, roleSlotIsTaken, roleStr, selectedVehicle)})

        self.as_setRolesS(data)
开发者ID:webiumsk,项目名称:WoT,代码行数:22,代码来源:rolechangewindow.py


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