def _dispose(self):
     self.fireEvent(LobbyHeaderMenuEvent(LobbyHeaderMenuEvent.TOGGLE_VISIBILITY, ctx={'state': HeaderMenuVisibilityState.ONLINE_COUNTER}), EVENT_BUS_SCOPE.LOBBY)
     self.service.resumeHighlighter()
     self.lobbyContext.getServerSettings().onServerSettingsChange -= self.__onServerSettingChanged
     g_clientUpdateManager.removeObjectCallbacks(self)
     self.__ctx = None
     self.__c11nView = None
     self.__blur.enable = False
     super(PurchaseWindow, self)._dispose()
     return
 def _dispose(self):
     self.fireEvent(events.HangarCustomizationEvent(
         events.HangarCustomizationEvent.RESET_VEHICLE_MODEL_TRANSFORM),
                    scope=EVENT_BUS_SCOPE.LOBBY)
     self.fireEvent(
         LobbyHeaderMenuEvent(LobbyHeaderMenuEvent.TOGGLE_VISIBILITY,
                              ctx={'state': HeaderMenuVisibilityState.ALL}),
         EVENT_BUS_SCOPE.LOBBY)
     self.fireEvent(
         CameraRelatedEvents(
             CameraRelatedEvents.FORCE_DISABLE_IDLE_PARALAX_MOVEMENT,
             ctx={'isDisable': False}), EVENT_BUS_SCOPE.LOBBY)
     if g_appLoader.getSpaceID() != _SPACE_ID.LOGIN:
         self.__releaseItemSound()
         self.soundManager.playInstantSound(SOUNDS.EXIT)
     if self.__ctx.c11CameraManager is not None:
         if self.__locatedOnEmbelem:
             self.__ctx.c11CameraManager.clearSelectedEmblemInfo()
         self.__ctx.c11CameraManager.locateCameraToStartState()
     self._seasonSoundAnimantion = None
     self.__renderEnv.enable(False)
     self.__renderEnv = None
     self.__viewLifecycleWatcher.stop()
     self.service.stopHighlighter()
     self.lobbyContext.deleteHeaderNavigationConfirmator(
         self.__confirmHeaderNavigation)
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange -= self.__onServerSettingChanged
     self.hangarSpace.onSpaceCreate -= self.__onSpaceCreateHandler
     self.hangarSpace.onSpaceDestroy -= self.__onSpaceDestroyHandler
     self.hangarSpace.onSpaceRefresh -= self.__onSpaceRefreshHandler
     self.service.onRegionHighlighted -= self.__onRegionHighlighted
     if g_currentVehicle.item:
         g_tankActiveCamouflage[
             g_currentVehicle.item.intCD] = self.__ctx.currentSeason
         g_currentVehicle.refreshModel()
     self.__hidePropertiesSheet()
     self.__propertiesSheet = None
     self.__ctx.onPropertySheetShown -= self.__onPropertySheetShown
     self.__ctx.onPropertySheetHidden -= self.__onPropertySheetHidden
     self.__ctx.onCaruselItemSelected -= self.__onCarouselItemSelected
     self.__ctx.onChangesCanceled -= self.__onChangesCanceled
     self.__ctx.onCacheResync -= self.__onCacheResync
     self.__ctx.onCustomizationItemsBought -= self.__onItemsBought
     self.__ctx.onCustomizationItemsRemoved -= self.__onItemsRemoved
     self.__ctx.onCustomizationItemInstalled -= self.__onItemsInstalled
     self.__ctx.onCustomizationTabChanged -= self.__onTabChanged
     self.__ctx.onCustomizationModeChanged -= self.__onModeChanged
     self.__ctx.onCustomizationSeasonChanged -= self.__onSeasonChanged
     self.__ctx.onClearItem -= self.__onClearItem
     self.__ctx = None
     self.service.destroyCtx()
     super(MainView, self)._dispose()
     return
 def _populate(self):
     super(MainView, self)._populate()
     self.__ctx = self.service.getCtx()
     self.__ctx.onCustomizationSeasonChanged += self.__onSeasonChanged
     self.__ctx.onCustomizationModeChanged += self.__onModeChanged
     self.__ctx.onCustomizationTabChanged += self.__onTabChanged
     self.__ctx.onCustomizationItemInstalled += self.__onItemsInstalled
     self.__ctx.onCustomizationItemsRemoved += self.__onItemsRemoved
     self.__ctx.onCustomizationItemsBought += self.__onItemsBought
     self.__ctx.onCacheResync += self.__onCacheResync
     self.__ctx.onChangesCanceled += self.__onChangesCanceled
     self.__ctx.onCaruselItemSelected += self.__onCarouselItemSelected
     self.__ctx.onPropertySheetHidden += self.__onPropertySheetHidden
     self.__ctx.onPropertySheetShown += self.__onPropertySheetShown
     self.__ctx.onClearItem += self.__onClearItem
     self.soundManager.playInstantSound(SOUNDS.ENTER)
     self.__viewLifecycleWatcher.start(self.app.containerManager, [
         _ModalWindowsPopupHandler(),
         _C11ViewsPopupHandler(self.__hidePropertiesSheet)
     ])
     self.lobbyContext.addHeaderNavigationConfirmator(
         self.__confirmHeaderNavigation)
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingChanged
     self.hangarSpace.onSpaceCreate += self.__onSpaceCreateHandler
     self.hangarSpace.onSpaceDestroy += self.__onSpaceDestroyHandler
     self.hangarSpace.onSpaceRefresh += self.__onSpaceRefreshHandler
     self.service.onRegionHighlighted += self.__onRegionHighlighted
     self._seasonSoundAnimantion = _SeasonSoundAnimantion(
         len(SeasonType.COMMON_SEASONS), self.soundManager)
     self.__setHeaderInitData()
     self.__setSeasonData()
     self.__ctx.refreshOutfit()
     self.as_selectSeasonS(SEASON_TYPE_TO_IDX[self.__ctx.currentSeason])
     self.fireEvent(
         CameraRelatedEvents(
             CameraRelatedEvents.FORCE_DISABLE_IDLE_PARALAX_MOVEMENT,
             ctx={'isDisable': True}), EVENT_BUS_SCOPE.LOBBY)
     self.fireEvent(
         LobbyHeaderMenuEvent(
             LobbyHeaderMenuEvent.TOGGLE_VISIBILITY,
             ctx={'state': HeaderMenuVisibilityState.ONLINE_COUNTER}),
         EVENT_BUS_SCOPE.LOBBY)
     self._isPropertySheetShown = False
     if self.__ctx.c11CameraManager is not None:
         self.__ctx.c11CameraManager.locateCameraToCustomizationPreview(
             forceLocate=True)
     self.__renderEnv = BigWorld.CustomizationEnvironment()
     self.__renderEnv.enable(True)
     if self.__ctx.vehicleAnchorsUpdater is not None:
         self.__ctx.vehicleAnchorsUpdater.setMainView(self.flashObject)
     return
 def _dispose(self):
     self.fireEvent(
         LobbyHeaderMenuEvent(LobbyHeaderMenuEvent.MENY_HIDE,
                              ctx={'hide': False}), EVENT_BUS_SCOPE.LOBBY)
     self.service.resumeHighlighter()
     self.lobbyContext.getServerSettings(
     ).onServerSettingsChange -= self.__onServerSettingChanged
     g_clientUpdateManager.removeObjectCallbacks(self)
     self.__ctx = None
     self.__c11nView = None
     self.__blur.enable = False
     super(PurchaseWindow, self)._dispose()
     return
    def _populate(self):
        super(PurchaseWindow, self)._populate()
        self.service.suspendHighlighter()
        self.lobbyContext.getServerSettings(
        ).onServerSettingsChange += self.__onServerSettingChanged
        self.__c11nView = self.app.containerManager.getContainer(
            ViewTypes.LOBBY_SUB).getView()
        self.__ctx = self.service.getCtx()
        purchaseItems = self.__ctx.getPurchaseItems()
        g_clientUpdateManager.addMoneyCallback(self.__setTotalData)
        self.__isStyle, self.__purchaseItems, processor = _ProcessorSelector.selectFor(
            purchaseItems)
        processor.process(self.__purchaseItems)
        itemDescriptors = processor.itemsDescriptors
        if not self.__isStyle:
            for season in SeasonType.COMMON_SEASONS:
                for item in itemDescriptors[season]:
                    self.__items[item.identificator] = _SelectItemData(
                        season, item.quantity, item.purchaseIndices)
                    self.__counters[season][int(
                        item.isFromInventory)] += item.quantity

        self.as_setDataS({
            'summerData':
            [item.getVO() for item in itemDescriptors[SeasonType.SUMMER]],
            'winterData':
            [item.getVO() for item in itemDescriptors[SeasonType.WINTER]],
            'desertData':
            [item.getVO() for item in itemDescriptors[SeasonType.DESERT]]
        })
        self.__setTitlesData()
        self.__setTotalData()
        self.__blur.enable = True
        self.fireEvent(
            LobbyHeaderMenuEvent(LobbyHeaderMenuEvent.MENY_HIDE,
                                 ctx={'hide': True}), EVENT_BUS_SCOPE.LOBBY)