本文整理汇总了Python中gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper.isItemInHangar方法的典型用法代码示例。如果您正苦于以下问题:Python CustomizationHelper.isItemInHangar方法的具体用法?Python CustomizationHelper.isItemInHangar怎么用?Python CustomizationHelper.isItemInHangar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper
的用法示例。
在下文中一共展示了CustomizationHelper.isItemInHangar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: change
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import isItemInHangar [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 isItemInHangar [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
示例3: _getPriceFactor
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import isItemInHangar [as 别名]
def _getPriceFactor(self, itemID):
priceFactor = 0
groups, emblems, names = vehicles.g_cache.playerEmblems()
emblem = emblems.get(itemID)
if emblem is not None:
groupName, igrType, texture, bumpFile, emblemUserString, isMirrored = emblem[0:6]
if not CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.EMBLEM, itemID, self.nationID, self.position):
priceFactor = g_itemsCache.items.shop.getEmblemsGroupPriceFactors().get(groupName)
return priceFactor
示例4: onRequestList
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import isItemInHangar [as 别名]
def onRequestList(self, groupName):
self.currentGroup = groupName
customization = vehicles.g_cache.customization(self.nationID)
result = []
if customization is not None:
groups = customization.get('camouflageGroups', {})
group = groups.get(groupName, {})
camouflages = customization.get('camouflages', {})
armorColor = customization.get('armorColor', 0)
ids = group.get('ids', [])
currIntDescr = g_currentVehicle.item.intCD
for id in ids:
camouflageInfo = self._constructCamouflage(id, groups, camouflages, armorColor, isCurrent=self.currentItemID == id, isInHangar=CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE, id, self.nationID), withoutCheck=False, currVehIntD=currIntDescr)
if camouflageInfo is not None:
if not self._isIGR and camouflageInfo.get('igrType') == constants.IGR_TYPE.NONE or self._isIGR and camouflageInfo.get('igrType') == constants.IGR_TYPE.PREMIUM:
result.append(camouflageInfo)
if gui.GUI_SETTINGS.igrEnabled:
for name, group in groups.iteritems():
if name not in CAMOUFLAGE_KINDS:
ids = group.get('ids', [])
for cID in ids:
camouflage = camouflages.get(cID, None)
if camouflage.get('kind', 0) == CAMOUFLAGE_KINDS.get(groupName, 0):
camouflageInfo = self._constructCamouflage(cID, groups, camouflages, armorColor, isCurrent=self.currentItemID == cID, isInHangar=CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE, cID, self.nationID), withoutCheck=False, currVehIntD=currIntDescr)
if camouflageInfo is not None and camouflageInfo:
if not self._isIGR and camouflageInfo.get('igrType') == constants.IGR_TYPE.NONE or self._isIGR and camouflageInfo.get('igrType') == constants.IGR_TYPE.PREMIUM:
result.append(camouflageInfo)
return sorted(result, cmp=self.__comparator)
示例5: getCostForPackagePrice
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import isItemInHangar [as 别名]
def getCostForPackagePrice(self, camouflageID, packagePrice, isGold):
if CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE, camouflageID, self.nationID):
priceFactor = 0
else:
priceFactor = g_itemsCache.items.shop.getCamouflagesPriceFactors(self.nationID).get(camouflageID)
return (self._makeCost(packagePrice, self._vehPriceFactor, priceFactor), isGold)
示例6: makeItem
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.customization import CustomizationHelper [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.customization.CustomizationHelper import isItemInHangar [as 别名]
def makeItem(self, camouflageID, isCurrent, lifeCycle, timeLeftString, kind):
customization = vehicles.g_cache.customization(self.nationID)
camouflageInfo = None
if customization is not None:
groups = customization.get('camouflageGroups', {})
armorColor = customization.get('armorColor', 0)
camouflageInfo = self._constructCamouflage(camouflageID, groups, customization.get('camouflages', {}), armorColor, lifeCycle, isCurrent, CustomizationHelper.isItemInHangar(CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE, camouflageID, self.nationID))
if camouflageInfo is not None:
camouflageInfo['timeLeft'] = timeLeftString
else:
camouflageInfo = {'timeLeft': timeLeftString,
'id': camouflageID,
'texturePath': None,
'description': self.getDefaultDescription(kind),
'price': {'cost': 0,
'isGold': False},
'action': None,
'isNew': False,
'invisibilityLbl': '',
'current': False}
return camouflageInfo