Пример #1
0
 def __showVideo(self):
     webHandlers = webApiCollection(ui_web_api.CloseViewWebApi,
                                    sound_web_api.SoundWebApi,
                                    sound_web_api.HangarSoundWebApi)
     self.fireEvent(
         events.LoadViewEvent(VIEW_ALIAS.BROWSER_VIEW,
                              ctx={
                                  'url': getRankedBattlesIntroPageUrl(),
                                  'webHandlers': webHandlers,
                                  'returnAlias': self.alias
                              }), EVENT_BUS_SCOPE.LOBBY)
Пример #2
0
    def __update(self, _=None):
        headerData = {
            'title':
            backport.text(R.strings.ranked_battles.rankedBattle.title()),
            'leftSideText':
            backport.text(R.strings.ranked_battles.introPage.description()),
            'rightSideText':
            None,
            'tooltip':
            None
        }
        blocksData = []
        for index in range(BLOCKS_COUNT):
            index += 1
            imgSource = backport.image(
                R.images.gui.maps.icons.rankedBattles.intro.dyn(
                    'block{}'.format(index))())
            title = text_styles.promoSubTitle(
                backport.text(
                    R.strings.ranked_battles.introPage.blocks.dyn(
                        'block{}'.format(index)).title()))
            descr = text_styles.mainBig(
                backport.text(
                    R.strings.ranked_battles.introPage.blocks.dyn(
                        'block{}'.format(index)).description()))
            blocksData.append({
                'imgSource': imgSource,
                'title': title,
                'description': descr
            })

        if not self.__rankedController.isYearRewardEnabled():
            blocksData[-1]['imgSource'] = backport.image(
                R.images.gui.maps.icons.rankedBattles.intro.yearRewardDisabled(
                ))
            blocksData[-1]['description'] = text_styles.mainBig(
                backport.text(R.strings.ranked_battles.introPage.blocks.
                              yearRewardDisabled()))
        url = getRankedBattlesIntroPageUrl()
        self.__state = RANKEDBATTLES_CONSTS.INTRO_STATE_NORMAL
        if self.__rankedController.isFrozen():
            self.__state = RANKEDBATTLES_CONSTS.INTRO_STATE_DISABLED
            if not self.__rankedController.getSeasonPassed(
            ) and not self.__rankedController.getCurrentSeason():
                self.__state = RANKEDBATTLES_CONSTS.INTRO_STATE_BEFORE_SEASON
        if self.__state == RANKEDBATTLES_CONSTS.INTRO_STATE_DISABLED:
            self.as_setAlertMessageBlockDataS({
                'alertIcon':
                backport.image(R.images.gui.maps.icons.library.alertBigIcon()),
                'statusText':
                text_styles.vehicleStatusCriticalText(
                    backport.text(
                        R.strings.ranked_battles.introPage.alert.disabled())),
                'buttonVisible':
                False
            })
        elif self.__state == RANKEDBATTLES_CONSTS.INTRO_STATE_BEFORE_SEASON:
            self.__updateTimer()
        if self.__state != RANKEDBATTLES_CONSTS.INTRO_STATE_NORMAL and self.__rankedController.getRankedWelcomeCallback(
        ) is None:
            self.__rankedController.setRankedWelcomeCallback(lambda: None)
        self.as_setDataS({
            'state': self.__state,
            'hasURL': bool(url),
            'headerData': headerData,
            'blocksData': blocksData
        })
        return