本文整理汇总了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)))
示例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