Beispiel #1
0
 def onBackClick(self):
     if self._backAlias == VIEW_ALIAS.LOBBY_RESEARCH:
         event_dispatcher.showResearchView(self._vehicleCD)
     else:
         event = g_entitiesFactories.makeLoadEvent(self._backAlias,
                                                   {'isBackEvent': True})
         self.fireEvent(event, scope=EVENT_BUS_SCOPE.LOBBY)
 def onBackClick(self):
     if self._backAlias == VIEW_ALIAS.LOBBY_RESEARCH and self.__isSecondVehicle(
     ):
         firstVehicleCD = g_bootcamp.getNationData()['vehicle_first']
         event_dispatcher.showResearchView(firstVehicleCD)
     else:
         super(BCVehiclePreview, self).onBackClick()
 def toResearch(self):
     vehicle = g_itemsCache.items.getVehicle(self.getVehInvID())
     if vehicle is not None:
         shared_events.showResearchView(vehicle.intCD)
     else:
         LOG_ERROR("Can't go to Research because id for current vehicle is None")
     return
 def toResearch(self):
     vehicle = g_itemsCache.items.getVehicle(self.getVehInvID())
     if vehicle is not None:
         shared_events.showResearchView(vehicle.intCD)
     else:
         LOG_ERROR("Can't go to Research because id for current vehicle is None")
     return
 def __processBackClick(self, ctx=None):
     if self._previewBackCb:
         self._previewBackCb()
     elif self._backAlias == VIEW_ALIAS.LOBBY_RESEARCH:
         event_dispatcher.showResearchView(self._vehicleCD)
     elif self._backAlias == VIEW_ALIAS.VEHICLE_PREVIEW:
         entity = ctx.get('entity', None) if ctx else None
         if entity:
             descriptor = entity.typeDescriptor
             event_dispatcher.showVehiclePreview(
                 descriptor.type.compactDescr,
                 previewAlias=self._previousBackAlias)
         else:
             event_dispatcher.showHangar()
     elif self._backAlias == VIEW_ALIAS.LOBBY_STORE:
         if isIngameShopEnabled():
             showWebShop(url=getBuyVehiclesUrl())
         else:
             showOldShop(
                 ctx={
                     'tabId': STORE_TYPES.SHOP,
                     'component': STORE_CONSTANTS.VEHICLE
                 })
     else:
         event = g_entitiesFactories.makeLoadEvent(self._backAlias,
                                                   {'isBackEvent': True})
         self.fireEvent(event, scope=EVENT_BUS_SCOPE.LOBBY)
     return
 def _processBackClick(self, ctx=None):
     if self._previewBackCb:
         self._previewBackCb()
     elif self._backAlias == VIEW_ALIAS.LOBBY_RESEARCH and g_currentPreviewVehicle.isPresent(
     ):
         event_dispatcher.showResearchView(
             self._vehicleCD,
             exitEvent=events.LoadViewEvent(
                 SFViewLoadParams(VIEW_ALIAS.LOBBY_TECHTREE),
                 ctx={'nation': g_currentPreviewVehicle.item.nationName}))
     elif self._backAlias == VIEW_ALIAS.VEHICLE_PREVIEW:
         entity = ctx.get('entity', None) if ctx else None
         if entity:
             compactDescr = entity.typeDescriptor.type.compactDescr
             if self.__itemsCache.items.inventory.getItemData(
                     compactDescr) is not None:
                 event_dispatcher.showHangar()
             else:
                 event_dispatcher.showVehiclePreview(
                     compactDescr, previewAlias=self._previousBackAlias)
         else:
             event_dispatcher.showHangar()
     elif self._backAlias == VIEW_ALIAS.LOBBY_STORE:
         showShop()
     else:
         event = g_entitiesFactories.makeLoadEvent(
             SFViewLoadParams(self._backAlias), {'isBackEvent': True})
         self.fireEvent(event, scope=EVENT_BUS_SCOPE.LOBBY)
     return
Beispiel #7
0
 def showUnlockWindow(self, itemID, unlockType):
     if not self.__canNavigate():
         return
     if unlockType in (PROGRESS_ACTION.RESEARCH_UNLOCK_TYPE, PROGRESS_ACTION.PURCHASE_UNLOCK_TYPE):
         event_dispatcher.showResearchView(itemID)
         self.onWindowClose()
     elif unlockType == PROGRESS_ACTION.NEW_SKILL_UNLOCK_TYPE:
         event_dispatcher.showPersonalCase(itemID, 2, EVENT_BUS_SCOPE.LOBBY)
