def __init__(self, ctx=None, skipConfirm=False):
     LobbySelectableView.__init__(self, ctx)
     self._actionType = None
     self._showHeaderCloseBtn = True
     self._vehicleCD = ctx['itemCD']
     self.__vehicleStrCD = ctx.get('vehicleStrCD')
     self._previousBackAlias = ctx.get('previousBackAlias')
     self._previewBackCb = ctx.get('previewBackCb')
     self._backAlias = ctx.get('previewAlias', VIEW_ALIAS.LOBBY_HANGAR)
     self.__manageVehicleModel = ctx.get('manageVehicleModel', False)
     if 'previewAppearance' in ctx:
         self.__vehAppearanceChanged = True
         g_currentPreviewVehicle.resetAppearance(ctx['previewAppearance'])
     else:
         self.__vehAppearanceChanged = False
     self.__previewDP = ctx.get('previewDP',
                                DefaultVehPreviewDataProvider())
     self.__isHeroTank = ctx.get('isHeroTank', False)
     self._skipConfirm = skipConfirm
     self._disableBuyButton = False
     self.__keepVehicleSelectionEnabled = False
     self._needToResetAppearance = True
     if 'objectSelectionEnabled' in ctx:
         self._objectSelectionEnabled = ctx.get('objectSelectionEnabled')
     return
Esempio n. 2
0
 def __init__(self, _=None):
     LobbySelectableView.__init__(self, 0)
     self.__currentCarouselAlias = None
     self.__isSpaceReadyForC11n = False
     self.__isVehicleReadyForC11n = False
     self.__isVehicleCameraReadyForC11n = False
     return
 def _dispose(self):
     g_clientUpdateManager.removeObjectCallbacks(self)
     g_currentPreviewVehicle.onComponentInstalled -= self.__updateStatus
     g_currentPreviewVehicle.onVehicleUnlocked -= self._updateBtnState
     g_currentPreviewVehicle.onVehicleInventoryChanged -= self.__onInventoryChanged
     g_currentPreviewVehicle.onChanged -= self.__onVehicleChanged
     self.comparisonBasket.onChange -= self.__onCompareBasketChanged
     self.comparisonBasket.onSwitchChange -= self.__updateHeaderData
     self.restores.onRestoreChangeNotify -= self.__onRestoreChanged
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange -= self.__onServerSettingsChanged
     self.hangarSpace.onSpaceCreate -= self.__onHangarCreateOrRefresh
     self.hangarSpace.setVehicleSelectable(
         self.__keepVehicleSelectionEnabled)
     self.removeListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                         self.handleSelectedEntityUpdated)
     if self._needToResetAppearance:
         g_currentPreviewVehicle.selectNoVehicle()
         g_currentPreviewVehicle.resetAppearance()
     if self._backAlias == VIEW_ALIAS.VEHICLE_PREVIEW:
         g_currentVehicle.refreshModel()
     self._previewBackCb = None
     self.__previewDP = None
     LobbySelectableView._dispose(self)
     if self.__vehAppearanceChanged:
         g_currentPreviewVehicle.resetAppearance()
     return
Esempio n. 4
0
 def _dispose(self):
     self.removeListener(LobbySimpleEvent.WAITING_SHOWN,
                         self.__onWaitingShown, EVENT_BUS_SCOPE.LOBBY)
     self.removeListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE,
                         self.__handleFightButtonUpdated,
                         scope=EVENT_BUS_SCOPE.LOBBY)
     self.removeListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                         self.__handleSelectedEntityUpdated)
     self.itemsCache.onSyncCompleted -= self.onCacheResync
     g_clientUpdateManager.removeObjectCallbacks(self)
     g_currentVehicle.onChanged -= self.__onCurrentVehicleChanged
     self.hangarSpace.onVehicleChangeStarted -= self.__onVehicleLoading
     self.hangarSpace.onVehicleChanged -= self.__onVehicleLoaded
     self.hangarSpace.onSpaceRefresh -= self.__onSpaceRefresh
     self.hangarSpace.onSpaceCreate -= self.__onSpaceCreate
     self.igrCtrl.onIgrTypeChanged -= self.__onIgrTypeChanged
     self.rankedController.onUpdated -= self.onRankedUpdate
     self.rankedController.onPrimeTimeStatusUpdated -= self.__onRankedPrimeStatusUpdate
     self.epicSkillsController.onUpdated -= self.__onEpicSkillsUpdate
     self.epicSkillsController.onPrimeTimeStatusUpdated -= self.__onEpicSkillsUpdate
     self.hangarSpace.setVehicleSelectable(False)
     g_prbCtrlEvents.onVehicleClientStateChanged -= self.__onVehicleClientStateChanged
     self._settingsCore.onSettingsChanged -= self.__onSettingsChanged
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange -= self.__onServerSettingChanged
     self.closeHelpLayout()
     self.stopGlobalListening()
     LobbySelectableView._dispose(self)
