示例#1
0
    def __onPreviewStyleButton(self, *_):
        paramDict = {
            'instantly': True,
            'withFade': True,
            'viewAlias': ViewAliases.REWARDS_VIEW,
            'objectName': NewYearNavigation.getCurrentObject(),
            'tabName': self.__yearName,
            'collection': self.__collectionName,
            'forceShowMainView': True
        }
        NewYearNavigation.switchTo(None, True)

        def _backCallback():
            if not self.__nyController.isEnabled():
                event_dispatcher.showHangar()
            else:
                NewYearNavigation.switchFromStyle(**paramDict)

        showStylePreview(getVehiclePreviewID(self.__currentStyle,
                                             self.__yearName,
                                             self.__collectionName),
                         self.__currentStyle,
                         self.__currentStyle.getDescription(),
                         backCallback=_backCallback,
                         backBtnDescrLabel=backport.text(
                             R.strings.ny.collectionsReward.backLabel()))
        return
示例#2
0
 def __onWidgetClick(self, *_):
     self.__uiLogger.logClick(self._lobbyMode)
     NewYearNavigation.switchTo(CustomizationObjects.FIR,
                                True,
                                withFade=True)
     if self._lobbyMode:
         self.__soundManager.playEvent(NewYearSoundEvents.ENTER_CUSTOME)
         self.__soundManager.playEvent(NewYearSoundEvents.TRANSITION_TREE)
示例#3
0
 def __onSideBarSelected(self, event):
     ctx = event.ctx
     if ctx.menuName != NyWidgetTopMenu.GLADE:
         return
     tabName = ctx.tabName
     self.__currentObject = tabName
     NewYearNavigation.switchTo(tabName, True, withFade=True)
     with self.viewModel.transaction() as model:
         self.__updateSlots(fullUpdate=True, model=model)
         self.__clearPopovers()
示例#4
0
 def __onPreviewStyleShow(self, args):
     backCallback = _ShowGiftSystemCallback()
     NewYearNavigation.switchTo(None, True)
     styleItem = self.__itemsCache.items.getItemByCD(int(args['styleID']))
     showStylePreview(getVehiclePreviewID(styleItem), styleItem, styleItem.getDescription(), backCallback=backCallback, backBtnDescrLabel=backport.text(R.strings.ny.giftSystem.backLabel()))
     return