当前位置: 首页>>代码示例>>Python>>正文


Python CustomizationHelper.areItemsInHangar方法代码示例

本文整理汇总了Python中gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper.areItemsInHangar方法的典型用法代码示例。如果您正苦于以下问题:Python CustomizationHelper.areItemsInHangar方法的具体用法?Python CustomizationHelper.areItemsInHangar怎么用?Python CustomizationHelper.areItemsInHangar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper的用法示例。


在下文中一共展示了CustomizationHelper.areItemsInHangar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onRequestList

# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import areItemsInHangar [as 别名]
    def onRequestList(self, groupName):
        if not groupName:
            return
        else:
            customization = vehicles.g_cache.customization(self.nationID)
            result = []
            hiddenItems = g_itemsCache.items.shop.getInscriptionsGroupHiddens(self.nationID)
            if customization is not None:
                groups = customization.get('inscriptionGroups', {})
                group = groups.get(groupName, {})
                inscriptions = customization.get('inscriptions', {})
                if group is not None:
                    inscriptionIDs, groupUserString, igrType, allow, deny = group
                    isHasNew = self._hasNewItems(CUSTOMIZATION_ITEM_TYPE.INSCRIPTION_TYPE, inscriptionIDs)
                    isHiddenGroup = groupName in hiddenItems
                    hasItemsInHangar = False
                    if isHiddenGroup:
                        hasItemsInHangar = CustomizationHelper.areItemsInHangar(CUSTOMIZATION_ITEM_TYPE.INSCRIPTION, inscriptionIDs, self.nationID)
                    self._isIGR = igrType != constants.IGR_TYPE.NONE
                    if isHasNew or hasItemsInHangar or not isHiddenGroup:
                        for id in inscriptionIDs:
                            itemInfo = self._constructInscription(id, groups, inscriptions, self.currentItemID == id, False if self.isIGRItem(id) else CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.INSCRIPTION, id, self.nationID, self.position), False)
                            if itemInfo is not None:
                                if not self._isIGR or self._isIGR and itemInfo.get('igrType') != constants.IGR_TYPE.NONE:
                                    result.append(itemInfo)

            return sorted(result, cmp=self.__comparator)
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:29,代码来源:data_providers.py

示例2: buildList

# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import areItemsInHangar [as 别名]
    def buildList(self):
        hiddenEmblems = g_itemsCache.items.shop.getEmblemsGroupHiddens()
        groups, emblems, names = vehicles.g_cache.playerEmblems()
        result = []
        if groups is not None:
            igrRoomType = gui.game_control.g_instance.igr.getRoomType()
            for name, group in groups.iteritems():
                emblemIDs, groupUserString, igrType, nations, allow, deny = group
                isHasNew = self._hasNewItems(CUSTOMIZATION_ITEM_TYPE.EMBLEM_TYPE, emblemIDs)
                isHiddenGroup = name in hiddenEmblems
                hasItemsInHangar = False
                currVehIntD = g_currentVehicle.item.intCD
                canBeUsedOnVehicle = currVehIntD not in deny and (len(allow) == 0 or currVehIntD in allow)
                if isHiddenGroup:
                    hasItemsInHangar = CustomizationHelper.areItemsInHangar(CUSTOMIZATION_ITEM_TYPE.EMBLEM, emblemIDs, self._nationID)
                if canBeUsedOnVehicle and (isHasNew or hasItemsInHangar or not isHiddenGroup) and (gui.GUI_SETTINGS.igrEnabled or not gui.GUI_SETTINGS.igrEnabled and igrType == constants.IGR_TYPE.NONE) and (nations is None or g_currentVehicle.item.nationID in nations):
                    result.append({'name': name,
                     'userString': groupUserString,
                     'hasNew': isHasNew,
                     'isIGR': igrType != constants.IGR_TYPE.NONE,
                     'enabled': igrType == constants.IGR_TYPE.NONE or igrType <= igrRoomType,
                     'tooltip': TOOLTIPS.CUSTOMIZATION_EMBLEM_IGR})

        self._list = sorted(result, cmp=self.__comparator)
        return
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:27,代码来源:data_providers.py


注:本文中的gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper.areItemsInHangar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。