def _populate(self): super(NY_Break, self)._populate() NYSoundEvents.playSound(NYSoundEvents.ON_OPEN_BREAK) NYSoundEvents.setState(NYSoundEvents.STATE_ON_BREAK) self.resetFilters() self.__selectedToys.clear() self.__gain = 0 self.__inDispose = False self.__inBreakDlg = False toys, total, sortedTotal = self.__updateShownToysAndSelection() initData = { 'cancelBtnLabel': NY.BREAKSCREEN_CANCELBTN_LABEL, 'backBtnDescrLabel': NY.BREAKSCREEN_BACKBTN_TO_HANGAR, 'breakToyFragmentTitle': NY.BREAKSCREEN_BREAKTOYFRAGMENT_TITLE, 'lackToyFragmentTitle': NY.BREAKSCREEN_LACKTOYFRAGMENT_TITLE, 'balanceToyFragmentTitle': NY.BREAKSCREEN_BALANCETOYFRAGMENT_TITLE, 'enoughToyFragmentTitle': NY.BREAKSCREEN_ENOUGHTOYFRAGMENT_TITLE, 'dummyVO': self._getDummy(), 'dummyFilterVO': self._getDummyFilter(), 'decorationsAmountText': formatSortString(total, sortedTotal), 'title': NY.BREAKSCREEN_TITLE } self.as_setInitDataS(initData) self.as_setToysS(toys) self.as_setBalanceToyFragmentS( BigWorld.wg_getIntegralFormat( self._newYearController.getToyFragments())) self.__updateSelectedToyPrice() self.__updateBreakButton() self._newYearController.onToyFragmentsChanged += self.__onToyFragmentsChanged self._newYearController.onToysBreak += self.__showOnToysBreakAnimation self._newYearController.onToysBreakFailed += self.__onToysBreakFailed self._newYearController.onInventoryUpdated += self.__updateToys self.newYearUIManager.onCraftPopoverFilterChanged += self.__updateToys
def _populate(self): super(NYRewards, self)._populate() self.__nyLevel, self.__nyMaxLevel, _, _ = self._newYearController.getProgress( ) self.__updateData() NYSoundEvents.playSound(NYSoundEvents.ON_OPEN_REWARDS) NYSoundEvents.setState(NYSoundEvents.STATE_ON_REWARDS) self._newYearController.onProgressChanged += self.__onNYProgressChanged self._newYearController.vehDiscountsStorage.onUpdated += self.__onStoragesUpdated self._newYearController.tankmanDiscountsStorage.onUpdated += self.__onStoragesUpdated
def _populate(self): super(NYCraft, self)._populate() self._newYearController.clearCraftedToys() selectedToy = self.newYearUIManager.getSelectedCraftToy() self.__toyType = selectedToy.get('type', None) if selectedToy else None self.__toyLevel = selectedToy.get('level', None) if selectedToy else None self.__toyNation = selectedToy.get('nation', None) if selectedToy else None initData = { 'shardsBtnLabel': NY.CRAFTSCREEN_BUTTONS_SHARDSBTN, 'craftBtnLabel': NY.CRAFTSCREEN_BUTTONS_CRAFTBTN, 'title': NY.CRAFTSCREEN_TITLE, 'shardsDescription': NY.CRAFTSCREEN_DESCRIPTION, 'toyFragmentCount': BigWorld.wg_getIntegralFormat( self._newYearController.getToyFragments()), 'nationsBlock': { 'title': NY.CRAFTSCREEN_NATIONSLIDER_TITLE, 'selectedId': indexByToyNation(self.__toyNation), 'typeId': NY_CONSTANTS.NATIONS_SECTION, 'tooltips': [ NY.CRAFTSCREEN_NATIONSLIDER_TOOLTIP_ANY, NY.CRAFTSCREEN_NATIONSLIDER_TOOLTIP_SOVIET, NY.CRAFTSCREEN_NATIONSLIDER_TOOLTIP_MODERNWESTERN, NY.CRAFTSCREEN_NATIONSLIDER_TOOLTIP_TRADITIONALWESTERN, NY.CRAFTSCREEN_NATIONSLIDER_TOOLTIP_ASIAN ] }, 'typesBlock': { 'title': NY.CRAFTSCREEN_TYPESLIDER_TITLE, 'selectedId': indexByToyType(self.__toyType), 'typeId': NY_CONSTANTS.TYPES_SECTION, 'tooltips': [ NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_ANY, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_TOP, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_HANGING, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_GARLAND, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_GIFT, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_SNOWMAN, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_HOUSE_DECORATION, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_HOUSE_LAMP, NY.CRAFTSCREEN_TYPESLIDER_TOOLTIP_STREET_GARLAND ] }, 'levelsBlock': { 'title': NY.CRAFTSCREEN_LEVELSLIDER_TITLE, 'selectedId': indexByToyLevel(self.__toyLevel), 'typeId': NY_CONSTANTS.LEVELS_SECTION, 'tooltips': [ NY.CRAFTSCREEN_LEVELSLIDER_TOOLTIP_ANY, NY.CRAFTSCREEN_LEVELSLIDER_TOOLTIP_1, NY.CRAFTSCREEN_LEVELSLIDER_TOOLTIP_2, NY.CRAFTSCREEN_LEVELSLIDER_TOOLTIP_3, NY.CRAFTSCREEN_LEVELSLIDER_TOOLTIP_4, NY.CRAFTSCREEN_LEVELSLIDER_TOOLTIP_5 ] }, 'carouselData': self.__getToysVO() } self.as_setInitDataS(initData) self.__updatePrice() NYSoundEvents.playSound(NYSoundEvents.ON_OPEN_CRAFT) NYSoundEvents.setState(NYSoundEvents.STATE_ON_CRAFT) self._newYearController.onToyFragmentsChanged += self.__onToyFragmentsChanged self._newYearController.onCraftedToysChanged += self.__onCraftedToysChanged return