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


Python NODE_STATE.isAvailable2Unlock方法代码示例

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


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

示例1: _generateOptions

# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import isAvailable2Unlock [as 别名]
 def _generateOptions(self, ctx = None):
     vehicle = g_itemsCache.items.getItemByCD(self._nodeCD)
     options = [self._makeItem(VEHICLE.INFO, MENU.CONTEXTMENU_VEHICLEINFOEX),
      self._makeItem(VEHICLE.STATS, MENU.CONTEXTMENU_SHOWVEHICLESTATISTICS, {'enabled': NODE_STATE.isWasInBattle(self._nodeState)}),
      self._makeSeparator(),
      self._makeItem(VEHICLE.UNLOCK, MENU.CONTEXTMENU_UNLOCK, {'enabled': NODE_STATE.isAvailable2Unlock(self._nodeState) and not NODE_STATE.isPremium(self._nodeState)})]
     if not vehicle.isPremiumIGR:
         options.extend([self._makeItem(VEHICLE.BUY, MENU.CONTEXTMENU_BUY, {'enabled': NODE_STATE.isAvailable2Buy(self._nodeState)}),
          self._makeItem(VEHICLE.SELL, MENU.CONTEXTMENU_VEHICLEREMOVE if vehicle.isRented else MENU.CONTEXTMENU_SELL, {'enabled': NODE_STATE.isAvailable2Sell(self._nodeState)}),
          self._makeSeparator(),
          self._makeItem(VEHICLE.SELECT, MENU.CONTEXTMENU_SELECTVEHICLEINHANGAR, {'enabled': (NODE_STATE.inInventory(self._nodeState) or NODE_STATE.isRentalOver(self._nodeState)) and NODE_STATE.isVehicleCanBeChanged(self._nodeState)})])
     return options
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:14,代码来源:research_cm_handlers.py

示例2: _generateOptions

# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import isAvailable2Unlock [as 别名]
 def _generateOptions(self, ctx=None):
     options = [
         self._makeItem(MODULE.INFO, MENU.contextmenu(MODULE.INFO)),
         self._makeSeparator(),
         self._makeItem(
             MODULE.UNLOCK,
             MENU.contextmenu(MODULE.UNLOCK),
             {"enabled": NODE_STATE.isAvailable2Unlock(self._nodeState)},
         ),
     ]
     if NODE_STATE.isUnlocked(self._nodeState):
         if NODE_STATE.inInventory(self._nodeState) or NODE_STATE.isInstalled(self._nodeState):
             options.extend(
                 [
                     self._makeItem(
                         MODULE.EQUIP, MENU.contextmenu(MODULE.EQUIP), {"enabled": self._isAvailable2Install()}
                     ),
                     self._makeSeparator(),
                     self._makeItem(
                         MODULE.SELL,
                         MENU.CONTEXTMENU_SELLFROMINVENTORY,
                         {"enabled": not NODE_STATE.isInstalled(self._nodeState)},
                     ),
                 ]
             )
         else:
             options.extend(
                 [
                     self._makeItem(
                         MODULE.BUY_AND_EQUIP, MENU.CONTEXTMENU_BUYANDEQUIP, {"enabled": self._isAvailable2Buy()}
                     ),
                     self._makeSeparator(),
                     self._makeItem(
                         MODULE.SELL,
                         MENU.CONTEXTMENU_SELLFROMINVENTORY,
                         {"enabled": NODE_STATE.isAvailable2Sell(self._nodeState)},
                     ),
                 ]
             )
     else:
         options.extend(
             [
                 self._makeItem(MODULE.BUY_AND_EQUIP, MENU.CONTEXTMENU_BUYANDEQUIP, {"enabled": False}),
                 self._makeSeparator(),
                 self._makeItem(MODULE.SELL, MENU.CONTEXTMENU_SELLFROMINVENTORY, {"enabled": False}),
             ]
         )
     return options
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:50,代码来源:research_cm_handlers.py

示例3: _generateOptions

# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import isAvailable2Unlock [as 别名]
 def _generateOptions(self, ctx = None):
     vehicle = g_itemsCache.items.getItemByCD(self._nodeCD)
     options = [self._makeItem(VEHICLE.INFO, MENU.CONTEXTMENU_VEHICLEINFOEX)]
     if vehicle.isPreviewAllowed():
         options.append(self._makeItem(VEHICLE.PREVIEW, MENU.CONTEXTMENU_SHOWVEHICLEPREVIEW))
     if NODE_STATE.isWasInBattle(self._nodeState):
         options.append(self._makeItem(VEHICLE.STATS, MENU.CONTEXTMENU_SHOWVEHICLESTATISTICS))
     self._manageVehCompareItem(options, vehicle)
     options.append(self._makeSeparator())
     if vehicle.isUnlocked:
         if not vehicle.isPremiumIGR and (not vehicle.isInInventory or vehicle.isRented):
             if vehicle.isRestoreAvailable():
                 label = MENU.CONTEXTMENU_RESTORE
             else:
                 label = MENU.CONTEXTMENU_BUY
             options.append(self._makeItem(VEHICLE.BUY, label, {'enabled': NODE_STATE.isAvailable2Buy(self._nodeState)}))
     else:
         options.append(self._makeItem(VEHICLE.UNLOCK, MENU.CONTEXTMENU_UNLOCK, {'enabled': NODE_STATE.isAvailable2Unlock(self._nodeState) and not NODE_STATE.isPremium(self._nodeState)}))
     if not vehicle.isPremiumIGR:
         isAvailable2SellOrRemove = NODE_STATE.isAvailable2Sell(self._nodeState)
         if isAvailable2SellOrRemove:
             options.append(self._makeItem(VEHICLE.SELL, MENU.CONTEXTMENU_VEHICLEREMOVE if vehicle.isRented else MENU.CONTEXTMENU_SELL, {'enabled': isAvailable2SellOrRemove}))
     options.extend([self._makeSeparator(), self._makeItem(VEHICLE.SELECT, MENU.CONTEXTMENU_SELECTVEHICLEINHANGAR, {'enabled': (NODE_STATE.inInventory(self._nodeState) or NODE_STATE.isRentalOver(self._nodeState)) and NODE_STATE.isVehicleCanBeChanged(self._nodeState)})])
     return options
开发者ID:aevitas,项目名称:wotsdk,代码行数:26,代码来源:techtreeresearch_cm_handlers.py


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