Esempio n. 5
0
 def _populate(self):
     LobbySelectableView._populate(self)
     self.__isSpaceReadyForC11n = self.hangarSpace.spaceInited
     self.__isVehicleReadyForC11n = self.hangarSpace.isModelLoaded
     self.__checkVehicleCameraState()
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     self.hangarSpace.onVehicleChangeStarted += self.__onVehicleLoading
     self.hangarSpace.onVehicleChanged += self.__onVehicleLoaded
     self.hangarSpace.onSpaceRefresh += self.__onSpaceRefresh
     self.hangarSpace.onSpaceCreate += self.__onSpaceCreate
     self.igrCtrl.onIgrTypeChanged += self.__onIgrTypeChanged
     self.itemsCache.onSyncCompleted += self.onCacheResync
     self.rankedController.onUpdated += self.onRankedUpdate
     self.rankedController.onPrimeTimeStatusUpdated += self.__onRankedPrimeStatusUpdate
     self.epicSkillsController.onUpdated += self.__onEpicSkillsUpdate
     self.epicSkillsController.onPrimeTimeStatusUpdated += self.__onEpicSkillsUpdate
     self.hangarSpace.setVehicleSelectable(True)
     g_prbCtrlEvents.onVehicleClientStateChanged += self.__onVehicleClientStateChanged
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingChanged
     self._settingsCore.onSettingsChanged += self.__onSettingsChanged
     g_clientUpdateManager.addMoneyCallback(self.onMoneyUpdate)
     g_clientUpdateManager.addCallbacks({})
     self.startGlobalListening()
     self.__updateAll()
     self.addListener(LobbySimpleEvent.WAITING_SHOWN, self.__onWaitingShown,
                      EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE,
                      self.__handleFightButtonUpdated,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                      self.__handleSelectedEntityUpdated)
     self._onPopulateEnd()
     self.statsCollector.noteHangarLoadingState(
         HANGAR_LOADING_STATE.HANGAR_UI_READY, showSummaryNow=True)
Esempio n. 6
0
 def __init__(self, _=None):
     LobbySelectableView.__init__(self, 0)
     self.__currentCarouselAlias = None
     self.__isSpaceReadyForC11n = False
     self.__isVehicleReadyForC11n = False
     self.__isVehicleCameraReadyForC11n = False
     self.__urlMacros = URLMacros()
     self.__teaser = None
     self.__seniorityAwardsIsActive = False
     return
 def __init__(self, _=None):
     LobbySelectableView.__init__(self, 0)
     self.__currentCarouselAlias = None
     self.__isSpaceReadyForC11n = False
     self.__isVehicleReadyForC11n = False
     self.__isVehicleCameraReadyForC11n = False
     self.__isUnitJoiningInProgress = False
     self.__urlMacros = URLMacros()
     self.__teaser = None
     self.__timer = None
     self.__wotPlusInfo = BigWorld.player().renewableSubscription
     self.__updateDogTagsState()
     self.__updateWotPlusState()
     return
