コード例 #1
0
 def _finalize(self):
     setOverlayHangarGeneral(False)
     fireHideMultiOpenView()
     self.__showHideCloseHandler.stopListen()
     self.__showHideCloseHandler = None
     self.viewModel.onOpenBox -= self.__onOpenBox
     self.viewModel.openNextBoxes -= self.__openNextBoxes
     self.viewModel.onViewShowed -= self.__onViewShowed
     self.viewModel.showSpecialReward -= self.__showSpecialReward
     self.viewModel.onClose -= self.__onWindowClose
     self.viewModel.guaranteedReward.onInfoClick -= self.__onGuaranteedRewardsInfo
     self.itemsCache.onSyncCompleted -= self.__onCacheResync
     self._festivityController.onStateChanged -= self.__onStateChange
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange -= self.__onServerSettingChanged
     g_eventBus.removeListener(
         LootboxesEvent.ON_SHOW_SPECIAL_REWARDS_CLOSED,
         self.__onSpecialRewardsClosed,
         scope=EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.removeListener(events.LootboxesEvent.ON_STATISTICS_RESET,
                               self.__onStatisticsReset,
                               scope=EVENT_BUS_SCOPE.LOBBY)
     self.__specialRewardData.clear()
     super(LootBoxPremiumMultiOpenView, self)._finalize()
     return
コード例 #2
0
 def _finalize(self):
     setOverlayHangarGeneral(False)
     self.releaseGiftEventHub()
     self.viewModel.onCloseBtnClick -= self.__onWindowClose
     self.viewModel.onNextBtnClick -= self.__onOpenNextBox
     self.viewModel.onVideoChangeClick -= self.__onVideoSettingsChanged
     self.viewModel.onDestroyEvent -= self.__onDestroy
     self.viewModel.showSpecialReward -= self.__showSpecialReward
     self.viewModel.onBuyBoxBtnClick -= self.__onBuyBoxBtnClick
     self.viewModel.onSpecialActionBtnClick -= self.__onSpecialActionButtonClick
     self.viewModel.guaranteedReward.onInfoClick -= self.__onGuaranteedRewardsInfo
     self.festivityController.onStateChanged -= self.__onStateChange
     self.itemsCache.onSyncCompleted -= self.__onCacheResync
     self.settingsCore.onSettingsChanged -= self.__onSettingsChanged
     self.lobbyContext.getServerSettings().onServerSettingsChange -= self.__onServerSettingChanged
     if not self._isMemoryRiskySystem:
         g_eventBus.removeListener(LootboxesEvent.ON_SHOW_SPECIAL_REWARDS_CLOSED, self.__onSpecialRewardsClosed, scope=EVENT_BUS_SCOPE.LOBBY)
     if self._isMemoryRiskySystem:
         g_eventBus.removeListener(LootboxesEvent.ON_VIDEO_OFF_MOVIE_LOADED, self.__onVideoOffMovieLoaded, scope=EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.removeListener(LootboxesEvent.ON_OPENING_START, self.__onOpeningStart, scope=EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.removeListener(LootboxesEvent.NEED_SHOW_REWARDS, self.__needShowRewards, scope=EVENT_BUS_SCOPE.LOBBY)
     g_eventBus.removeListener(events.LootboxesEvent.ON_STATISTICS_RESET, self.__onStatisticsReset, scope=EVENT_BUS_SCOPE.LOBBY)
     if self._isMemoryRiskySystem:
         self.__stateKeeper.preserve(self)
     self.__rewards.clear()
     self.__tooltips.clear()
     self.__giftsInfo = None
     super(LootBoxRewardView, self)._finalize()
     return
コード例 #3
0
 def _initialize(self, *args, **kwargs):
     super(LootBoxPremiumMultiOpenView, self)._initialize()
     self.__showHideCloseHandler.startListen(self.getParentWindow())
     playSound(LootBoxViewEvents.PREMIUM_MULTI_ENTER)
     setOverlayHangarGeneral(True)
     if args and len(args) == 3:
         self.__boxItem, rewards, self.__needToOpen = args
         self.__currentRewardsPage = 1
         self.viewModel.onOpenBox += self.__onOpenBox
         self.viewModel.openNextBoxes += self.__openNextBoxes
         self.viewModel.onClose += self.__onWindowClose
         self.viewModel.showSpecialReward += self.__showSpecialReward
         self.viewModel.onViewShowed += self.__onViewShowed
         self.viewModel.guaranteedReward.onInfoClick += self.__onGuaranteedRewardsInfo
         self.itemsCache.onSyncCompleted += self.__onCacheResync
         self._festivityController.onStateChanged += self.__onStateChange
         self.lobbyContext.getServerSettings(
         ).onServerSettingsChange += self.__onServerSettingChanged
         g_eventBus.addListener(
             LootboxesEvent.ON_SHOW_SPECIAL_REWARDS_CLOSED,
             self.__onSpecialRewardsClosed,
             scope=EVENT_BUS_SCOPE.LOBBY)
         g_eventBus.addListener(events.LootboxesEvent.ON_STATISTICS_RESET,
                                self.__onStatisticsReset,
                                scope=EVENT_BUS_SCOPE.LOBBY)
         with self.viewModel.transaction() as model:
             model.setIsMemoryRiskySystem(self._isMemoryRiskySystem)
         self.__update()
         self.__updateBoxesAvailability()
         self.__appendRewards(rewards[0], forceClearPage=True)
コード例 #4
0
 def _finalize(self):
     setOverlayHangarGeneral(False)
     self.viewModel.onCloseBtnClick -= self.__onWindowClose
     self.viewModel.onOpenBox -= self.__onOpenBox
     self.itemsCache.onSyncCompleted -= self.__onCacheResync
     self._festivityController.onStateChanged -= self.__onStateChange
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange -= self.__onServerSettingChanged
     super(LootBoxMultiOpenView, self)._finalize()
コード例 #5
0
 def __setRewards(self):
     with self.getViewModel().transaction() as tx:
         bonuses = getMergedBonusesFromDicts(self.__rewards)
         packBonusGroups(bonuses=bonuses,
                         groupModelsList=tx.rewardRows,
                         groupsLayout=self.__getGroupsLayout(),
                         packer=getLootBoxBonusPacker(),
                         tooltipsData=self.__tooltips)
     setOverlayHangarGeneral(True)
コード例 #6
0
 def _finalize(self):
     NewYearSoundsManager.playEvent(
         NewYearSoundEvents.AWARD_STYLE_SCREEN_EXIT)
     setOverlayHangarGeneral(False)
     super(NewYearStyleRewardView, self)._finalize()
     self.__rewards = None
     self.viewModel.onClose -= self.__onClose
     self._nyController.onStateChanged -= self.__onEventStateChanged
     return
コード例 #7
0
    def __updateRewards(self):
        with self.getViewModel().transaction() as tx:
            rewardsList = tx.getRewards()
            rewardsList.clear()
            bonuses, specialRewardType = getEpicFormattedLootboxBonuses(self.__rewards, AWARDS_MAX_COUNT)
            for index, reward in enumerate(bonuses):
                presenter = getLootboxRendererModelPresenter(reward)
                rewardRender = presenter.getModel(reward, index, showCongrats=True)
                rewardsList.addViewModel(rewardRender)
                self.__addTooltip(index, reward)

            rewardsList.invalidate()
            tx.setSyncInitiator((tx.getSyncInitiator() + 1) % 1000)
            tx.setSpecialRewardType(specialRewardType)
            tx.setIsSpecialRewardClosed(self.__isBackward)
        setOverlayHangarGeneral(True)
コード例 #8
0
 def _finalize(self):
     self.setHold(False)
     g_messengerEvents.onUnlockPopUpMessages(key=self.__class__.__name__)
     setOverlayHangarGeneral(False)
     super(NyAtmosphereLevelUpView, self)._finalize()
     self.__removeSyncHandler()
     self.__removeSpaceHandler()
     self.viewModel.onClose -= self.__onCloseAction
     self.viewModel.onGoToTanks -= self.__onGoToTanks
     self.__nyController.onStateChanged -= self.__onEventStateChanged
     self.__videoStartStopHandler.onVideoDone()
     self.__rewards = None
     if self.__callbackId is not None:
         BigWorld.cancelCallback(self.__callbackId)
     if self.__isFirstLevelUp:
         self.__processVehicleChange()
     return
コード例 #9
0
 def _finalize(self):
     setOverlayHangarGeneral(False)
     self._removeListeners()
     self._tooltips.clear()
コード例 #10
0
 def _initialize(self, *args, **kwargs):
     setOverlayHangarGeneral(True)
     self._addListeners()
コード例 #11
0
 def _initialize(self, *args, **kwargs):
     super(NyAtmosphereLevelUpView, self)._initialize(*args, **kwargs)
     setOverlayHangarGeneral(True)
     g_messengerEvents.onLockPopUpMessages(key=self.__class__.__name__,
                                           lockHigh=True)
コード例 #12
0
 def _initialize(self, rewards):
     super(NewYearStyleRewardView, self)._initialize()
     NewYearSoundsManager.playEvent(NewYearSoundEvents.AWARD_STYLE_SCREEN)
     self.viewModel.onClose += self.__onClose
     self._nyController.onStateChanged += self.__onEventStateChanged
     setOverlayHangarGeneral(True)
コード例 #13
0
 def _finalize(self):
     self.__removeListeners()
     setOverlayHangarGeneral(onState=False)
コード例 #14
0
 def _onLoaded(self, *args, **kwargs):
     setOverlayHangarGeneral(onState=True)
     NewYearSoundsManager.playEvent(
         NewYearSoundEvents.CELEBRITY_SCREEN_REWARD)
     super(ChallengeRewardView, self)._onLoaded(*args, **kwargs)