Пример #1
0
 def __paramsChangeHandler(self, selectedNationID, selectedVehClass,
                           selectedVehicle, selectedTmanRole):
     selectedNationID = int(selectedNationID)
     nationName = nations.NAMES[selectedNationID]
     if self.__currentSelectedNationID != selectedNationID:
         firstNameID, lastNameID, iconID = g_eventsCache.potapov.getNextTankwomanIDs(
             selectedNationID, self.__isPremium, int(self.__fnGroup),
             int(self.__lnGroup), int(self.__iGroupID))
         rankID = Tankman.calculateRankID(tankmen.MAX_SKILL_LEVEL,
                                          self.__freeXpValue)
         self.as_setInitDataS({
             'name':
             Tankman.getFullUserName(selectedNationID, firstNameID,
                                     lastNameID),
             'nation':
             nationName,
             'rank':
             Tankman.getRankUserName(selectedNationID, rankID),
             'vehicle':
             '',
             'faceIcon':
             Tankman.getBigIconPath(selectedNationID, iconID),
             'rankIcon':
             Tankman.getRankBigIconPath(selectedNationID, rankID)
         })
     self.__currentSelectedNationID = selectedNationID
Пример #2
0
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,
    }
Пример #3
0
 def __paramsChangeHandler(self, selectedNationID, selectedVehClass, selectedVehicle, selectedTmanRole):
     selectedNationID = int(selectedNationID)
     nationName = nations.NAMES[selectedNationID]
     if self.__currentSelectedNationID != selectedNationID:
         firstNameID, lastNameID, iconID = g_eventsCache.potapov.getNextTankwomanIDs(selectedNationID, self.__isPremium, int(self.__fnGroup), int(self.__lnGroup), int(self.__iGroupID))
         rankID = Tankman.calculateRankID(tankmen.MAX_SKILL_LEVEL, self.__freeXpValue)
         self.as_setInitDataS({'name': Tankman.getFullUserName(selectedNationID, firstNameID, lastNameID),
          'nation': nationName,
          'rank': Tankman.getRankUserName(selectedNationID, rankID),
          'vehicle': '',
          'faceIcon': Tankman.getBigIconPath(selectedNationID, iconID),
          'rankIcon': Tankman.getRankBigIconPath(selectedNationID, rankID)})
     self.__currentSelectedNationID = selectedNationID
Пример #4
0
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}
Пример #5
0
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}
Пример #6
0
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
    }