Esempio n. 8
0
 def _populate(self):
     LobbySelectableView._populate(self)
     self.__isSpaceReadyForC11n = self.hangarSpace.spaceInited
     self.__isVehicleReadyForC11n = self.hangarSpace.isModelLoaded
     self.__checkVehicleCameraState()
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     self.hangarSpace.onVehicleChangeStarted += self.__onVehicleLoading
     self.hangarSpace.onVehicleChanged += self.__onVehicleLoaded
     self.hangarSpace.onSpaceRefresh += self.__onSpaceRefresh
     self.hangarSpace.onSpaceCreate += self.__onSpaceCreate
     self._festivityController.onStateChanged += self.__updateFestivityState
     self.igrCtrl.onIgrTypeChanged += self.__onIgrTypeChanged
     self.itemsCache.onSyncCompleted += self.onCacheResync
     self.rankedController.onUpdated += self.onRankedUpdate
     self.rankedController.onGameModeStatusTick += self.__updateAlertMessage
     self.__mapboxCtrl.onPrimeTimeStatusUpdated += self.__updateAlertMessage
     self.battleRoyaleController.onUpdated += self.__updateBattleRoyaleComponents
     self.epicController.onUpdated += self.__onEpicBattleUpdated
     self.epicController.onPrimeTimeStatusUpdated += self.__onEpicBattleUpdated
     self.epicController.onGameModeStatusTick += self.__updateAlertMessage
     self._promoController.onNewTeaserReceived += self.__onTeaserReceived
     self.hangarSpace.setVehicleSelectable(True)
     g_prbCtrlEvents.onVehicleClientStateChanged += self.__onVehicleClientStateChanged
     g_playerEvents.onPrebattleInvitationAccepted += self.__onPrebattleInvitationAccepted
     unitMgr = prb_getters.getClientUnitMgr()
     if unitMgr:
         unitMgr.onUnitJoined += self.__onUnitJoined
     g_clientUpdateManager.addCallbacks({'inventory': self.__updateAlertMessage})
     self.lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged
     self._settingsCore.onSettingsChanged += self.__onSettingsChanged
     self.__wotPlusInfo.onRenewableSubscriptionDataChanged += self.__onWotPlusDataChanged
     self.battlePassController.onSeasonStateChange += self.__switchCarousels
     self.startGlobalListening()
     self.__updateAll()
     self.addListener(LobbySimpleEvent.WAITING_SHOWN, self.__onWaitingShown, EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self.__handleFightButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED, self.__handleSelectedEntityUpdated)
     self.statsCollector.noteHangarLoadingState(HANGAR_LOADING_STATE.HANGAR_UI_READY, showSummaryNow=True)
     lobbyContext = dependency.instance(ILobbyContext)
     isCrewBooksEnabled = lobbyContext.getServerSettings().isCrewBooksEnabled()
     getTutorialGlobalStorage().setValue(GLOBAL_FLAG.CREW_BOOKS_ENABLED, isCrewBooksEnabled)
     self.__timer = CallbackDelayer()
     self.as_setNotificationEnabledS(crewBooksViewedCache().haveNewCrewBooks())
     self._offersBannerController.showBanners()
     self.fireEvent(events.HangarCustomizationEvent(events.HangarCustomizationEvent.RESET_VEHICLE_MODEL_TRANSFORM), scope=EVENT_BUS_SCOPE.LOBBY)
     if g_currentVehicle.isPresent():
         g_currentVehicle.refreshModel()
     if self.bootcampController.isInBootcamp():
         self.as_setDQWidgetLayoutS(DAILY_QUESTS_WIDGET_CONSTANTS.WIDGET_LAYOUT_SINGLE)
 def _dispose(self):
     self.removeListener(LobbySimpleEvent.WAITING_SHOWN,
                         self.__onWaitingShown, EVENT_BUS_SCOPE.LOBBY)
     self.removeListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE,
                         self.__handleFightButtonUpdated,
                         scope=EVENT_BUS_SCOPE.LOBBY)
     self.removeListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                         self.__handleSelectedEntityUpdated)
     self.itemsCache.onSyncCompleted -= self.onCacheResync
     g_currentVehicle.onChanged -= self.__onCurrentVehicleChanged
     self.hangarSpace.onVehicleChangeStarted -= self.__onVehicleLoading
     self.hangarSpace.onVehicleChanged -= self.__onVehicleLoaded
     self.hangarSpace.onSpaceRefresh -= self.__onSpaceRefresh
     self.hangarSpace.onSpaceCreate -= self.__onSpaceCreate
     self.igrCtrl.onIgrTypeChanged -= self.__onIgrTypeChanged
     self.rankedController.onUpdated -= self.onRankedUpdate
     self.rankedController.onGameModeStatusTick -= self.__updateAlertMessage
     self.__mapboxCtrl.onPrimeTimeStatusUpdated -= self.__updateAlertMessage
     self.__funRandomController.onGameModeStatusUpdated -= self.__updateAlertMessage
     self.battleRoyaleController.onUpdated -= self.__updateBattleRoyaleComponents
     self.epicController.onUpdated -= self.__onEpicBattleUpdated
     self.epicController.onPrimeTimeStatusUpdated -= self.__onEpicBattleUpdated
     self.epicController.onGameModeStatusTick -= self.__updateAlertMessage
     self._promoController.onNewTeaserReceived -= self.__onTeaserReceived
     if self.__teaser is not None:
         self.__teaser.stop()
         self.__teaser = None
     self.hangarSpace.setVehicleSelectable(False)
     g_prbCtrlEvents.onVehicleClientStateChanged -= self.__onVehicleClientStateChanged
     unitMgr = prb_getters.getClientUnitMgr()
     if unitMgr:
         unitMgr.onUnitJoined -= self.__onUnitJoined
     g_playerEvents.onPrebattleInvitationAccepted -= self.__onPrebattleInvitationAccepted
     g_clientUpdateManager.removeObjectCallbacks(self)
     self._settingsCore.onSettingsChanged -= self.__onSettingsChanged
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange -= self.__onServerSettingChanged
     self.__wotPlusInfo.onRenewableSubscriptionDataChanged -= self.__onWotPlusDataChanged
     self.battlePassController.onSeasonStateChanged -= self.__switchCarousels
     self.__timer.clearCallbacks()
     self.__timer = None
     self.closeHelpLayout()
     self.stopGlobalListening()
     self._offersBannerController.hideBanners()
     LobbySelectableView._dispose(self)
     return
