def _populate(self): super(TankCarousel, self)._populate() g_playerEvents.onBattleResultsReceived += self.__onFittingUpdate self.lobbyContext.getServerSettings( ).onServerSettingsChange += self.__onServerSettingsUpdate self.__settingsCore.onSettingsChanged += self.__onSettingsChanged self.restoreCtrl.onRestoreChangeNotify += self.__onFittingUpdate self.app.loaderManager.onViewLoaded += self.__onViewLoaded self.nyController.onDataUpdated += self.__onVehicleBranchUpdated self.nyController.onStateChanged += self.__onVehicleBranchStateChanged self._vehBranchEnabled = self.nyController.isVehicleBranchEnabled() g_clientUpdateManager.addCallbacks({ 'stats.credits': self.__onFittingUpdate, 'stats.gold': self.__onFittingUpdate, 'stats.vehicleSellsLeft': self.__onFittingUpdate, 'stats.slots': self.__onFittingUpdate, 'goodies': self.__onFittingUpdate, 'tokens': self.__onTokensUpdate }) setting = self.settingsCore.options.getSetting( settings_constants.GAME.CAROUSEL_TYPE) self.as_rowCountS(setting.getRowCount()) setting = self.settingsCore.options.getSetting( settings_constants.GAME.DOUBLE_CAROUSEL_TYPE) self.as_setSmallDoubleCarouselS(setting.enableSmallCarousel()) self.as_initCarouselFilterS( self._getInitialFilterVO( getFilterSetupContexts( self.itemsCache.items.shop.dailyXPFactor))) self._lastVehicleBranch = set( self.itemsCache.items.festivity.getVehicleBranch())
def updateVehicles(self, vehicles=None, filterCriteria=None): super(TankCarousel, self).updateVehicles(vehicles, filterCriteria) if vehicles is None and filterCriteria is None: self.as_initCarouselFilterS( self._getInitialFilterVO( getFilterSetupContexts( self.itemsCache.items.shop.dailyXPFactor))) return
def __onVehicleBranchStateChanged(self): branchEnabled = self.nyController.isVehicleBranchEnabled() if branchEnabled == self._vehBranchEnabled: return self._vehBranchEnabled = branchEnabled self.filter.newYearReset() if self._carouselDP: self._carouselDP.updateVehicleBranch() self.__updateNewYearVehicles(self._lastVehicleBranch - {EMPTY_VEH_INV_ID}) self.as_initCarouselFilterS( self._getInitialFilterVO( getFilterSetupContexts( self.itemsCache.items.shop.dailyXPFactor))) self.applyFilter()
def _populate(self): super(TankCarousel, self)._populate() g_playerEvents.onBattleResultsReceived += self.__onFittingUpdate self.app.loaderManager.onViewLoaded += self.__onViewLoaded g_clientUpdateManager.addCallbacks({ 'stats.credits': self.__onFittingUpdate, 'stats.gold': self.__onFittingUpdate, 'stats.vehicleSellsLeft': self.__onFittingUpdate, 'stats.slots': self.__onFittingUpdate, 'goodies': self.__onFittingUpdate }) setting = self.settingsCore.options.getSetting( settings_constants.GAME.CAROUSEL_TYPE) self.as_rowCountS(setting.getRowCount()) setting = self.settingsCore.options.getSetting( settings_constants.GAME.DOUBLE_CAROUSEL_TYPE) self.as_setSmallDoubleCarouselS(setting.enableSmallCarousel()) self.as_initCarouselFilterS( self._getInitialFilterVO( getFilterSetupContexts( self.itemsCache.items.shop.dailyXPFactor)))
def _populate(self): super(BattleTankCarousel, self)._populate() self.app.loaderManager.onViewLoaded += self.__onViewLoaded self.as_useExtendedCarouselS(True) self.as_initCarouselFilterS( self._getInitialFilterVO(getFilterSetupContexts(1)))