コード例 #1
0
ファイル: dumpers.py プロジェクト: webiumsk/WOT-0.9.17-CT
 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
ファイル: dumpers.py プロジェクト: webiumsk/WOT-0.9.17-CT
 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
ファイル: techtreedumpers.py プロジェクト: aevitas/wotsdk
 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
ファイル: techtreedumpers.py プロジェクト: aevitas/wotsdk
 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 {}