Пример #1
0
    def _onLoading(self, *args, **kwargs):
        super(BattlePass3dStyleChoiceView, self)._onLoading(*args, **kwargs)
        self.__addListeners()
        with self.viewModel.transaction() as tx:
            for styleBonus in self.__battlePassController.getStylesConfig():
                tankStyleModel = TankStyleModel()
                styleInfo = getStyleInfo(styleBonus)
                tankStyleModel.setStyleId(styleInfo.id)
                tankStyleModel.setStyleName(styleInfo.userName)
                vehicleCD = getVehicleCDForStyle(styleInfo)
                vehicle = getVehicleByIntCD(vehicleCD)
                fillVehicleInfo(tankStyleModel.vehicleInfo, vehicle)
                tankStyleModel.setIsInHangar(vehicle.isInInventory)
                tankStyleModel.setIsObtained(bool(styleInfo.fullCount()))
                tx.tankStylesList.addViewModel(tankStyleModel)

            currentChapterLevel = self.__battlePassController.getCurrentChapter(
            )
            chosenItems = self.__itemsCache.items.battlePass.getChosenItems()
            if currentChapterLevel not in chosenItems:
                isChoiceEnabled = True
                if chosenItems:
                    chapterLevel = max(chosenItems.keys()) + 1
                else:
                    chapterLevel = BattlePassConsts.MINIMAL_CHAPTER_NUMBER
            else:
                chapterLevel = currentChapterLevel
                isChoiceEnabled = False
            tx.setIsChoiceEnabled(isChoiceEnabled)
            tx.setChapterNumber(chapterLevel)
            tx.setCurrentLevel(
                getCurrentStyleLevel(self.__battlePassController.getSeasonID(),
                                     chapterLevel))
            tx.setSelectedLevel(self.__level)
        switchHangarOverlaySoundFilter(on=True)
Пример #2
0
 def _onLoading(self, *args, **kwargs):
     super(ExtraIntroView, self)._onLoading(*args, **kwargs)
     style = getStyleForChapter(self.__chapterID)
     vehicleCD = getVehicleCDForStyle(style)
     vehicle = getVehicleByIntCD(vehicleCD)
     with self.viewModel.transaction() as tx:
         tx.setStyleName(style.userName)
         fillVehicleInfo(tx.vehicleInfo, vehicle)
 def __getRewardModel(self, isTop):
     model = RewardModel()
     model.setIsTop(isTop)
     model.setIsEnabled(self.__resourceWell.isRewardEnabled(isTop))
     model.setVehiclesLeftCount(self.__resourceWell.getRewardLeftCount(isTop))
     model.setIsCountAvailable(self.__resourceWell.isRewardCountAvailable(isTop))
     fillVehicleInfo(model.vehicleInfo, getVehicleByIntCD(self.__resourceWell.getRewardVehicle()))
     return model
 def _onLoading(self, selectedSection='', selectedSlot=None):
     super(CompareAmmunitionSelectorView, self)._onLoading()
     self._vehItem = cmp_helpers.getCmpConfiguratorMainView(
     ).getCurrentVehicleItem()
     self._selectedSlotID = int(selectedSlot)
     self._tankSetup = MainTankSetupView(
         self.viewModel.tankSetup, CompareTankSetupBuilder(self._vehItem))
     self.viewModel.setSelectedSlot(self._selectedSlotID)
     self._tankSetup.onLoading(selectedSection, selectedSlot)
     fillVehicleInfo(self.viewModel.vehicleInfo, self._vehItem.getItem())
 def __setStyleWidget(self, model):
     style = getStyleForChapter(self.__chapterID)
     model.widget3dStyle.setStyleName(style.userName if style else '')
     model.widget3dStyle.setStyleId(style.id if style else 0)
     if style is not None:
         vehicleCD = getVehicleCDForStyle(style,
                                          itemsCache=self.__itemsCache)
         vehicle = getVehicleByIntCD(vehicleCD)
         fillVehicleInfo(model.widget3dStyle.vehicleInfo, vehicle)
     return
Пример #6
0
 def __setStyleWidget(self, model):
     chosenItems = self.__itemsCache.items.battlePass.getChosenItems()
     if chosenItems is None or self.__chosenChapter not in chosenItems:
         style, level = (None, 0)
     else:
         intCD, level = chosenItems[self.__chosenChapter]
         style = self.__itemsCache.items.getItemByCD(intCD)
     isUnselectedPrevStyle = chosenItems is not None and self.__chosenChapter != BattlePassConsts.MINIMAL_CHAPTER_NUMBER and self.__chosenChapter - 1 not in chosenItems
     model.widget3dStyle.setStyleName(style.userName if style else '')
     model.widget3dStyle.setStyleId(style.id if style else 0)
     model.widget3dStyle.setLevel(level)
     model.widget3dStyle.setIsUnselectedPrevStyle(isUnselectedPrevStyle)
     if style is not None:
         vehicleCD = getVehicleCDForStyle(style,
                                          itemsCache=self.__itemsCache)
         vehicle = getVehicleByIntCD(vehicleCD)
         fillVehicleInfo(model.widget3dStyle.vehicleInfo, vehicle)
     return
 def __fillVehicle(self, style, model):
     vehicleCD = getVehicleCDForStyle(style, itemsCache=self.__itemsCache)
     vehicle = getVehicleByIntCD(vehicleCD)
     fillVehicleInfo(model.vehicleInfo, vehicle)
     model.setIsVehicleInHangar(vehicle.isInInventory)
 def __fillModel(self):
     with self.viewModel.transaction() as model:
         serialNumber = getSerialNumber(resourceWell=self.__resourceWell)
         model.setIsTop(bool(serialNumber))
         model.setPersonalNumber(serialNumber)
         fillVehicleInfo(model.vehicleInfo, self.__vehicle)
Пример #9
0
 def _onLoading(self, *args, **kwargs):
     super(IntroView, self)._onLoading(*args, **kwargs)
     setIntroShown()
     with self.viewModel.transaction() as model:
         fillVehicleInfo(model.vehicleInfo, getVehicleByIntCD(self.__resourceWell.getRewardVehicle()))
         self.__fillEventInfo(model=model)
Пример #10
0
 def _onLoading(self, vehicleCD, *args, **kwargs):
     with self.viewModel.transaction() as model:
         self.__vehicle = self.__itemsCache.items.getItemByCD(vehicleCD)
         fillVehicleInfo(model.vehicleInfo, self.__vehicle)
         self.__updateVehPostProgression(model=model)