예제 #1
0
 def _getVehicleData(self, node, item):
     nodeCD = node['id']
     tags = item.tags
     credits, gold = node['GUIPrice']
     status, statusLevel = self._getRentStatus(item)
     return {
         'id': nodeCD,
         'state': node['state'],
         'type': item.itemTypeName,
         'nameString': item.shortUserName,
         'primaryClass': self._vClassInfo.getInfoByTags(tags),
         'level': item.level,
         'longName': item.longUserName,
         'iconPath': item.icon,
         'smallIconPath': item.iconSmall,
         'earnedXP': node['earnedXP'],
         'shopPrice': (credits, gold, getActionPriceData(item)),
         'displayInfo': node['displayInfo'],
         'unlockProps': node['unlockProps']._makeTuple(),
         'status': status,
         'statusLevel': statusLevel,
         'isRemovable': item.isRented,
         'isPremiumIGR': item.isPremiumIGR,
         'vehCompareTreeNodeData': getTreeNodeCompareData(item)
     }
예제 #2
0
 def _getItemData(self, node, item, rootItem):
     nodeCD = node['id']
     vClass = {'name': ''}
     status = statusLevel = ''
     vehicleBtnLabel = ''
     if item.itemTypeID == GUI_ITEM_TYPE.VEHICLE:
         status, statusLevel = self._getRentStatus(item)
         if item.isInInventory:
             vehicleBtnLabel = MENU.RESEARCH_LABELS_BUTTON_SHOWINHANGAR
         else:
             vehicleBtnLabel = MENU.RESEARCH_SHOWINPREVIEWBTN_LABEL
     else:
         vClass.update({'name': item.itemTypeName})
     credits, gold = node['GUIPrice']
     data = {
         'longName': item.longUserName,
         'smallIconPath': item.iconSmall,
         'earnedXP': node['earnedXP'],
         'shopPrice': (credits, gold, getActionPriceData(item)),
         'unlockProps': node['unlockProps']._makeTuple(),
         'status': status,
         'statusLevel': statusLevel,
         'isPremiumIGR': item.isPremiumIGR,
         'showVehicleBtnLabel': i18n.makeString(vehicleBtnLabel),
         'showVehicleBtnEnabled': item.isInInventory
         or item.isPreviewAllowed(),
         'vehCompareRootData':
         getBtnCompareData(item) if nodeCD == rootItem.intCD else {},
         'vehCompareTreeNodeData': getTreeNodeCompareData(item)
         if item.itemTypeID == GUI_ITEM_TYPE.VEHICLE else {}
     }
     commonData = super(ResearchItemsObjDumper,
                        self)._getItemData(node, item, rootItem)
     data.update(commonData)
     return data
예제 #3
0
 def invalidateVehCompare(self):
     """
     Updates compare add icon status of nodes if change status of comparison basket fullness.
     """
     getVehicle = g_itemsCache.items.getItemByCD
     getNodeData = lambda vehCD: getTreeNodeCompareData(getVehicle(vehCD))
     self.as_setNodeVehCompareDataS([ (v, getNodeData(v)) for v in self._data.getVehicleCDs() ])
예제 #4
0
 def _getItemData(self, node, item, rootItem):
     nodeCD = node['id']
     vClass = {'name': ''}
     status = statusLevel = ''
     vehicleBtnLabel = ''
     if item.itemTypeID == GUI_ITEM_TYPE.VEHICLE:
         status, statusLevel = self._getRentStatus(item)
         if item.isInInventory:
             vehicleBtnLabel = MENU.RESEARCH_LABELS_BUTTON_SHOWINHANGAR
         else:
             vehicleBtnLabel = MENU.RESEARCH_SHOWINPREVIEWBTN_LABEL
     else:
         vClass.update({'name': item.itemTypeName})
     credits, gold = node['GUIPrice']
     data = {'longName': item.longUserName,
      'smallIconPath': item.iconSmall,
      'earnedXP': node['earnedXP'],
      'shopPrice': (credits, gold, getActionPriceData(item)),
      'unlockProps': node['unlockProps']._makeTuple(),
      'status': status,
      'statusLevel': statusLevel,
      'isPremiumIGR': item.isPremiumIGR,
      'showVehicleBtnLabel': i18n.makeString(vehicleBtnLabel),
      'showVehicleBtnEnabled': item.isInInventory or item.isPreviewAllowed(),
      'vehCompareRootData': getBtnCompareData(item) if nodeCD == rootItem.intCD else {},
      'vehCompareTreeNodeData': getTreeNodeCompareData(item) if item.itemTypeID == GUI_ITEM_TYPE.VEHICLE else {}}
     commonData = super(ResearchItemsObjDumper, self)._getItemData(node, item, rootItem)
     data.update(commonData)
     return data
예제 #5
0
 def invalidateVehCompare(self):
     """
     Updates compare add icon status of nodes if change status of comparison basket fullness.
     """
     getVehicle = g_itemsCache.items.getItemByCD
     getNodeData = lambda vehCD: getTreeNodeCompareData(getVehicle(vehCD))
     self.as_setNodeVehCompareDataS([(v, getNodeData(v))
                                     for v in self._data.getVehicleCDs()])
예제 #6
0
 def _getVehicleData(self, node, item):
     nodeCD = node['id']
     tags = item.tags
     credits, gold = node['GUIPrice']
     status, statusLevel = self._getRentStatus(item)
     return {'id': nodeCD,
      'state': node['state'],
      'type': item.itemTypeName,
      'nameString': item.shortUserName,
      'primaryClass': self._vClassInfo.getInfoByTags(tags),
      'level': item.level,
      'longName': item.longUserName,
      'iconPath': item.icon,
      'smallIconPath': item.iconSmall,
      'earnedXP': node['earnedXP'],
      'shopPrice': (credits, gold, getActionPriceData(item)),
      'displayInfo': node['displayInfo'],
      'unlockProps': node['unlockProps']._makeTuple(),
      'status': status,
      'statusLevel': statusLevel,
      'isRemovable': item.isRented,
      'isPremiumIGR': item.isPremiumIGR,
      'vehCompareTreeNodeData': getTreeNodeCompareData(item)}
예제 #7
0
 def getNodeData(vehCD):
     return getTreeNodeCompareData(getVehicle(vehCD))
예제 #8
0
파일: nodes.py 프로젝트: kusaku/wot_scripts
 def getCompareData(self):
     if self.__item is not None and self.__item.itemTypeID == GUI_ITEM_TYPE.VEHICLE:
         from gui.Scaleform.daapi.view.lobby.vehicle_compare import formatters
         return formatters.getTreeNodeCompareData(self.__item)
     else:
         return {}