Beispiel #8
0
 def toResearch(self):
     vehicle = self.itemsCache.items.getVehicle(self.getVehInvID())
     if vehicle is not None:
         shared_events.showResearchView(vehicle.intCD)
     else:
         _logger.error(
             'Can not go to Research because id for current vehicle is None'
         )
     return
 def __processBackClick(self, ctx=None):
     if self._backAlias == VIEW_ALIAS.LOBBY_RESEARCH:
         event_dispatcher.showResearchView(self._vehicleCD)
     elif self._backAlias == VIEW_ALIAS.VEHICLE_PREVIEW:
         entity = ctx.get('entity', None) if ctx else None
         if entity:
             descriptor = entity.typeDescriptor
             event_dispatcher.showVehiclePreview(
                 descriptor.type.compactDescr,
                 previewAlias=self._previousBackAlias)
         else:
             event_dispatcher.showHangar()
     else:
         event = g_entitiesFactories.makeLoadEvent(self._backAlias,
                                                   {'isBackEvent': True})
         self.fireEvent(event, scope=EVENT_BUS_SCOPE.LOBBY)
     return
Beispiel #10
0
 def goToNextVehicle(self, vehCD):
     if not g_bootcamp.isResearchFreeLesson():
         nationData = g_bootcampGarage.getNationData()
         if nationData['vehicle_second'] == vehCD:
             vehicle = self.itemsCache.items.getItemByCD(int(vehCD))
             if vehicle.isInInventory:
                 shared_events.showResearchView(vehCD)
                 return
         if nationData['vehicle_first'] == vehCD:
             shared_events.showResearchView(vehCD)
     else:
         shared_events.showResearchView(vehCD)
 def goToNextVehicle(self, vehCD):
     if not g_bootcamp.isResearchFreeLesson():
         nationData = g_bootcamp.getNationData()
         vehicle = self._itemsCache.items.getItemByCD(int(vehCD))
         exitEvent = events.LoadViewEvent(VIEW_ALIAS.LOBBY_TECHTREE, ctx={'nation': vehicle.nationName})
         if nationData['vehicle_second'] == vehCD:
             if vehicle.isInInventory:
                 shared_events.showResearchView(vehCD, exitEvent=exitEvent)
                 return
         if nationData['vehicle_first'] == vehCD:
             shared_events.showResearchView(vehCD, exitEvent=exitEvent)
     else:
         shared_events.showResearchView(vehCD)
Beispiel #12
0
 def openResearch(self, cmd):
     event_dispatcher.showResearchView(cmd.vehicle_id)
Beispiel #13
0
 def goToResearch(self):
     LOG_DEBUG('BCResearchPanel::goToResearch')
     if g_currentVehicle.isPresent():
         shared_events.showResearchView(g_currentVehicle.item.intCD)
     else:
         LOG_ERROR('Current vehicle is not preset')
 def goToResearch(self):
     if g_currentVehicle.isPresent() and self.__isNavigationEnabled:
         shared_events.showResearchView(g_currentVehicle.item.intCD)
     else:
         LOG_ERROR(
             'Current vehicle is not preset or navigation is disabled')
Beispiel #15
0
 def goToResearch(self):
     if g_currentVehicle.isPresent():
         shared_events.showResearchView(g_currentVehicle.item.intCD)
     else:
         LOG_ERROR('Current vehicle is not preset')
Beispiel #16
0
 def openResearch(self, cmd):
     vehicle = self.itemsCache.items.getStockVehicle(cmd.vehicle_id)
     exitEvent = events.LoadViewEvent(SFViewLoadParams(
         VIEW_ALIAS.LOBBY_TECHTREE),
                                      ctx={'nation': vehicle.nationName})
     event_dispatcher.showResearchView(cmd.vehicle_id, exitEvent=exitEvent)
 def onBackClick(self):
     if self.__backAlias == VIEW_ALIAS.LOBBY_RESEARCH:
         event_dispatcher.showResearchView(self.__vehicleCD)
     else:
         event = g_entitiesFactories.makeLoadEvent(self.__backAlias)
         self.fireEvent(event, scope=EVENT_BUS_SCOPE.LOBBY)