def onCacheResync(self, reason, diff): if diff is not None and GUI_ITEM_TYPE.CREW_BOOKS in diff: self.as_setNotificationEnabledS(crewBooksViewedCache().haveNewCrewBooks()) if reason == CACHE_SYNC_REASON.SHOP_RESYNC: self.__updateAll() return else: if diff is not None and GUI_ITEM_TYPE.VEHICLE in diff and g_currentVehicle.isPresent(): if g_currentVehicle.item.invID in diff[GUI_ITEM_TYPE.VEHICLE]: self.__updateAmmoPanel() self.__updateSenorityEntryPoint() return
def __onCurrentVehicleChanged(self): Waiting.show('updateVehicle') self.__updateState() self.__updateAmmoPanel() self.__updateParams() self.__updateVehicleInResearchPanel() self.__updateHeader() self.__updateHeaderComponent() self.__updateHeaderEpicWidget() self.__updateCrew() self.as_setNotificationEnabledS(crewBooksViewedCache().haveNewCrewBooks()) self._updateBattleRoyaleMode() Waiting.hide('updateVehicle')
def onClientUpdate(diff, updateOnlyLobbyCtx): yield lambda callback: callback(None) if updateOnlyLobbyCtx: ServicesLocator.lobbyContext.update(diff) else: if isPlayerAccount(): yield crewBooksViewedCache().onCrewBooksUpdated(diff) yield ServicesLocator.itemsCache.update( CACHE_SYNC_REASON.CLIENT_UPDATE, diff) yield ServicesLocator.eventsCache.update(diff) yield g_clanCache.update(diff) ServicesLocator.lobbyContext.update(diff) g_clientUpdateManager.update(diff) ServicesLocator.offersProvider.update(diff)
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 _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 __getNotificationEnabledFlag(self, operationId): return crewBooksViewedCache().haveNewCrewBooks( ) if operationId == OPERATION_CREW_BOOKS else False