Esempio n. 10
0
 def _populate(self):
     LobbySelectableView._populate(self)
     self.__isSpaceReadyForC11n = self.hangarSpace.spaceInited
     self.__isVehicleReadyForC11n = self.hangarSpace.isModelLoaded
     self.__checkVehicleCameraState()
     g_currentVehicle.onChanged += self.__onCurrentVehicleChanged
     self.hangarSpace.onVehicleChangeStarted += self.__onVehicleLoading
     self.hangarSpace.onVehicleChanged += self.__onVehicleLoaded
     self.hangarSpace.onSpaceRefresh += self.__onSpaceRefresh
     self.hangarSpace.onSpaceCreate += self.__onSpaceCreate
     self.igrCtrl.onIgrTypeChanged += self.__onIgrTypeChanged
     self.itemsCache.onSyncCompleted += self.onCacheResync
     self.rankedController.onUpdated += self.onRankedUpdate
     self.rankedController.onGameModeStatusTick += self.__updateAlertMessage
     self.battleRoyaleController.onUpdated += self.__updateBattleRoyaleComponents
     self.epicController.onUpdated += self.__onEpicSkillsUpdate
     self.epicController.onPrimeTimeStatusUpdated += self.__onEpicSkillsUpdate
     self._promoController.onNewTeaserReceived += self.__onTeaserReceived
     self.hangarSpace.setVehicleSelectable(True)
     g_prbCtrlEvents.onVehicleClientStateChanged += self.__onVehicleClientStateChanged
     g_clientUpdateManager.addCallbacks({'inventory': self.__updateAlertMessage})
     self.lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged
     self._settingsCore.onSettingsChanged += self.__onSettingsChanged
     self.battlePassController.onSeasonStateChange += self.__switchCarousels
     self._countdownController.onEventStateChanged += self.__updateTenYearsCountdownEntryPointVisibility
     self._countdownController.onEventBlockChanged += self.__updateTenYearsCountdownEntryPointVisibility
     self._countdownController.onBlocksDataValidityChanged += self.__updateTenYearsCountdownEntryPointVisibility
     self._hangarLoadingController.onHangarLoadedAfterLogin += self.__onHangarLoadedAfterLogin
     self.startGlobalListening()
     g_eventBus.addListener(AmmunitionSetupViewEvent.HINT_ZONE_ADD, self.__onHintZoneAdded, EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.addListener(AmmunitionSetupViewEvent.HINT_ZONE_HIDE, self.__onHintZoneHide, EVENT_BUS_SCOPE.LOBBY)
     self.__updateAll()
     self.addListener(LobbySimpleEvent.WAITING_SHOWN, self.__onWaitingShown, EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self.__handleFightButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED, self.__handleSelectedEntityUpdated)
     self.statsCollector.noteHangarLoadingState(HANGAR_LOADING_STATE.HANGAR_UI_READY, showSummaryNow=True)
     lobbyContext = dependency.instance(ILobbyContext)
     isCrewBooksEnabled = lobbyContext.getServerSettings().isCrewBooksEnabled()
     getTutorialGlobalStorage().setValue(GLOBAL_FLAG.CREW_BOOKS_ENABLED, isCrewBooksEnabled)
     self.as_setNotificationEnabledS(crewBooksViewedCache().haveNewCrewBooks())
     self.__updateSenorityEntryPoint()
     self.__updateTenYearsCountdownEntryPointVisibility()
     self._offersBannerController.showBanners()
 def _populate(self):
     g_currentPreviewVehicle.selectVehicle(self._vehicleCD,
                                           self.__vehicleStrCD)
     LobbySelectableView._populate(self)
     g_clientUpdateManager.addMoneyCallback(self._updateBtnState)
     g_clientUpdateManager.addCallbacks(
         {'stats.freeXP': self._updateBtnState})
     g_currentPreviewVehicle.onComponentInstalled += self.__updateStatus
     g_currentPreviewVehicle.onVehicleUnlocked += self._updateBtnState
     g_currentPreviewVehicle.onVehicleInventoryChanged += self.__onInventoryChanged
     g_currentPreviewVehicle.onChanged += self.__onVehicleChanged
     self.comparisonBasket.onChange += self.__onCompareBasketChanged
     self.comparisonBasket.onSwitchChange += self.__updateHeaderData
     self.restores.onRestoreChangeNotify += self.__onRestoreChanged
     self.hangarSpace.onSpaceCreate += self.__onHangarCreateOrRefresh
     self.hangarSpace.setVehicleSelectable(True)
     if g_currentPreviewVehicle.isPresent():
         self.__fullUpdate()
     else:
         event_dispatcher.showHangar()
     self.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                      self.handleSelectedEntityUpdated)
