def __setData(self): datailedList = [] for _, q in enumerate( sorted(self.__quests.itervalues(), key=methodcaller('getID'))): datailedList.append(getDetailedMissionData(q).getInfo()) pages = map( lambda (i, mission): { 'buttonsGroup': 'MissionDetailsPageGroup', 'pageIndex': i, 'label': '%i' % (i + 1), 'tooltip': { 'isSpecial': True, 'specialAlias': TOOLTIPS_CONSTANTS. PERSONAL_MISSIONS_MAP_REGION, 'specialArgs': [int(mission.get('eventID')), 0] }, 'status': mission.get('status'), 'selected': self.__selectedQuestID == int( mission.get('eventID')) }, enumerate(datailedList)) self.as_setInitDataS({ 'title': 'Title', 'missions': datailedList, 'pages': pages })
def __setData(self): detailedData = getDetailedMissionData(self._quest) status = MISSIONS_STATES.COMPLETED isFinal = self._quest.isFinal() if self._isAwardListUsed: count = text_styles.stats( str(self._quest.getPawnCost()) + getHtmlAwardSheetIcon(self._quest.getQuestBranch())) statusLabel = text_styles.bonusAppliedText( _ms(QUESTS.PERSONALMISSION_STATUS_DONEWITHPAWN, count=count)) elif self._mainReward and self._addReward: statusLabel = text_styles.bonusAppliedText( QUESTS.PERSONALMISSION_STATUS_FULLDONE) status = MISSIONS_STATES.FULL_COMPLETED elif self._addReward: statusLabel = text_styles.bonusAppliedText( QUESTS.PERSONALMISSION_STATUS_ONLYADDDONE) status = MISSIONS_STATES.FULL_COMPLETED else: statusLabel = text_styles.bonusAppliedText( QUESTS.PERSONALMISSION_STATUS_ONLYMAINDONE) questText = _ms(_PM.QUESTAWARDSCREEN_QUEST, quest=self._quest.getShortUserName()) dataVO = { 'bgImage': _OPERATION_ID_TO_UI_BACKGROUND.get(self._quest.getOperationID(), ''), 'operationText': text_styles.promoTitle( _ms(_PM.QUESTAWARDSCREEN_OPERATION, operation=self._operation.getUserName())), 'questText': toUpper(questText), 'statusLabel': statusLabel, 'status': status, 'ribbonData': { 'ribbonType': 'ribbon1', 'rendererLinkage': 'RibbonAwardAnimUI', 'gap': 20, 'rendererWidth': 80, 'rendererHeight': 80, 'awards': self.__packAwards(detailedData) } } dataVO.update(self.__packQuestConditions(detailedData)) dataVO.update(self.__packNextQuestTitleSection(isFinal)) dataVO.update(self.__packButtonsSection(isFinal)) self.as_setDataS(dataVO)
def onChangePage(self, eventID): self.__selectedQuestID = int(eventID) quest = self.__quests.get(self.__selectedQuestID) mayPawn = self.eventsCache.random.getFreeTokensCount( ) >= quest.getPawnCost() and quest.canBePawned() if self.__storage: self.__storage.setValue(MAY_PAWN_PERSONAL_MISSION, mayPawn) vehicleSelector = self.components.get( QUESTS_ALIASES.PERSONAL_MISSIONS_VEHICLE_SELECTOR_ALIAS) criteria, extraConditions = getDetailedMissionData( quest).getVehicleRequirementsCriteria() vehicleSelector.as_closeS() vehicleSelector.setSelectedQuest(self.__selectedQuestID) if criteria and quest.isInProgress() and quest.isAvailable()[0]: vehicleSelector.setCriteria(criteria, extraConditions) else: vehicleSelector.as_hideSelectedVehicleS()
def __setData(self): self.__datailedList = [] pages = [] for idx, q in enumerate( sorted(self.__quests.itervalues(), key=methodcaller('getID'))): qData = getDetailedMissionData(q).getInfo() self.__datailedList.append(qData) eventID = q.getID() status = qData.get('status') pages.append({ 'buttonsGroup': 'MissionDetailsPageGroup', 'pageIndex': idx, 'label': str(idx + 1), 'tooltip': getMapRegionTooltipData(status, q), 'status': status, 'selected': self.__selectedQuestID == eventID }) self.as_setInitDataS({'pages': pages})
def __setData(self): self.__datailedList = [] pages = [] for idx, q in enumerate( sorted(self.__quests.itervalues(), key=methodcaller('getID'))): qData = getDetailedMissionData(q).getInfo() self.__datailedList.append(qData) eventID = q.getID() pages.append({ 'buttonsGroup': 'MissionDetailsPageGroup', 'pageIndex': idx, 'label': str(idx + 1), 'tooltip': { 'isSpecial': True, 'specialAlias': TOOLTIPS_CONSTANTS.PERSONAL_MISSIONS_MAP_REGION, 'specialArgs': [eventID, 0] }, 'status': qData.get('status'), 'selected': self.__selectedQuestID == eventID }) self.as_setInitDataS({'pages': pages})
def __setData(self): detailedData = getDetailedMissionData(self._quest) status = MISSIONS_STATES.COMPLETED showExtraBtn = False isFinal = self._quest.isFinal() if self._isAwardListUsed: count = text_styles.stats( str(self._quest.getPawnCost()) + getHtmlAwardSheetIcon(self._quest.getQuestBranch())) statusLabel = text_styles.bonusAppliedText( _ms(QUESTS.PERSONALMISSION_STATUS_DONEWITHPAWN, count=count)) if not isFinal: showExtraBtn = True elif self._mainReward and self._addReward: statusLabel = text_styles.bonusAppliedText( QUESTS.PERSONALMISSION_STATUS_FULLDONE) status = MISSIONS_STATES.FULL_COMPLETED elif self._addReward: statusLabel = text_styles.bonusAppliedText( QUESTS.PERSONALMISSION_STATUS_ONLYADDDONE) else: statusLabel = text_styles.bonusAppliedText( QUESTS.PERSONALMISSION_STATUS_ONLYMAINDONE) showExtraBtn = True questText = _ms(_PM.QUESTAWARDSCREEN_QUEST, quest=self._quest.getShortUserName()) dataVO = { 'bgImage': _OPERATION_ID_TO_UI_BACKGROUND.get(self._quest.getOperationID(), ''), 'operationText': text_styles.promoTitle( _ms(_PM.QUESTAWARDSCREEN_OPERATION, operation=self._operation.getUserName())), 'questText': toUpper(questText), 'statusLabel': statusLabel, 'status': status, 'ribbonData': { 'ribbonType': 'ribbon1', 'rendererLinkage': 'RibbonAwardAnimUI', 'gap': 20, 'rendererWidth': 80, 'rendererHeight': 80, 'awards': self.__packAwards(detailedData) } } dataVO.update(self.__packQuestsConditions(detailedData)) if self._addReward: if self._nextQuest: nextQuestTitle = _PM.QUESTAWARDSCREEN_NEXTQUEST_TITLE_QUESTACCEPT nextQuestText = self._nextQuest.getUserName() dataVO.update({ 'nextQuestText': text_styles.promoTitle(nextQuestText), 'nextQuestTitle': text_styles.highlightText(nextQuestTitle) }) else: chainName = getTypeShortUserName( self._quest.getQuestClassifier().classificationAttr) nextQuestTitle = _ms(_PM.STATUSPANEL_STATUS_ALLDONE, vehicleClass=chainName) dataVO.update({ 'nextQuestTitle': text_styles.highlightText(nextQuestTitle) }) elif self._isAwardListUsed and isFinal: dataVO.update({ 'nextQuestTitle': text_styles.highlightText( QUESTS.PERSONALMISSION_STATUS_LASTDONEWITHPAWN) }) else: dataVO.update(self.__getQuestImproveTitleData(self._quest)) if showExtraBtn: extraLbl = _PM.QUESTAWARDSCREEN_RECRUITBTN_LABEL if isFinal else _PM.QUESTAWARDSCREEN_NEXTQUESTBTN_LABEL dataVO.update({ 'mainBtnLabel': _PM.QUESTAWARDSCREEN_CONTINUEBTN_LABEL, 'extraBtnLabel': extraLbl }) else: mainLbl = _PM.QUESTAWARDSCREEN_RECRUITBTN_LABEL if isFinal and self._mainReward else _PM.QUESTAWARDSCREEN_OKBTN_LABEL dataVO.update({'mainBtnLabel': mainLbl}) self.as_setDataS(dataVO)