本文整理汇总了Python中gui.shared.gui_items.Tankman.getRoleUserName方法的典型用法代码示例。如果您正苦于以下问题:Python Tankman.getRoleUserName方法的具体用法?Python Tankman.getRoleUserName怎么用?Python Tankman.getRoleUserName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.shared.gui_items.Tankman
的用法示例。
在下文中一共展示了Tankman.getRoleUserName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _successHandler
# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleUserName [as 别名]
def _successHandler(self, code, ctx = None):
msgType = SM_TYPE.FinancialTransactionWithGold
vehicle = g_itemsCache.items.getItemByCD(self.__vehTypeCompDescr)
if ctx == EQUIP_TMAN_CODE.OK:
auxData = makeI18nSuccess('change_tankman_role/installed', vehicle=vehicle.shortUserName)
elif ctx == EQUIP_TMAN_CODE.NO_FREE_SLOT:
roleStr = Tankman.getRoleUserName(SKILL_NAMES[self.__roleIdx])
auxData = makeI18nSuccess('change_tankman_role/slot_is_taken', vehicle=vehicle.shortUserName, role=roleStr)
else:
auxData = makeI18nSuccess('change_tankman_role/no_vehicle')
return makeI18nSuccess('change_tankman_role/success', money=formatPrice((0, self.__changeRoleCost)), type=msgType, auxData=auxData)
示例2: onVehicleSelected
# 需要导入模块: from gui.shared.gui_items import Tankman [as 别名]
# 或者: from gui.shared.gui_items.Tankman import getRoleUserName [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)