Example #1
0
 def _selectLastTab(self):
     tabID = self._navInfo.tabID
     if not tabID:
         tabID = _QA.TAB_PERSONAL_QUESTS if isPotapovQuestEnabled(
         ) else _QA.TAB_COMMON_QUESTS
     self.as_selectTabS(tabID)
     return tabID
Example #2
0
 def __initWindow(self):
     tabs = []
     if isPotapovQuestEnabled():
         tabs.append(
             self.__packTabDataItem(QUESTS.QUESTS_TABS_PERSONAL,
                                    _QA.TAB_PERSONAL_QUESTS))
     tabs.append(
         self.__packTabDataItem(QUESTS.QUESTS_TABS_CURRENT,
                                _QA.TAB_COMMON_QUESTS))
     if g_eventsCache.getQuests(
             lambda x: x.getType() == constants.EVENT_TYPE.CLUBS_QUEST):
         tabs.append(
             self.__packTabDataItem(QUESTS.QUESTS_TABS_LADDER,
                                    _QA.TAB_LADDER_QUESTS))
     if g_settingsCore.serverSettings.getTutorialSetting(
             TUTORIAL.WAS_QUESTS_TUTORIAL_STARTED):
         tabs.append(
             self.__packTabDataItem(QUESTS.QUESTS_TABS_BEGINNER,
                                    _QA.TAB_BEGINNER_QUESTS))
     self.as_initS({'tabs': tabs})
Example #3
0
 def __onQuestsUpdated(self, *args):
     svrEvents = g_eventsCache.getEvents()
     quest_settings.updateCommonEventsSettings(svrEvents)
     btnInfo = _createBtnInfo(QUESTS.QUESTSCONTROL_ADDITIONALTITLE_EMPTY,
                              TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_EMPTY,
                              highlight=False)
     if isPotapovQuestEnabled():
         if not quest_settings.isNeedToShowHeaderAlert():
             quest_settings.markHeaderAlertAsVisited()
             btnInfo = _createBtnInfo(
                 QUESTS.QUESTSCONTROL_ADDITIONALTITLE_FIRSTRUN,
                 TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_NEW)
         elif g_eventsCache.potapov.hasQuestsForReward():
             btnInfo = _createBtnInfo(
                 QUESTS.QUESTSCONTROL_ADDITIONALTITLE_NEEDRECEIVEDAWARD,
                 TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_RECEIVETHEAWARD,
                 alert=True)
         elif g_eventsCache.potapov.hasQuestsForSelect():
             btnInfo = _createBtnInfo(
                 QUESTS.
                 QUESTSCONTROL_ADDITIONALTITLE_FREESLOTSANDFREEQUESTS,
                 TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_AVAILABLE,
                 alert=True)
     self.as_setDataS({
         'titleText':
         QUESTS.QUESTSCONTROL_TITLE,
         'additionalText':
         text_styles.alert(i18n.makeString(btnInfo.text)),
         'tooltip':
         btnInfo.tooltip
     })
     self.as_isShowAlertIconS(btnInfo.alert, btnInfo.highlight)
     premiumIgrVehiclesQuests = g_eventsCache.getQuests(
         lambda q: q.getStartTimeLeft() <= 0 < q.getFinishTimeLeft(
         ) and q.hasPremIGRVehBonus())
     if len(premiumIgrVehiclesQuests):
         storedValue = AccountSettings.getFilter(IGR_PROMO)
         if not storedValue['wasShown']:
             self.fireEvent(
                 events.LoadViewEvent(VIEW_ALIAS.PROMO_PREMIUM_IGR_WINDOW))
 def isPotapovQuestEnabled(self):
     return server_events.isPotapovQuestEnabled()