Exemplo n.º 1
0
 def _onClick(self):
     if getNotChosen3DStylesCount(
             battlePass=self._battlePassController
     ) > 0 and self.__settingsCore.serverSettings.getBPStorage().get(
             BattlePassStorageKeys.INTRO_SHOWN
     ) and not self._battlePassController.isOffSeasonEnable():
         showBattlePass3dStyleChoiceWindow()
     else:
         showMissionsBattlePassCommonProgression()
Exemplo n.º 2
0
 def _onLoading(self, *args, **kwargs):
     super(BattlePassCompletedTooltipView, self)._onLoading(*args, **kwargs)
     with self.getViewModel().transaction() as model:
         model.setLevel(self.__battlePassController.getMaxLevel())
         model.setIsBattlePassPurchased(
             self.__battlePassController.isBought())
         model.setIsStyleChosen(not bool(
             getNotChosen3DStylesCount(
                 battlePass=self.__battlePassController)))
         model.setNotChosenRewardCount(
             self.__battlePassController.getNotChosenRewardCount())
Exemplo n.º 3
0
 def _onLoading(self, *args, **kwargs):
     super(BattlePass3dStyleNotChosenTooltip,
           self)._onLoading(*args, **kwargs)
     with self.viewModel.transaction() as model:
         model.setLevel(
             min(self.__battlePassController.getCurrentLevel() + 1,
                 self.__battlePassController.getMaxLevel()))
         currentChapter = self.__battlePassController.getCurrentChapter()
         model.setChapter(currentChapter)
         if currentChapter > 1:
             firstNotChosenStyleChapter = getNotChosen3DStylesCount(
                 battlePass=self.__battlePassController
             ) + 1 - currentChapter
             if firstNotChosenStyleChapter < currentChapter:
                 model.setIsChapterCompleted(True)
Exemplo n.º 4
0
 def __updateRewardSelectButton(self, model=None):
     model.setIsChooseDeviceEnabled(False)
     model.setIsTakeAllButtonVisible(False)
     notChosenStylesCount = getNotChosen3DStylesCount(
         battlePass=self.__battlePassController,
         itemsCache=self.__itemsCache)
     notChosenRewardCount = self.__battlePassController.getNotChosenRewardCount(
     )
     if self.__battlePassController.hasAnyOfferGiftToken(
     ) or notChosenStylesCount:
         model.setIsTakeAllButtonVisible(True)
         model.setIsChooseDeviceEnabled(
             self.__battlePassController.canChooseAnyReward()
             or notChosenStylesCount)
         notChosenRewardCount += notChosenStylesCount
         model.setNotChosenRewardCount(notChosenRewardCount)
Exemplo n.º 5
0
 def __updateViewModel(self):
     currentLevel = min(self._widgetLevel + 1,
                        self._battlePassController.getMaxLevel())
     notChosenRewardCount = 0
     is3DStyleChosen = False
     if self._isBattlePassPaused():
         state = BPState.DISABLED
     elif self._battlePassController.isOffSeasonEnable():
         state = BPState.SEASON_WAITING
     else:
         notChosen3DStylesCount = getNotChosen3DStylesCount(
             battlePass=self._battlePassController)
         notChosenRewardCount = self._battlePassController.getNotChosenRewardCount(
         ) + notChosen3DStylesCount
         is3DStyleChosen = notChosen3DStylesCount == 0
         state = BPState.ATTENTION if notChosenRewardCount > 0 else BPState.NORMAL
         if state == BPState.ATTENTION:
             self.__startAttentionTimer()
         else:
             self.__stopAttentionTimer()
     with self.getViewModel().transaction() as model:
         curPoints, limitPoints = self._battlePassController.getLevelProgression(
         )
         hasBattlePass = self._isBought()
         progression = curPoints * 100 / limitPoints if limitPoints else 100
         prevProgression = model.getProgression(
         ) if model.getProgression() != -1 else progression
         model.setIsSmall(self.__isSmall)
         model.setTooltipID(self._getTooltip())
         model.setPrevLevel(g_BPEntryPointStates.curLevel)
         model.setLevel(currentLevel)
         model.setChapterNumber(self._widgetChapter)
         model.setPrevProgression(prevProgression)
         model.setProgression(progression)
         model.setBattlePassState(state)
         model.setNotChosenRewardCount(notChosenRewardCount)
         model.setIs3DStyleChosen(is3DStyleChosen)
         if not self._battlePassController.isGameModeEnabled(
                 self._getCurrentArenaBonusType()):
             model.setBattleType(getPreQueueName(self._getQueueType(),
                                                 True))
         model.setIsProgressionCompleted(self._isCompleted())
         model.setHasBattlePass(hasBattlePass)
         animState = AnimationState.NORMAL
         if g_BPEntryPointStates.showProgressionCompleted:
             animState = AnimationState.SHOW_PROGRESSION_COMPLETED
         elif g_BPEntryPointStates.showSwitchToNewChapter:
             animState = AnimationState.SHOW_NEW_CHAPTER
         elif g_BPEntryPointStates.curLevel != currentLevel and g_BPEntryPointStates.curLevel != -1:
             animState = AnimationState.SHOW_NEW_LEVEL
         elif not g_BPEntryPointStates.isBPBought and hasBattlePass and not g_BPEntryPointStates.isFirstShow:
             animState = AnimationState.SHOW_BUY_BP
         elif prevProgression != progression:
             animState = AnimationState.SHOW_CHANGE_PROGRESS
         model.setAnimState(animState)
         model.setIsFirstShow(g_BPEntryPointStates.isFirstShow)
         g_BPEntryPointStates.curLevel = currentLevel
         g_BPEntryPointStates.isFirstShow = False
         g_BPEntryPointStates.isBPBought = hasBattlePass
         g_BPEntryPointStates.showSwitchToNewChapter = False
         g_BPEntryPointStates.showProgressionCompleted = False
     g_BPEntryPointStates.prevState = self._widgetState
Exemplo n.º 6
0
 def _is3DStyleChosen(self):
     return getNotChosen3DStylesCount(
         battlePass=self._battlePassController) == 0
Exemplo n.º 7
0
 def _getNotChosenRewardCountWith3d(self):
     return self._battlePassController.getNotChosenRewardCount(
     ) + getNotChosen3DStylesCount(battlePass=self._battlePassController)
Exemplo n.º 8
0
 def __onIntroCloseClick(self):
     if getNotChosen3DStylesCount() > 0:
         self.__onSelectStyle()
     self.viewModel.setShowIntro(False)
     self.__setBattlePassIntroShown()