Example #1
0
 def __getMapboxProgressionVO(self):
     data = self.__mapboxCtrl.getProgressionData()
     if data is not None and self.__mapboxCtrl.isActive(
     ) and self.__mapboxCtrl.isInPrimeTime():
         completed = data.totalBattles
         if completed is None:
             _logger.error('battles played is None')
             return
         total = max(data.rewards)
         if completed < total:
             label = _ms(MENU.hangarHeaderMapboxProgressionLabel(
                 LABEL_STATE.ACTIVE),
                         total=completed)
         else:
             label = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_MISSIONS_ICONS_CHECK_GREEN_XS)
         progressionIcon = backport.image(
             R.images.gui.maps.icons.quests.headerFlagIcons.mapbox())
         flag = backport.image(
             R.images.gui.maps.icons.library.hangarFlag.flag_green())
     else:
         flag = backport.image(
             R.images.gui.maps.icons.library.hangarFlag.flag_gray())
         progressionIcon = backport.image(R.images.gui.maps.icons.quests.
                                          headerFlagIcons.mapbox_disabled())
         label = ''
     quests = [
         self._headerQuestFormaterVo(
             data is not None,
             progressionIcon,
             label,
             HANGAR_HEADER_QUESTS.QUEST_TYPE_MAPBOX,
             flag=flag,
             tooltip=TOOLTIPS_CONSTANTS.MAPBOX_PROGRESSION_PREVIEW,
             isTooltipSpecial=True)
     ]
     return self._wrapQuestGroup(HANGAR_HEADER_QUESTS.QUEST_GROUP_PERSONAL,
                                 '', quests)