Esempio n. 12
0
 def _dispose(self):
     self.removeListener(LobbySimpleEvent.WAITING_SHOWN, self.__onWaitingShown, EVENT_BUS_SCOPE.LOBBY)
     self.removeListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self.__handleFightButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY)
     self.removeListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED, self.__handleSelectedEntityUpdated)
     self.itemsCache.onSyncCompleted -= self.onCacheResync
     g_currentVehicle.onChanged -= self.__onCurrentVehicleChanged
     self.hangarSpace.onVehicleChangeStarted -= self.__onVehicleLoading
     self.hangarSpace.onVehicleChanged -= self.__onVehicleLoaded
     self.hangarSpace.onSpaceRefresh -= self.__onSpaceRefresh
     self.hangarSpace.onSpaceCreate -= self.__onSpaceCreate
     self.igrCtrl.onIgrTypeChanged -= self.__onIgrTypeChanged
     self.rankedController.onUpdated -= self.onRankedUpdate
     self.rankedController.onGameModeStatusTick -= self.__updateAlertMessage
     self.battleRoyaleController.onUpdated -= self.__updateBattleRoyaleComponents
     self.epicController.onUpdated -= self.__onEpicSkillsUpdate
     self.epicController.onPrimeTimeStatusUpdated -= self.__onEpicSkillsUpdate
     self._promoController.onNewTeaserReceived -= self.__onTeaserReceived
     if self.__teaser is not None:
         self.__teaser.stop()
         self.__teaser = None
     self.hangarSpace.setVehicleSelectable(False)
     g_prbCtrlEvents.onVehicleClientStateChanged -= self.__onVehicleClientStateChanged
     g_clientUpdateManager.removeObjectCallbacks(self)
     self._settingsCore.onSettingsChanged -= self.__onSettingsChanged
     self.lobbyContext.getServerSettings().onServerSettingsChange -= self.__onServerSettingChanged
     self.battlePassController.onSeasonStateChange -= self.__switchCarousels
     self._countdownController.onEventStateChanged -= self.__updateTenYearsCountdownEntryPointVisibility
     self._countdownController.onEventBlockChanged -= self.__updateTenYearsCountdownEntryPointVisibility
     self._countdownController.onBlocksDataValidityChanged -= self.__updateTenYearsCountdownEntryPointVisibility
     self._hangarLoadingController.onHangarLoadedAfterLogin -= self.__onHangarLoadedAfterLogin
     self.closeHelpLayout()
     self.stopGlobalListening()
     g_eventBus.removeListener(AmmunitionSetupViewEvent.HINT_ZONE_ADD, self.__onHintZoneAdded, EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.removeListener(AmmunitionSetupViewEvent.HINT_ZONE_HIDE, self.__onHintZoneHide, EVENT_BUS_SCOPE.LOBBY)
     self._offersBannerController.hideBanners()
     LobbySelectableView._dispose(self)
     return
Esempio n. 13
0
 def _fade3DEntityAndHideTT(self, entity):
     LobbySelectableView._fade3DEntityAndHideTT(self, entity)
     self.as_hide3DSceneTooltipS()
Esempio n. 14
0
 def _highlight3DEntityAndShowTT(self, entity):
     LobbySelectableView._highlight3DEntityAndShowTT(self, entity)
     itemId = entity.selectionId
     if itemId:
         self.as_show3DSceneTooltipS(TOOLTIPS_CONSTANTS.ENVIRONMENT,
                                     [itemId])