Exemplo n.º 1
0
 def __getBattleQuestsVO(self, vehicle):
     quests = self._questController.getQuestForVehicle(vehicle)
     totalCount = len(quests)
     completedQuests = len([q for q in quests if q.isCompleted()])
     if totalCount > 0:
         if completedQuests != totalCount:
             label = _ms(MENU.hangarHeaderBattleQuestsLabel(
                 LABEL_STATE.ACTIVE),
                         total=totalCount - completedQuests)
         else:
             label = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_ALL_DONE)
         commonQuestsIcon = RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_AVAILABLE
     else:
         commonQuestsIcon = RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_DISABLED
         label = ''
     quests = [
         self._headerQuestFormaterVo(
             totalCount > 0,
             commonQuestsIcon,
             label,
             HANGAR_HEADER_QUESTS.QUEST_TYPE_COMMON,
             tooltip=TOOLTIPS_CONSTANTS.QUESTS_PREVIEW,
             isTooltipSpecial=True)
     ]
     return self._wrapQuestGroup(HANGAR_HEADER_QUESTS.QUEST_GROUP_COMMON,
                                 '', quests)
Exemplo n.º 2
0
 def __getBattleQuestsVO(self, vehicle):
     """ Get part of VO responsible for battle quests flag.
     """
     quests = self._questController.getQuestForVehicle(vehicle)
     totalCount = len(quests)
     completedQuests = len([q for q in quests if q.isCompleted()])
     isNyEnabled = self._newYearController.isAvailable()
     if totalCount > 0:
         if completedQuests != totalCount:
             label = _ms(MENU.hangarHeaderBattleQuestsLabel(
                 LABEL_STATE.ACTIVE),
                         total=totalCount - completedQuests)
         else:
             label = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_ALL_DONE)
         commonQuestsIcon = RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_NY_QUESTS_AVAILABLE if isNyEnabled else RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_AVAILABLE
     else:
         commonQuestsIcon = RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_NY_QUESTS_DISABLED if isNyEnabled else RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_DISABLED
         label = ''
     return {
         'commonQuestsLabel': label,
         'commonQuestsIcon': commonQuestsIcon,
         'commonQuestsTooltip': TOOLTIPS_CONSTANTS.QUESTS_PREVIEW,
         'commonQuestsEnable': totalCount > 0,
         'commonQuestsVisible': True,
         'isNYEnabled': isNyEnabled
     }
Exemplo n.º 3
0
 def __getBattleQuestsVO(self, vehicle):
     """ Get part of VO responsible for battle quests flag.
     """
     bqState, quests = _findBattleQuestsState(self._eventsCache, vehicle)
     if bqState == WIDGET_BQ_STATE.AVAILABLE:
         labelState = LABEL_STATE.ACTIVE
         self._battleQuestId = first(quests).getID()
     else:
         labelState = LABEL_STATE.INACTIVE
         self._battleQuestId = None
     ctx = {'total': len(quests)}
     return {'commonQuestsLabel': _ms(MENU.hangarHeaderBattleQuestsLabel(labelState), **ctx),
      'commonQuestsIcon': RES_ICONS.questsStateIconOutline(bqState),
      'commonQuestsTooltip': _getBattleQuestsTooltip(bqState, **ctx),
      'commonQuestsEnable': bqState == WIDGET_BQ_STATE.AVAILABLE}
Exemplo n.º 4
0
 def __getBattleQuestsVO(self, vehicle):
     quests = [ q for q in self._questController.getQuestForVehicle(vehicle) if not isDailyEpic(q.getGroupID()) and not isDailyQuest(q.getID()) and not isPremium(q.getID()) and not isRankedQuestID(q.getID()) ]
     totalCount = len(quests)
     completedQuests = len([ q for q in quests if q.isCompleted() ])
     festivityFlagData = self._festivityController.getHangarQuestsFlagData()
     if totalCount > 0:
         if completedQuests != totalCount:
             label = _ms(MENU.hangarHeaderBattleQuestsLabel(LABEL_STATE.ACTIVE), total=totalCount - completedQuests)
         else:
             label = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_ALL_DONE)
         commonQuestsIcon = festivityFlagData.icon or RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_AVAILABLE
     else:
         commonQuestsIcon = festivityFlagData.iconDisabled or RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_DISABLED
         label = ''
     quests = [self._headerQuestFormaterVo(totalCount > 0, commonQuestsIcon, label, HANGAR_HEADER_QUESTS.QUEST_TYPE_COMMON, flag=festivityFlagData.flagBackground, tooltip=TOOLTIPS_CONSTANTS.QUESTS_PREVIEW, isTooltipSpecial=True)]
     return self._wrapQuestGroup(HANGAR_HEADER_QUESTS.QUEST_GROUP_COMMON, '', quests)
Exemplo n.º 5
0
 def __getBattleQuestsVO(self, vehicle):
     """ Get part of VO responsible for battle quests flag.
     """
     bqState, quests = _findBattleQuestsState(self._eventsCache, vehicle)
     if bqState == WIDGET_BQ_STATE.AVAILABLE:
         labelState = LABEL_STATE.ACTIVE
         self._battleQuestId = first(quests).getID()
     else:
         labelState = LABEL_STATE.INACTIVE
         self._battleQuestId = None
     ctx = {'total': len(quests)}
     return {
         'commonQuestsLabel':
         _ms(MENU.hangarHeaderBattleQuestsLabel(labelState), **ctx),
         'commonQuestsIcon':
         RES_ICONS.questsStateIconOutline(bqState),
         'commonQuestsTooltip':
         _getBattleQuestsTooltip(bqState, **ctx),
         'commonQuestsEnable':
         bqState == WIDGET_BQ_STATE.AVAILABLE
     }
Exemplo n.º 6
0
 def __getBattleQuestsVO(self, vehicle):
     quests = self._questController.getCurrentModeQuestsForVehicle(vehicle)
     totalCount = len(quests)
     completedQuests = len([q for q in quests if q.isCompleted()])
     festivityFlagData = self._festivityController.getHangarQuestsFlagData()
     if totalCount > 0:
         if completedQuests != totalCount:
             label = _ms(MENU.hangarHeaderBattleQuestsLabel(
                 LABEL_STATE.ACTIVE),
                         total=totalCount - completedQuests)
         else:
             label = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_ALL_DONE)
         commonQuestsIcon = festivityFlagData.icon or RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_AVAILABLE
     else:
         commonQuestsIcon = festivityFlagData.iconDisabled or RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_QUESTS_DISABLED
         label = ''
     if self.__battleRoyaleController.isBattleRoyaleMode(
     ) and totalCount > 0:
         questType = HANGAR_HEADER_QUESTS.QUEST_TYPE_BATTLE_ROYALE
         label = self.__getBattleRoyaleLableForQuestsTooltip(
             totalCount, completedQuests)
     else:
         questType = HANGAR_HEADER_QUESTS.QUEST_TYPE_COMMON
     quests = [
         self._headerQuestFormaterVo(
             totalCount > 0,
             commonQuestsIcon,
             label,
             questType,
             flag=festivityFlagData.flagBackground,
             tooltip=TOOLTIPS_CONSTANTS.QUESTS_PREVIEW,
             isTooltipSpecial=True)
     ]
     return self._wrapQuestGroup(HANGAR_HEADER_QUESTS.QUEST_GROUP_COMMON,
                                 '', quests)