def _getAwardsBlock(cls, quest):
     items = []
     linkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WIDE_AWARD_BIG_BG_LINKAGE
     textPadding = formatters.packPadding(top=-8, left=16, bottom=20)
     if quest.isDone():
         titleKey = TOOLTIPS.PERSONALMISSIONS_MAPREGION_AWARDS_TITLE_ALLRECEIVED
         linkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WIDE_AWARD_SMALL_BG_LINKAGE
         textPadding['bottom'] = 10
     elif not quest.isMainCompleted():
         titleKey = TOOLTIPS.PERSONALMISSIONS_MAPREGION_AWARDS_TITLE_DONE
     else:
         titleKey = TOOLTIPS.PERSONALMISSIONS_MAPREGION_AWARDS_TITLE_EXCELLENTDONE
     items.append(
         formatters.packTextBlockData(
             text=text_styles.middleTitle(titleKey), padding=textPadding))
     if not quest.isDone():
         bonuses = missions_helper.getPersonalMissionAwardsFormatter(
         ).getFormattedBonuses(
             quest.getBonuses(isMain=not quest.isMainCompleted()),
             size=AWARDS_SIZES.BIG)
         items.append(
             formatters.packAwardsExBlockData(
                 bonuses,
                 columnWidth=90,
                 rowHeight=80,
                 horizontalGap=10,
                 renderersAlign=formatters.RENDERERS_ALIGN_CENTER,
                 padding=formatters.packPadding(bottom=20, left=10)))
     return formatters.packBuildUpBlockData(blocks=items,
                                            stretchBg=False,
                                            linkage=linkage)
Пример #2
0
 def __getFinalQuestAwardsVO(self, quest):
     tokenAward = findFirst(lambda q: q.getName() == 'completionTokens',
                            quest.getBonuses(isMain=True))
     formatter = getPersonalMissionAwardsFormatter()
     mainAwards = formatter.getFormattedBonuses(
         (tokenAward, ),
         size=COMPLETION_TOKENS_SIZES.HUGE,
         obtainedImage=RES_ICONS.
         MAPS_ICONS_PERSONALMISSIONS_OPERATIONS_STATES_COMPLETED,
         obtainedImageOffset=0)
     chainID = self.getChainID()
     operationID = self.getOperationID()
     mainAwardTextID = chainID
     if self.getBranch() == PM_BRANCH.REGULAR:
         if chainID == HT_CHAIN_ID and (operationID == OPERATION_ID_T55A
                                        or operationID
                                        == OPERATION_ID_OBJECT_260):
             mainAwardTextID = MAIN_AWARD_TEXT_ID_HULL
         mainAwardText = _ms(_MAIN_AWARD_TEXT[mainAwardTextID])
     else:
         if chainID == ALLIANCE_CHAIN_ID and (
                 operationID == OPERATION_ID_CHIMERA
                 or operationID == OPERATION_ID_OBJECT_279):
             mainAwardTextID = MAIN_AWARD_TEXT_PM2_ID_HULL
         mainAwardText = _ms(_MAIN_AWARD_TEXT_PM2[mainAwardTextID])
     return {'mainAwardText': mainAwardText, 'mainAward': first(mainAwards)}
Пример #3
0
 def getAwards(self):
     bonuses = []
     if self._isMainReward:
         bonuses.extend(self._quest.getBonuses(isMain=True))
     if self._isAddReward:
         bonuses.extend(self._quest.getBonuses(isMain=False))
     return getPersonalMissionAwardsFormatter().getFormattedBonuses(
         bonuses, size=AWARDS_SIZES.BIG)
 def __getFinalQuestAwardsVO(self, quest):
     tokenAward = findFirst(lambda q: q.getName() == 'completionTokens',
                            quest.getBonuses(isMain=True))
     formatter = getPersonalMissionAwardsFormatter()
     mainAwards = formatter.getFormattedBonuses(
         (tokenAward, ),
         size=COMPLETION_TOKENS_SIZES.HUGE,
         obtainedImage=RES_ICONS.
         MAPS_ICONS_PERSONALMISSIONS_OPERATIONS_STATES_COMPLETED,
         obtainedImageOffset=0)
     if self.getChainID() == HT_CHAIN_ID and (
             self.getOperationID() == OPERATION_ID_T55A
             or self.getOperationID() == OPERATION_ID_OBJECT):
         mainAwardTextID = MAIN_AWARD_TEXT_ID_HULL
     else:
         mainAwardTextID = self.getChainID()
     return {
         'mainAwardText': _ms(MAIN_AWARD_TEXT[mainAwardTextID]),
         'mainAward': first(mainAwards)
     }