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


Python CustomizationHelper.isIdInDefaultSetup方法代码示例

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


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

示例1: change

# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import isIdInDefaultSetup [as 别名]
 def change(self, vehInvID, section, isAlreadyPurchased):
     if self._newItemID is None:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_INSCRIPTION_NOT_SELECTED)
         self.onCustomizationChangeFailed(message)
         return
     if self._rentalPackageDP.selectedPackage is None:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_INSCRIPTION_DAYS_NOT_SELECTED)
         self.onCustomizationChangeFailed(message)
         return
     cost, isGold = self._itemsDP.getCost(self._newItemID)
     if cost < 0:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_INSCRIPTION_COST_NOT_FOUND)
         self.onCustomizationChangeFailed(message)
         return
     if isAlreadyPurchased:
         daysToWear = 0
         cost = 0
     elif CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.INSCRIPTION, self._newItemID, self._nationID, self._itemsDP.position):
         hangarItem = CustomizationHelper.getItemFromHangar(CUSTOMIZATION_ITEM_TYPE.INSCRIPTION_TYPE, self._newItemID)
         daysToWear = 0 if hangarItem.get('isPermanent') else 7
     else:
         daysToWear = self._rentalPackageDP.selectedPackage.get('periodDays')
     newIdToSend = 0
     isNewInDefaultSetup = False
     isCurrIgr = self._itemsDP.isIGRItem(self._currentItemID)
     if isCurrIgr:
         isNewInDefaultSetup = CustomizationHelper.isIdInDefaultSetup(CUSTOMIZATION_ITEM_TYPE.INSCRIPTION, self._newItemID)
     if self._currentItemID is None or not isCurrIgr or isCurrIgr and not isNewInDefaultSetup or isCurrIgr and isNewInDefaultSetup and daysToWear > 0:
         newIdToSend = self._newItemID
     BigWorld.player().inventory.changeVehicleInscription(vehInvID, self.getRealPosition(), newIdToSend, daysToWear, 1, lambda resultID: self.__onChangeVehicleInscription(resultID, (cost, isGold)))
开发者ID:wotmods,项目名称:WOTDecompiled,代码行数:32,代码来源:inscriptioninterface.py

示例2: change

# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import isIdInDefaultSetup [as 别名]
    def change(self, vehInvID, section, isAlreadyPurchased):
        if self._rentalPackageDP.selectedPackage is None:
            message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DAYS_NOT_SELECTED)
            self.onCustomizationChangeFailed(message)
            return
        else:
            isNewItemFound = False
            for kind, item in self.currentItemsByKind.iteritems():
                newItemID = item.get("newItemID", None)
                currItemId = item.get("id", None)
                if newItemID is None:
                    continue
                elif not isNewItemFound:
                    isNewItemFound = True
                price = self.getItemCost(newItemID, item.get("packageIdx"))
                cost = price.get("cost", 0)
                isGold = price.get("isGold", False)
                if cost < 0:
                    message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_COST_NOT_FOUND)
                    self.onCustomizationChangeFailed(message)
                    return
                localKind = kind
                if CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE, newItemID, self._nationID):
                    hangarItem = CustomizationHelper.getItemFromHangar(
                        CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE_TYPE, newItemID, self._nationID
                    )
                    daysToWear = 0 if hangarItem.get("isPermanent") else 7
                else:
                    daysToWear = self._rentalPackageDP.pyRequestItemAt(item.get("packageIdx")).get("periodDays")
                newIdToSend = 0
                isNewInDefaultSetup = False
                isCurrIgr = self._itemsDP.isIGRItem(currItemId)
                if isCurrIgr:
                    isNewInDefaultSetup = CustomizationHelper.isIdInDefaultSetup(
                        CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE, newItemID
                    )
                if (
                    currItemId is None
                    or not isCurrIgr
                    or isCurrIgr
                    and not isNewInDefaultSetup
                    or isCurrIgr
                    and isNewInDefaultSetup
                    and daysToWear > 0
                ):
                    newIdToSend = newItemID
                BigWorld.player().inventory.changeVehicleCamouflage(
                    vehInvID,
                    localKind,
                    newIdToSend,
                    daysToWear,
                    functools.partial(self.__onChangeVehicleCamouflage, (cost, isGold), localKind),
                )

            if not isNewItemFound:
                message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_NOT_SELECTED)
                self.onCustomizationChangeFailed(message)
            return
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:60,代码来源:camouflageinterface.py


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