本文整理匯總了Python中gui.shared.gui_items.Tankman.getSmallIconPath方法的典型用法代碼示例。如果您正苦於以下問題:Python Tankman.getSmallIconPath方法的具體用法?Python Tankman.getSmallIconPath怎麽用?Python Tankman.getSmallIconPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gui.shared.gui_items.Tankman
的用法示例。
在下文中一共展示了Tankman.getSmallIconPath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: packTankman
# 需要導入模塊: from gui.shared.gui_items import Tankman [as 別名]
# 或者: from gui.shared.gui_items.Tankman import getSmallIconPath [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,
}
示例2: __makeTankmanVO
# 需要導入模塊: from gui.shared.gui_items import Tankman [as 別名]
# 或者: from gui.shared.gui_items.Tankman import getSmallIconPath [as 別名]
def __makeTankmanVO(self, tman, avgBattles2NewSkill):
prediction = ''
if avgBattles2NewSkill > 0:
prediction = _ms(BATTLE_RESULTS.COMMON_NEWSKILLPREDICTION, battles=BigWorld.wg_getIntegralFormat(avgBattles2NewSkill))
return {'title': _ms(BATTLE_RESULTS.COMMON_CREWMEMBER_NEWSKILL),
'description': self.__makeTankmanDescription(tman),
'tankmenIcon': Tankman.getSmallIconPath(tman.nationID, tman.descriptor.iconID),
'prediction': prediction,
'linkEvent': PROGRESS_ACTION.NEW_SKILL_UNLOCK_TYPE,
'linkId': tman.invID}
示例3: packTankman
# 需要導入模塊: from gui.shared.gui_items import Tankman [as 別名]
# 或者: from gui.shared.gui_items.Tankman import getSmallIconPath [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}
示例4: packTankman
# 需要導入模塊: from gui.shared.gui_items import Tankman [as 別名]
# 或者: from gui.shared.gui_items.Tankman import getSmallIconPath [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}