예제 #1
0
 def _generateOptions(self, ctx = None):
     vehicle = self.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
             elif vehicle.canTradeIn:
                 label = MENU.CONTEXTMENU_BUYORTRADEIN
             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
예제 #2
0
 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)
                     and NODE_STATE.isVehicleCanBeChanged(self._nodeState)
                 })
         ])
     return options
예제 #3
0
 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
 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
예제 #5
0
 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))
     options.append(self._makeSeparator())
     if vehicle.isUnlocked:
         if not vehicle.isPremiumIGR and (not vehicle.isInInventory or vehicle.isRented):
             options.append(self._makeItem(VEHICLE.BUY, MENU.CONTEXTMENU_BUY, {'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
예제 #6
0
 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)
                         and NODE_STATE.isVehicleCanBeChanged(self._nodeState)
                     },
                 ),
             ]
         )
     return options
예제 #7
0
 def _generateOptions(self, ctx=None):
     vehicle = self.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,
                            {'enabled': self._hangarSpace.spaceInited}))
     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
             elif vehicle.canTradeIn:
                 label = MENU.CONTEXTMENU_BUYORTRADEIN
             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 vehicle.hasNationGroup:
         if vehicle.isInInventory or vehicle.isRented:
             isNationChangeAvailable = vehicle.isNationChangeAvailable
             nationChangeIsNew = not AccountSettings.getSettings(
                 NATION_CHANGE_VIEWED)
         else:
             isNationChangeAvailable = False
             nationChangeIsNew = False
         options.append(
             self._makeItem(VEHICLE.NATION_CHANGE,
                            MENU.CONTEXTMENU_NATIONCHANGE, {
                                'enabled': isNationChangeAvailable,
                                'isNew': nationChangeIsNew
                            }))
     if not vehicle.isPremiumIGR and not vehicle.isTelecomRent:
         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)
             })
     ])
     return options