def _populate(self):
     super(FortIntelligenceClanFilterPopover, self)._populate()
     headerText = self.app.utilsManager.textManager.getText(TEXT_MANAGER_STYLES.HIGH_TITLE, _ms(FORTIFICATIONS.FORTINTELLIGENCE_CLANFILTERPOPOVER_HEADER))
     clanLevelText = self.app.utilsManager.textManager.getText(TEXT_MANAGER_STYLES.STANDARD_TEXT, _ms(FORTIFICATIONS.FORTINTELLIGENCE_CLANFILTERPOPOVER_CLANLEVEL))
     startHourRangeText = self.app.utilsManager.textManager.getText(TEXT_MANAGER_STYLES.STANDARD_TEXT, _ms(FORTIFICATIONS.FORTINTELLIGENCE_CLANFILTERPOPOVER_STARTHOURRANGE))
     availabilityText = self.app.utilsManager.textManager.getText(TEXT_MANAGER_STYLES.STANDARD_TEXT, _ms(FORTIFICATIONS.FORTINTELLIGENCE_CLANFILTERPOPOVER_AVAILABILITY))
     self.as_setDescriptionsTextS(headerText, clanLevelText, startHourRangeText, availabilityText)
     defaultButtonText = _ms(FORTIFICATIONS.FORTINTELLIGENCE_CLANFILTERPOPOVER_DEFAULTBUTTONTEXT)
     applyButtonText = _ms(FORTIFICATIONS.FORTINTELLIGENCE_CLANFILTERPOPOVER_APPLYBUTTONTEXT)
     cancelButtonText = _ms(FORTIFICATIONS.FORTINTELLIGENCE_CLANFILTERPOPOVER_CANCELBUTTONTEXT)
     self.as_setButtonsTextS(defaultButtonText, applyButtonText, cancelButtonText)
     defaultButtonTooltip = TOOLTIPS.FORTIFICATION_FORTINTELLIGENCECLANFILTERPOPOVER_DEFAULT
     applyButtonTooltip = TOOLTIPS.FORTIFICATION_FORTINTELLIGENCECLANFILTERPOPOVER_APPLY
     self.as_setButtonsTooltipsS(defaultButtonTooltip, applyButtonTooltip)
     minClanLevel = FORTIFICATION_ALIASES.CLAN_FILTER_MIN_LEVEL
     maxClanLevel = FORTIFICATION_ALIASES.CLAN_FILTER_MAX_LEVEL
     startDefenseHour = FORTIFICATION_ALIASES.CLAN_FILTER_MIN_HOUR
     startDefenseMin = 0
     availability = FORTIFICATION_ALIASES.CLAN_FILTER_DAY_ANY
     cache = self.fortCtrl.getPublicInfoCache()
     if cache:
         minClanLevel, maxClanLevel, startDefenseHour, availability = cache.getDefaultFilterData()
         selectedDate = time.localtime(time_utils.getTimeForLocal(time_utils.getCurrentTimestamp(), max(0, startDefenseHour)))
         startDefenseMin = selectedDate.tm_min
     data = {'minClanLevel': minClanLevel,
      'maxClanLevel': maxClanLevel,
      'startDefenseHour': startDefenseHour,
      'startDefenseMinutes': startDefenseMin,
      'isTwelveHoursFormat': self.app.utilsManager.isTwelveHoursFormat(),
      'isWrongLocalTime': self._isWrongLocalTime(),
      'skipValues': adjustDefenceHoursListToLocal(g_lobbyContext.getServerSettings().getForbiddenFortDefenseHours())}
     defenceStart, _ = self.fortCtrl.getFort().getLocalDefenceHour()
     if defenceStart != NOT_ACTIVATED:
         data['yourOwnClanStartDefenseHour'] = defenceStart
     self.as_setDataS(data)
Exemplo n.º 2
0
 def __getQuestTooltip(self, qUserName, isBtnEnabled):
     if qUserName is not None:
         return makeTooltip(None, _ms(TOOLTIPS.BOOSTER_QUESTLINKBTN_BODY, questName=qUserName))
     elif not isBtnEnabled:
         return makeTooltip(None, _ms(TOOLTIPS.BOOSTER_ACTIVEBTN_DISABLED_BODY))
     else:
         return ""
Exemplo n.º 3
0
 def __getLogoutWarning(socialNetworkName):
     localizationString = "#menu:login/social/warning/SOCIAL_NETWORK_LOGOUT"
     formatter = {
         "userName": g_loginManager.getPreference("name"),
         "socialNetworkLink": makeHtmlString(
             "html_templates:socialNetworkLogin",
             "socialNetworkLink",
             {
                 "socialNetworkName": socialNetworkName,
                 "socialNetworkOfficialName": _ms("#tooltips:login/social/" + socialNetworkName),
             },
         ),
     }
     if socialNetworkName != SOCIAL_NETWORKS.WGNI:
         localizationString += "_BOTH"
         formatter["wargamingNetLink"] = makeHtmlString(
             "html_templates:socialNetworkLogin",
             "socialNetworkLink",
             {
                 "socialNetworkName": SOCIAL_NETWORKS.WGNI,
                 "socialNetworkOfficialName": _ms("#tooltips:login/social/" + SOCIAL_NETWORKS.WGNI),
             },
         )
     return makeHtmlString(
         "html_templates:socialNetworkLogin",
         "logoutWarning",
         {"warningMessage": _ms(localizationString) % formatter},
     )
Exemplo n.º 4
0
def __formatReplaceElements(elementGroups):
    result = []
    for elements, cType in zip(elementGroups, CUSTOMIZATION_TYPE.ALL):
        if elements:
            result.append('{0} {1}'.format(__formatTypeName(cType, len(elements)), _ms(VEHICLE_CUSTOMIZATION.DIALOG_REMOVE_ELEMENT_ELEMENTS_SEPARATOR).join(elements)))

    return '{0}{1}'.format(_ms(VEHICLE_CUSTOMIZATION.DIALOG_REMOVE_ELEMENT_GROUPS_SEPARATOR).join(result), _ms(VEHICLE_CUSTOMIZATION.DIALOG_REMOVE_ELEMENT_GROUPS_END))
 def setProxy(self, proxy, clanDossier):
     proxy.showWaiting()
     provinces = yield clanDossier.requestProvinces()
     isMyClan = clanDossier.isMyClan()
     hasProvinces = len(provinces) > 0
     if self.isDisposed():
         return
     headers = self._prepareHeaders(clanDossier.isMyClan(), hasProvinces)
     if isMyClan:
         listItemRendererLinkage = CLANS_ALIASES.CLAN_PROFILE_SELF_PROVINCE_RENDERER
     else:
         listItemRendererLinkage = CLANS_ALIASES.CLAN_PROFILE_PROVINCE_RENDERER
     data = {'rendererLinkage': listItemRendererLinkage,
      'headers': headers,
      'isListVisible': hasProvinces,
      'additionalText': text_styles.standard(_ms(CLANS.GLOBALMAPVIEW_TOTALINCOME, icon=icons.gold(), value=text_styles.gold(BigWorld.wg_getIntegralFormat(sum(map(operator.methodcaller('getRevenue'), provinces)))))),
      'isAdditionalTextVisible': hasProvinces and isMyClan,
      'noDataText': text_styles.highTitle(_ms(CLANS.GLOBALMAPVIEW_NOPROVINCE)),
      'isNoDataTextVisible': not hasProvinces}
     if hasProvinces:
         data['defaultSortField'] = _SORT_IDS.PROVINCE
         data['defaultSortDirection'] = 'ascending'
     self.as_setDataS(data)
     self.__provincesDP = _ClanProfileProvinceDataProvider(isMyClan)
     self.__provincesDP.setFlashObject(self.as_getDPS())
     self.__provincesDP.buildList(provinces)
     proxy.hideWaiting()
Exemplo n.º 6
0
 def _packBlocks(self, paramName):
     extendedData = self.context.getComparator().getExtendedData(paramName)
     self.__paramName = extendedData.name
     title = text_styles.highTitle(MENU.tank_params(paramName))
     if param_formatter.isRelativeParameter(paramName):
         value = param_formatter.colorizedFormatParameter(extendedData, self.context.formatters)
         title += ' ' + text_styles.warning(_ms(TOOLTIPS.VEHICLEPARAMS_TITLE_VALUETEMPLATE, value=value))
     else:
         title += ' ' + text_styles.middleTitle(MEASURE_UNITS.get(paramName, ''))
     desc = _ms(TOOLTIPS.tank_params_desc(paramName))
     possibleBonuses = sorted(extendedData.possibleBonuses, _bonusCmp)
     if possibleBonuses is not None and len(possibleBonuses) > 0:
         desc += ' ' + _ms(TOOLTIPS.VEHICLEPARAMS_POSSIBLEBONUSES_DESC)
         desc += '\n' + self.__createBonusesStr(possibleBonuses)
     blocks = [formatters.packTitleDescBlock(title, text_styles.main(desc))]
     bonuses = sorted(extendedData.bonuses, _bonusCmp)
     if bonuses is not None and len(bonuses) > 0:
         blocks.append(formatters.packTitleDescBlock(text_styles.middleTitle(TOOLTIPS.VEHICLEPARAMS_BONUSES_TITLE), text_styles.main(self.__createBonusesStr(bonuses))))
     penalties = extendedData.penalties
     actualPenalties, nullPenaltyTypes = self.__getNumNotNullPenaltyTankman(penalties)
     penaltiesLen = len(penalties)
     numNotNullPenaltyTankman = len(actualPenalties)
     if numNotNullPenaltyTankman > 0:
         blocks.append(formatters.packTitleDescBlock(text_styles.critical(TOOLTIPS.VEHICLEPARAMS_PENALTIES_TITLE), text_styles.main(self.__createPenaltiesStr(actualPenalties))))
     if penaltiesLen > numNotNullPenaltyTankman:
         blocks.append(formatters.packImageTextBlockData(self.__createTankmanIsOutStr(nullPenaltyTypes), img=RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, imgPadding=formatters.packPadding(top=2, left=3, right=6)))
     return blocks
Exemplo n.º 7
0
 def construct(self):
     block = []
     if self.configuration.crew:
         totalCrewSize = len(self.vehicle.descriptor.type.crewRoles)
         if self.configuration.externalCrewParam and self._roleLevel is not None:
             block.append(
                 formatters.packTextParameterBlockData(
                     name=text_styles.main(_ms(TOOLTIPS.VEHICLE_CREW_AWARD, self._roleLevel)),
                     value=text_styles.stats(str(totalCrewSize)),
                     valueWidth=self._valueWidth,
                     padding=formatters.packPadding(left=-2),
                 )
             )
         elif self.vehicle.isInInventory and not self.configuration.externalCrewParam:
             currentCrewSize = len([x for _, x in self.vehicle.crew if x is not None])
             currentCrewSizeStr = str(currentCrewSize)
             if currentCrewSize < totalCrewSize:
                 currentCrewSizeStr = text_styles.error(currentCrewSizeStr)
             block.append(self._makeStatBlock(currentCrewSizeStr, totalCrewSize, TOOLTIPS.VEHICLE_CREW))
         else:
             block.append(
                 formatters.packTextParameterBlockData(
                     name=text_styles.main(_ms(TOOLTIPS.VEHICLE_CREW)),
                     value=text_styles.stats(str(totalCrewSize)),
                     valueWidth=self._valueWidth,
                     padding=formatters.packPadding(left=-2),
                 )
             )
     lockBlock = self._makeLockBlock()
     if lockBlock is not None:
         block.append(lockBlock)
     return block
Exemplo n.º 8
0
 def __getAdditionalDescription(self, booster, qUserName):
     text = ''
     if qUserName is not None:
         text = _ms(MENU.BOOSTERSWINDOW_BOOSTERSTABLERENDERER_QUESTFOROPEN, questName=qUserName)
     elif booster.expiryTime is not None:
         text = _ms(MENU.BOOSTERSWINDOW_BOOSTERSTABLERENDERER_TIME, tillTime=booster.getExpiryDate())
     return text_styles.standard(text)
Exemplo n.º 9
0
    def buildList(self, cartItems):
        self.clear()
        elementGroups = [[], [], []]
        for item in cartItems:
            element = item['object']
            dropdownItem = {'id': element.getID(),
             'slotIdx': item['idx'],
             'selected': item['isSelected'],
             'cType': item['type'],
             'itemName': element.getName(),
             'imgBonus': element.qualifier.getIcon16x16(),
             'price': element.getPrice(item['duration']),
             'lblBonus': text_styles.stats('+{0}%{1}'.format(element.qualifier.getValue(), '*' if element.qualifier.getDescription() is not None else '')),
             'titleMode': False,
             'DDPrice': _getDropdownPriceVO(element),
             'selectIndex': DURATION.ALL.index(item['duration']),
             'isDuplicatePrice': item['isDuplicate'],
             'duplicatePriceText': icons.info() + _ms(VEHICLE_CUSTOMIZATION.BUYWINDOW_BUYTIME_COPY),
             'duplicatePriceTooltip': makeTooltip(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_BUYWINDOW_COPY_HEADER), _ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_BUYWINDOW_COPY_BODY))}
            elementGroups[item['type']].append(dropdownItem)

        for elements, title in zip(elementGroups, _CUSTOMIZATION_TYPE_TITLES):
            if elements:
                elements.insert(0, {'titleMode': True,
                 'titleText': _ms(text_styles.middleTitle(title))})

        self._list = list(itertools.chain(*elementGroups))
        return
Exemplo n.º 10
0
 def getLogoutWarning(socialNetworkName):
     localizationString = "#menu:login/social/warning/SOCIAL_NETWORK_LOGOUT"
     formatter = {
         "userName": Settings.g_instance.userPrefs[Settings.KEY_LOGIN_INFO].readString("user"),
         "socialNetworkLink": makeHtmlString(
             "html_templates:socialNetworkLogin",
             "socialNetworkLink",
             {
                 "socialNetworkName": socialNetworkName,
                 "socialNetworkOfficialName": _ms("#tooltips:login/social/" + socialNetworkName),
             },
         ),
     }
     if socialNetworkName != _SOCIAL_NETWORKS.WGNI:
         localizationString += "_BOTH"
         formatter["wargamingNetLink"] = makeHtmlString(
             "html_templates:socialNetworkLogin",
             "socialNetworkLink",
             {
                 "socialNetworkName": _SOCIAL_NETWORKS.WGNI,
                 "socialNetworkOfficialName": _ms("#tooltips:login/social/" + _SOCIAL_NETWORKS.WGNI),
             },
         )
     return makeHtmlString(
         "html_templates:socialNetworkLogin",
         "logoutWarning",
         {"warningMessage": _ms(localizationString) % formatter},
     )
 def _populate(self):
     super(ClanProfileGlobalMapPromoView, self)._populate()
     self.as_setDataS({'header': text_styles.promoSubTitle(_ms(CLANS.GLOBALMAPVIEW_PROMO_HEADER)),
      'description': text_styles.main(_ms(CLANS.GLOBALMAPVIEW_PROMO_DESCRIPTION)),
      'infoLinkLabel': _ms(CLANS.GLOBALMAPVIEW_PROMO_INFOLINK),
      'mapLinkLabel': _ms(CLANS.GLOBALMAPVIEW_PROMO_MAPLINK),
      'background': RES_ICONS.MAPS_ICONS_CLANS_GLOBAL_MAP_PROMO})
Exemplo n.º 12
0
 def fillDefault(self):
     self.__data['ladderIconSource'] = getLadderChevron256x256()
     self.__data['isRequestWaitingTextVisible'] = True
     self.__data['requestWaitingText'] = text_styles.alert('#cybersport:window/intro/unavailableWaiting')
     self.setClubLabel(_ms(CYBERSPORT.WINDOW_INTRO_TEAM_HEADER_STATICTEAMS))
     self.setClubDescription(text_styles.error('#cybersport:window/intro/team/description/unavailable'), isBackVisible=True)
     self.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ASSEMBLETEAM), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_ASSEMBLETEAM, enabled=False)
Exemplo n.º 13
0
 def _packBlocks(self, uid, level):
     description = _ms(FORTIFICATIONS.buildingsprocess_longdescr(uid))
     self._description = _ms(CLANS.SECTION_FORT_BUILDING_TOOLTIP_BODY, level=text_styles.stats(int2roman(level)), description=description)
     self._title = _ms(FORTIFICATIONS.buildings_buildingname(uid))
     items = super(ClanProfileFortBuildingTooltipData, self)._packBlocks()
     items.append(formatters.packTitleDescBlock(text_styles.highTitle(self._title), desc=text_styles.main(self._description) if self._description else None))
     return items
Exemplo n.º 14
0
    def __notObtained(self):
        """Check if item is obtainable from quests or from the shop.
        
        Returns:
            A tuple (buyItems, wasBough, status) where:
            buyItems - a list of different ways this item can be bought;
            wasBought - specifies if item is already bought;
            status - one of the STATUS constants
        """
        buyItems = []
        if self.__isInQuest():
            status = STATUS.DO_MISSION
            incompleteQuestItems = g_customizationController.dataAggregator.associatedQuests
            questName = incompleteQuestItems[self._itemType][self._item.getID()].name
            buyItems.append({'type': BUY_ITEM_TYPE.WAYS_TO_BUY_MISSION,
             'desc': _ms('#vehicle_customization:customization/tooltip/taskDescription', name=questName)})
        else:
            status = STATUS.AVAILABLE_FOR_BUY
            for duration in DURATION.ALL:
                if duration == DURATION.PERMANENT:
                    buyString = 'forever'
                    wayToBuy = BUY_ITEM_TYPE.WAYS_TO_BUY_FOREVER
                else:
                    buyString = 'temp'
                    wayToBuy = BUY_ITEM_TYPE.WAYS_TO_BUY_TEMP
                buyItems.append({'value': self._item.getPrice(duration),
                 'type': wayToBuy,
                 'isSale': self._item.isSale(duration),
                 'desc': _ms('#vehicle_customization:customization/tooltip/wayToBuy/{0}'.format(buyString), days=duration)})

        return (buyItems, False, status)
Exemplo n.º 15
0
 def _makeRequestTooltip(self, status, date, user = None):
     if status == CLAN_INVITE_STATES.ACCEPTED:
         return text_styles.concatStylesToMultiLine(text_styles.standard(_ms(CLANS.CLANINVITESWINDOW_TOOLTIPS_INVITE_INVITEACCEPTED)), text_styles.main(date), text_styles.main(''), text_styles.standard(_ms(CLANS.CLANINVITESWINDOW_TOOLTIPS_INVITE_BYUSER)), text_styles.stats(user))
     if status == CLAN_INVITE_STATES.DECLINED or status == CLAN_INVITE_STATES.DECLINED_RESENT:
         return text_styles.concatStylesToMultiLine(text_styles.standard(_ms(CLANS.CLANINVITESWINDOW_TOOLTIPS_INVITE_INVITEDECLINED)), text_styles.main(date), text_styles.main(''), text_styles.standard(_ms(CLANS.CLANINVITESWINDOW_TOOLTIPS_INVITE_BYUSER)), text_styles.stats(user))
     if status == CLAN_INVITE_STATES.ACTIVE or status == CLAN_INVITE_STATES.EXPIRED or status == CLAN_INVITE_STATES.EXPIRED_RESENT:
         return text_styles.concatStylesToMultiLine(text_styles.standard(_ms(CLANS.CLANINVITESWINDOW_TOOLTIPS_INVITE_INVITESENT)), text_styles.main(date), text_styles.main(''), text_styles.standard(_ms(CLANS.CLANINVITESWINDOW_TOOLTIPS_INVITE_SENDER)), text_styles.stats(user))
Exemplo n.º 16
0
 def _populate(self):
     super(FortOrderInfoWindow, self)._populate()
     self.as_setWindowDataS(
         {
             "windowTitle": self.__order.userName,
             "panelTitle": text_styles.middleTitle("#fortifications:fortConsumableOrder/battleParams"),
             "orderDescrTitle": text_styles.middleTitle("#fortifications:fortConsumableOrder/titleDescr"),
             "btnLbl": _ms("#fortifications:Orders/orderPopover/closeButton"),
             "orderDescrBody": text_styles.main(self.__order.getOperationDescription()),
         }
     )
     fmtLvl = text_styles.main(
         _ms(
             "#fortifications:fortConsumableOrder/params/level_lbl",
             level=fort_formatters.getTextLevel(self.__order.level),
         )
     )
     self.as_setDynPropertiesS(
         {
             "orderIcon": self.__order.icon,
             "level": self.__order.level,
             "orderLevel": fmtLvl,
             "orderTitle": self.__order.userName,
             "orderParams": self.__makeParams(),
         }
     )
Exemplo n.º 17
0
def _makeStats(totalStats):
    battlesNumData = {
        "text": BigWorld.wg_getIntegralFormat(totalStats.getBattlesCount()),
        "description": _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_STATS_BATTLES),
        "iconPath": RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_BATTLES40X32,
        "tooltip": TOOLTIPS.STATICFORMATIONSUMMARYVIEW_STATS_BATTLES,
    }
    winsEfficiency = totalStats.getWinsEfficiency() * 100 if totalStats.getWinsEfficiency() else 0
    winsPercentData = {
        "text": BigWorld.wg_getNiceNumberFormat(winsEfficiency) + "%",
        "description": _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_STATS_WINSPERCENT),
        "iconPath": RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_WINS40X32,
        "tooltip": TOOLTIPS.STATICFORMATIONSUMMARYVIEW_STATS_WINSPERCENT,
    }
    attackDamageEfficiency = {
        "text": BigWorld.wg_getIntegralFormat(totalStats.getAttackDamageEfficiency() or 0),
        "description": _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_STATS_ATTACKDAMAGEEFFICIENCY),
        "iconPath": RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_AVGATTACKDMG40X32,
        "tooltip": TOOLTIPS.STATICFORMATIONSUMMARYVIEW_STATS_WINSBYCAPTURE,
    }
    defenceDamageEfficiency = {
        "text": BigWorld.wg_getIntegralFormat(totalStats.getDefenceDamageEfficiency() or 0),
        "description": _ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_STATS_DEFENCEDAMAGEEFFICIENCY),
        "iconPath": RES_ICONS.MAPS_ICONS_LIBRARY_DOSSIER_AVGDEFENCEDMG40X32,
        "tooltip": TOOLTIPS.STATICFORMATIONSUMMARYVIEW_STATS_TECHDEFEATS,
    }
    return (battlesNumData, winsPercentData, attackDamageEfficiency, defenceDamageEfficiency)
 def __getEmptyListMsg(self, hasMessages):
     """
     Gets formatted empty list message
     """
     if not hasMessages:
         return _ms(MESSENGER.LISTVIEW_EMPTYLIST_TEMPLATE, listType=_ms(MESSENGER.listview_emptylist(self.__currentGroup)))
     return ''
Exemplo n.º 19
0
 def __getPersonalQuestsVO(self, vehicle):
     """ Get part of VO responsible for personal quests flag.
     """
     pqState, quest, chain, tile = _findPersonalQuestsState(self._eventsCache, vehicle)
     if pqState == WIDGET_PQ_STATE.AVAILABLE:
         icon = RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_PLUS
     elif pqState == WIDGET_PQ_STATE.AWARD:
         icon = RES_ICONS.MAPS_ICONS_LIBRARY_OUTLINE_REWARD
     elif pqState in WIDGET_PQ_STATE.UNSUITABLE:
         icon = RES_ICONS.vehicleTypeInactiveOutline(vehicle.type)
     else:
         icon = RES_ICONS.vehicleTypeOutline(vehicle.type)
     if pqState in WIDGET_PQ_STATE.UNSUITABLE:
         labelState = LABEL_STATE.INACTIVE
     elif pqState == WIDGET_PQ_STATE.AVAILABLE:
         labelState = LABEL_STATE.EMPTY
     else:
         labelState = LABEL_STATE.ACTIVE
     ctx = {}
     if all((quest, chain, tile)):
         self._personalQuestID = quest.getID()
         chainType = tile.getChainMajorTag(quest.getChainID())
         ctx.update({'questName': quest.getUserName(),
          'description': quest.getUserMainCondition(),
          'current': len(filter(lambda q: q.isCompleted(), chain.itervalues())),
          'total': len(chain),
          'tileName': tile.getUserName(),
          'chainName': _ms(MENU.classesShort(chainType))})
     else:
         self._personalQuestID = None
     return {'personalQuestsLabel': _ms(MENU.hangarHeaderPersonalQuestsLabel(labelState), **ctx),
      'personalQuestsIcon': icon,
      'personalQuestsTooltip': _getPersonalQuestsTooltip(pqState, **ctx),
      'personalQuestsEnable': pqState not in WIDGET_PQ_STATE.UNSUITABLE}
Exemplo n.º 20
0
 def __setBottomPanelData(self, *args):
     if self.__isCarouselHidden:
         occupiedSlotsNum, totalSlotsNum = self.__controller.slots.getSummary()
         label = text_styles.highTitle(_ms(VEHICLE_CUSTOMIZATION.TYPESWITCHSCREEN_SLOTSUMMARY, occupiedSlotsNum=occupiedSlotsNum, totalSlotsNum=totalSlotsNum))
     else:
         label = text_styles.middleTitle(_ms('#vehicle_customization:typeSwitchScreen/typeName/plural/{0}'.format(self.__controller.slots.currentType)))
     totalGold = self.__controller.cart.totalPriceGold
     totalCredits = self.__controller.cart.totalPriceCredits
     notEnoughGoldTooltip = notEnoughCreditsTooltip = ''
     enoughGold = g_itemsCache.items.stats.gold >= totalGold
     enoughCredits = g_itemsCache.items.stats.credits >= totalCredits
     if not enoughGold:
         diff = text_styles.gold(totalGold - g_itemsCache.items.stats.gold)
         notEnoughGoldTooltip = makeTooltip(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.gold())))
     if not enoughCredits:
         diff = text_styles.credits(totalCredits - g_itemsCache.items.stats.credits)
         notEnoughCreditsTooltip = makeTooltip(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_NOTENOUGHRESOURCES_HEADER), _ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_NOTENOUGHRESOURCES_BODY, count='{0}{1}'.format(diff, icons.credits())))
     self.as_setBottomPanelHeaderS({'newHeaderText': label,
      'buyBtnLabel': _ms(MENU.CUSTOMIZATION_BUTTONS_APPLY, count=len(self.__controller.cart.items)),
      'pricePanel': {'totalPriceCredits': formatPriceCredits(totalCredits),
                     'totalPriceGold': formatPriceGold(totalGold),
                     'enoughGold': enoughGold,
                     'enoughCredits': enoughCredits,
                     'notEnoughGoldTooltip': notEnoughGoldTooltip,
                     'notEnoughCreditsTooltip': notEnoughCreditsTooltip}})
Exemplo n.º 21
0
 def __initControls(self):
     self.as_setInitDataS({'ratingDescription': text_styles.stats(_ms(CLANS.SEARCH_INFO_RATINGDESCRIPTION)),
      'ratingTooltip': CLANS.SEARCH_INFO_RATINGDESCRIPTION_TOOLTIP,
      'requestSent': text_styles.success(_ms(CLANS.SEARCH_INFO_REQUESTSENT)),
      'clanProfileBtnLabel': _ms(CLANS.SEARCH_INFO_CLANPROFILEBTN),
      'sendRequestBtnLabel': _ms(CLANS.SEARCH_INFO_SENDREQUESTBTN)})
     self.as_setWaitingVisibleS(False)
Exemplo n.º 22
0
def _getSlotVO(slotData, cType, slotIdx):
    if slotData['element'] is None:
        elementID = -1
        if cType == CUSTOMIZATION_TYPE.CAMOUFLAGE:
            slotImage = _EMPTY_SLOTS_ICONS[cType][slotIdx]
        else:
            slotImage = _EMPTY_SLOTS_ICONS[cType]
    else:
        elementID = slotData['element'].getID()
        slotImage = slotData['element'].getTexturePath()
    slotVO = {'itemID': elementID,
     'slotTooltip': makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_SLOT_HEADER, groupName=_ms(_SLOT_TYPE_TOOLTIPS[cType])), TOOLTIPS.CUSTOMIZATION_SLOT_BODY),
     'removeBtnTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_SLOTREMOVE_HEADER, TOOLTIPS.CUSTOMIZATION_SLOTREMOVE_BODY),
     'revertBtnVisible': slotData['isRevertible'],
     'revertBtnTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_SLOTREVERT_HEADER, TOOLTIPS.CUSTOMIZATION_SLOTREVERT_BODY),
     'spot': slotData['spot'],
     'isInDossier': slotData['isInDossier'],
     'img': slotImage}
    if slotData['element'] is not None:
        slotVO['bonus'] = _getSlotBonusString(slotData['element'].qualifier, slotData['isInDossier'])
        if slotData['isInQuest']:
            purchaseTypeIcon = RES_ICONS.MAPS_ICONS_LIBRARY_QUEST_ICON
        elif slotData['duration'] == DURATION.PERMANENT:
            purchaseTypeIcon = RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2
        else:
            purchaseTypeIcon = RES_ICONS.MAPS_ICONS_LIBRARY_CREDITSICON_2
        slotVO['purchaseTypeIcon'] = purchaseTypeIcon
        slotVO['duration'] = slotData['duration']
    return slotVO
Exemplo n.º 23
0
def _getFortSortiesSchemaTexts(activatedDefModeParams, peripheryID, buildingsCount, dirsCount):
    if activatedDefModeParams:
        dayOff, defHour, vacation = activatedDefModeParams
        if dayOff == NOT_ACTIVATED:
            dayOffString = _ms(TOOLTIPS.FORTIFICATION_TOOLTIPENEMYCLANINFO_NODAYOFF)
        else:
            dayOffString = fort_fmts.getDayOffString(dayOff)
        defHourStart, _ = defHour or (None, None)
        if defHourStart is not None:
            defHour = fort_fmts.getDefencePeriodString(defHourStart)
        else:
            defHour = ''
        vacStart, vacEnd = vacation
        if vacStart is not None:
            vacationString = fort_fmts.getVacationPeriodString(vacStart, vacEnd)
        else:
            vacationString = _ms(TOOLTIPS.FORTIFICATION_TOOLTIPENEMYCLANINFO_NOVACATION)
    else:
        defHour = CLANS.SECTION_FORT_DEFENCE_NOTACTIVATED
        vacationString = dayOffString = None
    periphery = g_preDefinedHosts.periphery(peripheryID)
    if periphery is not None:
        serverName = periphery.name
    else:
        serverName = connectionManager.serverUserName
    return {'totalBuildingsCount': str(buildingsCount),
     'totalDirectionsCount': str(dirsCount),
     'defenceHour': defHour,
     'server': serverName,
     'vacation': vacationString,
     'dayOff': dayOffString}
Exemplo n.º 24
0
    def __setList(self, cartItems):
        self._list = []
        emblemItems = []
        camouflageItems = []
        inscriptionItems = []
        for item in cartItems:
            dpItem = {'id': item['itemID'],
             'slotIdx': item['idx'],
             'selected': item['isSelected'],
             'cType': item['type'],
             'itemName': item['name'],
             'imgBonus': item['bonusIcon'],
             'price': item['object'].getPrice(item['duration']),
             'lblBonus': text_styles.stats('+{0}%{1}'.format(item['bonusValue'], item['isConditional'])),
             'titleMode': False,
             'DDPrice': self.__getDropdownPriceVO(item),
             'selectIndex': DURATION.ALL.index(item['duration']),
             'isDuplicatePrice': item['isDuplicate'],
             'duplicatePriceText': icons.info() + _ms(CUSTOMIZATION.BUYWINDOW_BUYTIME_COPY),
             'duplicatePriceTooltip': makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_BUYWINDOW_COPY_HEADER), _ms(TOOLTIPS.CUSTOMIZATION_BUYWINDOW_COPY_BODY))}
            if item['type'] == data_aggregator.CUSTOMIZATION_TYPE.CAMOUFLAGE:
                camouflageItems.append(dpItem)
            elif item['type'] == data_aggregator.CUSTOMIZATION_TYPE.EMBLEM:
                emblemItems.append(dpItem)
            elif item['type'] == data_aggregator.CUSTOMIZATION_TYPE.INSCRIPTION:
                inscriptionItems.append(dpItem)

        if camouflageItems:
            camouflageItems.insert(0, self.__getTitle(CUSTOMIZATION.BUYWINDOW_TITLE_CAMOUFLAGE))
        if inscriptionItems:
            inscriptionItems.insert(0, self.__getTitle(CUSTOMIZATION.BUYWINDOW_TITLE_INSCRIPTION))
        if emblemItems:
            emblemItems.insert(0, self.__getTitle(CUSTOMIZATION.BUYWINDOW_TITLE_EMBLEM))
        self._list = camouflageItems + emblemItems + inscriptionItems
Exemplo n.º 25
0
 def _makeLockBlock(self):
     clanLockTime = self.vehicle.clanLock
     if clanLockTime and clanLockTime <= time_utils.getCurrentTimestamp():
         LOG_DEBUG("clan lock time is less than current time: %s" % clanLockTime)
         clanLockTime = None
     isDisabledInRoaming = self.vehicle.isDisabledInRoaming
     if clanLockTime or isDisabledInRoaming:
         headerLock = text_styles.concatStylesToMultiLine(text_styles.warning(_ms(TOOLTIPS.TANKCARUSEL_LOCK_HEADER)))
         if isDisabledInRoaming:
             textLock = text_styles.main(_ms(TOOLTIPS.TANKCARUSEL_LOCK_ROAMING))
         else:
             time = time_utils.getDateTimeFormat(clanLockTime)
             timeStr = text_styles.main(text_styles.concatStylesWithSpace(_ms(TOOLTIPS.TANKCARUSEL_LOCK_TO), time))
             textLock = text_styles.concatStylesToMultiLine(
                 timeStr, text_styles.main(_ms(TOOLTIPS.TANKCARUSEL_LOCK_CLAN))
             )
         lockHeaderBlock = formatters.packTextBlockData(
             headerLock, padding=formatters.packPadding(left=77 + self.leftPadding, top=5)
         )
         lockTextBlock = formatters.packTextBlockData(
             textLock, padding=formatters.packPadding(left=77 + self.leftPadding)
         )
         return formatters.packBuildUpBlockData(
             [lockHeaderBlock, lockTextBlock],
             stretchBg=False,
             linkage=BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_LOCK_BG_LINKAGE,
             padding=formatters.packPadding(left=-17, top=20, bottom=0),
         )
     else:
         return
         return
Exemplo n.º 26
0
    def __aggregateBonusesInfo(self, singleBonusData):
        bonusVOs = {}
        for cType in CUSTOMIZATION_TYPE.ALL:
            if not singleBonusData[cType]:
                continue
            bonusVOs[cType] = []
            for cItemData in singleBonusData[cType]:
                if cItemData['isApplied'] and not self.__hasAppliedElements:
                    self.__hasAppliedElements = True
                cItem = cItemData['available']
                cInstalledItem = cItemData['installed']
                bonusDescription = cItem.qualifier.getDescription()
                if cItemData['isApplied']:
                    durationInfo = ''
                    powerFormatter = text_styles.bonusAppliedText
                    titleFormatter = text_styles.bonusAppliedText
                else:
                    powerFormatter = text_styles.stats
                    titleFormatter = text_styles.main
                    if cItem.isInDossier:
                        durationInfo = ' ({0})'.format(_ms('#vehicle_customization:bonusPanel/tooltip/duration/0'))
                    else:
                        durationInfo = ' ({0})'.format(_ms('#vehicle_customization:bonusPanel/tooltip/duration/1', numberOfDaysLeft=cInstalledItem.numberOfDaysLeft))
                power = '+{0}%{1}'.format(cItem.qualifier.getValue(), '*' if bonusDescription is not None else '')
                singleBonus = {'power': powerFormatter(power),
                 'title': '{0}{1}'.format(titleFormatter(cItem.getName()), durationInfo),
                 'isTemporarily': bonusDescription is not None}
                if bonusDescription is not None:
                    singleBonus['description'] = text_styles.standard(bonusDescription)
                bonusVOs[cType].append(singleBonus)

        return bonusVOs
Exemplo n.º 27
0
 def __updateClubData(self):
     resultVO = _IntroViewVO()
     club = self.getClub()
     if self.clubsState.getStateID() == CLIENT_CLUB_STATE.HAS_CLUB and club:
         profile = self.clubsCtrl.getProfile()
         limits = self.clubsCtrl.getLimits()
         resultVO.setClubLabel(club.getUserName())
         resultVO.setClubDBbID(club.getClubDbID())
         resultVO.setClubLadderChevron(club)
         resultVO.showAdditionalButton(_ms(CYBERSPORT.WINDOW_INTRO_ADDITIONALBTN_LIST), TOOLTIPS.CYBERSPORT_INTRO_ADDITIONALBTN)
         resultVO.moveToTheUnitByCreateButton()
         resultVO.openClubProfileByChevronClick()
         if club.hasActiveUnit():
             unitInfo = club.getUnitInfo()
             resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_JOINTEAM), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_JOINTEAM)
             if unitInfo.isInBattle():
                 isInBattleIcon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_SWORDSICON, 16, 16, -3, 0)
                 resultVO.setClubDescription(text_styles.neutral('%s %s' % (isInBattleIcon, _ms(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_TEAMINBATTLE))))
             else:
                 resultVO.setClubDescription(text_styles.neutral(CYBERSPORT.STATICFORMATIONPROFILEWINDOW_STATUSLBL_CLUBISCALLED))
         else:
             canCreateUnit = limits.canCreateUnit(profile, club)
             if canCreateUnit.success:
                 resultVO.setClubDescription(text_styles.neutral(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_ASSEMBLINGTEAM))
                 resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ASSEMBLETEAM), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_ASSEMBLETEAM)
             elif canCreateUnit.reason == CLIENT_CLUB_RESTRICTIONS.NOT_ENOUGH_MEMBERS:
                 if club.getPermissions().isOwner():
                     resultVO.setClubDescription(text_styles.main(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_NOTENOUGHPLAYERS))
                     resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ADDPLAYERS), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_ADDPLAYERS)
                 else:
                     resultVO.setClubDescription(text_styles.error(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_OWNERASSEMBLINGTEAM), isBackVisible=True)
                     resultVO.showCreateButton(_ms('#cybersport:window/intro/create/btn/private/seeStaff'), '#tooltips:cyberSport/intro/createBtn/addPlayers/private')
                 resultVO.needAddPlayers()
             else:
                 resultVO.setClubDescription(text_styles.error(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_NOTENOUGHPERMISSIONS_ASSEMBLINGTEAM), isBackVisible=True)
                 resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_ASSEMBLETEAM), '#tooltips:StaticFormationProfileWindow/actionBtn/notEnoughPermissions', enabled=False)
     elif self.clubsState.getStateID() == CLIENT_CLUB_STATE.NO_CLUB:
         resultVO.setNoClubChevron(isApplicationSent=False)
         resultVO.setClubLabel(_ms(CYBERSPORT.WINDOW_INTRO_TEAM_HEADER_STATICTEAMS))
         resultVO.setClubDescription(text_styles.main(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_CREATEORFIND))
         resultVO.showCreateButton(_ms(CYBERSPORT.WINDOW_INTRO_CREATE_BTN_LOOK), TOOLTIPS.CYBERSPORT_INTRO_CREATEBTN_LOOK)
     elif self.clubsState.getStateID() == CLIENT_CLUB_STATE.SENT_APP:
         resultVO.setNoClubChevron(isApplicationSent=True)
         resultVO.openClubProfileByChevronClick()
         if club is not None:
             resultVO.setClubLabel(club.getUserName())
             resultVO.setClubLadderChevron(club)
         resultVO.setClubDescription(text_styles.neutral(CYBERSPORT.WINDOW_INTRO_TEAM_DESCRIPTION_WAITINGFORREQUEST))
         resultVO.showCancelButton(_ms(CYBERSPORT.WINDOW_INTRO_CANCEL_BTN_LABEL), TOOLTIPS.CYBERSPORT_INTRO_CANCELBTN)
         resultVO.showAdditionalButton(_ms(CYBERSPORT.WINDOW_INTRO_ADDITIONALBTN_LIST), TOOLTIPS.CYBERSPORT_INTRO_ADDITIONALBTN)
     else:
         resultVO.fillDefault()
         resultVO.acceptNavigationByChevron(False)
     isBattlesAvailable, _ = self.clubsCtrl.getAvailabilityCtrl().getStatus()
     if not isBattlesAvailable:
         resultVO.setClubDescriptionTooltip(TOOLTIPS_CONSTANTS.LADDER_REGULATIONS)
         resultVO.setClubDescription('{0}{1}'.format(icons.alert(), text_styles.main(CYBERSPORT.LADDERREGULATIONS_WARNING)), True)
     self.as_setStaticTeamDataS(resultVO.getData())
     return
Exemplo n.º 28
0
 def _onKickedWhileLogin(self, peripheryID):
     Waiting.hide('login')
     messageType = 'another_periphery' if peripheryID else 'checkout_error'
     self.as_setErrorMessageS(_ms(SYSTEM_MESSAGES.all(messageType)), INVALID_FIELDS.ALL_VALID)
     if not self.__loginRetryDialogShown:
         self.__showLoginRetryDialog({'waitingOpen': WAITING.titles(messageType),
          'waitingClose': WAITING.BUTTONS_CEASE,
          'message': _ms(WAITING.message(messageType), connectionManager.serverUserName)})
Exemplo n.º 29
0
def _getDataObjectTruncatedValue(key, i18nFunc, value):
    tooltip = _getTooltip(_ms(i18nFunc(key + '/tooltip/header'), value=value), _ms(i18nFunc(key + '/tooltip/body'), value=value))
    data = SUtils.getDetailedDataObject(i18nFunc(key), value, tooltip)
    data.update({'isUseTextStyle': True,
     'truncateVo': {'isUseTruncate': True,
                    'textStyle': 'statsText',
                    'maxWidthTF': 100}})
    return data
Exemplo n.º 30
0
 def getDescription(self):
     if self.__boughtVehicle:
         descriptionText = _ms(MENU.AWARDWINDOW_REFERRAL_VEHICLE_DESCRIPTION_BOUGHT, vehicleName=self.__vehicle.userName)
     elif self.__achievedXp is not None:
         descriptionText = _ms(MENU.AWARDWINDOW_REFERRAL_VEHICLE_DESCRIPTION_NORMAL, expCount=BigWorld.wg_getIntegralFormat(self.__achievedXp), vehicleName=self.__vehicle.userName)
     else:
         descriptionText = _ms(MENU.AWARDWINDOW_REFERRAL_VEHICLE_DESCRIPTION_NOXP, vehicleName=self.__vehicle.userName)
     return text_styles.main(descriptionText)
Exemplo n.º 31
0
def _getInitialVO(filters, hasRentedVehicles):
    dataVO = {
        'nationTypeId':
        _SECTIONS.NATION,
        'vehicleTypeId':
        _SECTIONS.VEHICLE_TYPE,
        'specialTypesLeftId':
        _SECTIONS.SPECIAL_LEFT,
        'specialTypesRightId':
        _SECTIONS.SPECIAL_RIGHT,
        'levelTypesId':
        _SECTIONS.LEVELS,
        'rentVehicleId':
        _SECTIONS.RENT_VEHICLE,
        'titleLabel':
        text_styles.highTitle('#tank_carousel_filter:filter/popover/title'),
        'nationLabel':
        text_styles.standard(
            '#tank_carousel_filter:filter/popover/label/nation'),
        'vehicleTypeLabel':
        text_styles.standard(
            '#tank_carousel_filter:filter/popover/label/vehicle'),
        'vehicleLevelLabel':
        text_styles.standard(
            '#tank_carousel_filter:filter/popover/label/vehicleLevel'),
        'vehicleEliteTypeLabel':
        text_styles.standard(
            '#tank_carousel_filter:filter/popover/label/vehicleEliteType'),
        'btnDefaultTooltip':
        makeTooltip(
            '#tank_carousel_filter:filter/popover/tooltip/defaultBtn/header',
            '#tank_carousel_filter:filter/popover/tooltip/defaultBtn/body'),
        'btnDefaultLabel':
        _ms('#tank_carousel_filter:filter/popover/label/defaultBtn'),
        'specialTypeLeft': [{
            'label':
            text_styles.standard(
                '#tank_carousel_filter:filter/popover/checkBox/Premium'),
            'tooltip':
            makeTooltip(
                '#tank_carousel_filter:filter/popover/tooltip/premium/header',
                '#tank_carousel_filter:filter/popover/tooltip/premium/body'),
            'selected':
            filters['premium']
        }],
        'specialTypeRight': [{
            'label':
            text_styles.standard(
                '#tank_carousel_filter:filter/popover/checkBox/Elite'),
            'tooltip':
            makeTooltip(
                '#tank_carousel_filter:filter/popover/tooltip/elite/header',
                '#tank_carousel_filter:filter/popover/tooltip/elite/body'),
            'selected':
            filters['elite']
        }],
        'nationsType': [],
        'vehicleType': [],
        'levelsType': [],
        'hasRentedVehicles':
        hasRentedVehicles,
        'rentCheckBox': {
            'label':
            text_styles.standard(
                '#tank_carousel_filter:filter/popover/label/vehicleLease'),
            'selected':
            filters['hideRented'],
            'enabled':
            not filters['igr'] if constants.IS_KOREA else True
        }
    }
    if constants.IS_KOREA:
        dataVO['specialTypeLeft'].append({
            'label': icons.premiumIgrSmall(),
            'selected': filters['igr']
        })
    for nation in GUI_NATIONS:
        dataVO['nationsType'].append({
            'value':
            getNationsFilterAssetPath(nation),
            'tooltip':
            makeTooltip(
                _ms('#nations:%s' % nation),
                _ms('#tank_carousel_filter:filter/popover/tooltip/nation/body')
            ),
            'selected':
            filters[nation]
        })

    for level in VEHICLE_LEVELS:
        dataVO['levelsType'].append({
            'value': getLevelsAssetPath(level),
            'selected': filters['level_%d' % level]
        })

    for vehicleType in VEHICLE_TYPES_ORDER:
        dataVO['vehicleType'].append({
            'value':
            getVehicleTypeAssetPath(vehicleType),
            'tooltip':
            makeTooltip(
                _ms('#menu:carousel_tank_filter/%s' % vehicleType),
                _ms('#tank_carousel_filter:filter/popover/tooltip/vehicleType/body'
                    )),
            'selected':
            filters[vehicleType]
        })

    return dataVO
Exemplo n.º 32
0
 def __makeTankmanDescription(self, roleName, fullName):
     role = text_styles.main(roleName)
     name = text_styles.standard(fullName)
     return _ms(BATTLE_RESULTS.COMMON_CREWMEMBER_DESCRIPTION,
                name=name,
                role=role)
Exemplo n.º 33
0
 def __makeVehicleDescription(self, vehicle):
     vehicleType = text_styles.standard(vehicle.typeUserName)
     vehicleName = text_styles.main(vehicle.userName)
     return _ms(BATTLE_RESULTS.COMMON_VEHICLE_DETAILS,
                vehicle=vehicleName,
                type=vehicleType)
Exemplo n.º 34
0
 def _getVO(self, item, vehicleCD=None):
     priceVO = getItemPricesVO(item.getSellPrice())[0]
     title = item.userName
     tooltipKey = TOOLTIPS.getItemBoxTooltip(item.itemTypeName)
     if tooltipKey:
         title = _ms(tooltipKey, group=item.userType, value=item.userName)
     if item.itemTypeID == GUI_ITEM_TYPE.PROJECTION_DECAL:
         icon = item.previewIconUrl
         formfactor = item.formfactor
     else:
         icon = item.icon
         formfactor = ''
     levelIcon = ''
     customizationSuitableText = backport.text(
         R.strings.storage.customizationSuitable.label())
     if vehicleCD is None:
         if not item.descriptor.filter or not item.descriptor.filter.include:
             customizationSuitableText = backport.text(
                 R.strings.storage.customizationSuitableForAll.label())
         else:
             customizationSuitableText += getSuitableText(item)
         count = item.inventoryCount
     else:
         vehicle = self._itemsCache.items.getItemByCD(vehicleCD)
         customizationSuitableText += vehicle.shortUserName
         count = item.boundInventoryCount(vehicleCD)
         if item.isProgressive:
             level = item.getLatestOpenedProgressionLevel(vehicle)
             if level > 0:
                 levelIcon = backport.image(
                     R.images.gui.maps.icons.customization.
                     progression_icons.dyn('level_{}'.format(level))())
                 if item.itemTypeID == GUI_ITEM_TYPE.PROJECTION_DECAL:
                     icon = item.previewIconUrlByProgressionLevel(level)
                 else:
                     icon = item.iconUrlByProgressionLevel(level)
     isAvailableForSell = isCustomizationAvailableForSell(item, vehicleCD)
     isPreviewAvailable = item.itemTypeID == GUI_ITEM_TYPE.STYLE
     vo = createStorageDefVO(itemID=item.intCD,
                             title=title,
                             description=customizationSuitableText,
                             count=count,
                             price=priceVO if isAvailableForSell else None,
                             image=icon,
                             imageAlt='altimage',
                             contextMenuId=CONTEXT_MENU_HANDLER_TYPE.
                             STORAGE_CUSTOMZIZATION_ITEM,
                             enabled=isAvailableForSell)
     vo.update({
         'previewAvailable':
         isPreviewAvailable,
         'previewTooltip':
         backport.text(R.strings.storage.stylePreview.tooltip()),
         'progressiveLevelIcon':
         levelIcon,
         'formfactor':
         formfactor,
         'vehicleCD':
         vehicleCD,
         'isWideImage':
         item.isWide(),
         'isRentable':
         item.isRentable
     })
     return vo
Exemplo n.º 35
0
 def __loginRejectedWithCustomState(self):
     self.as_setErrorMessageS(_ms('#menu:login/status/' + self.__customLoginStatus), INVALID_FIELDS.ALL_VALID)
     self.__clearFields(INVALID_FIELDS.ALL_VALID)
Exemplo n.º 36
0
 def _makeLockHeader(self):
     return text_styles.warning(_ms(TOOLTIPS.TANKCARUSEL_LOCK_HEADER))
Exemplo n.º 37
0
 def _makeLockText(self):
     return text_styles.main(_ms(TOOLTIPS.TANKCARUSEL_LOCK_ROAMING))
Exemplo n.º 38
0
 def userName(self):
     return _ms(MENU.DISCOUNT_USERNAME_VEHICLE)
 def __getTooltipHeader(socialNetworkName):
     return _ms(
         '#tooltips:login/bySocial/' + SOCIAL_NETWORKS.WGNI +
         '/header') if socialNetworkName == SOCIAL_NETWORKS.WGNI else _ms(
             '#tooltips:login/bySocial/header')
def makeFiltersVO(eventType, filters, selected=None, category=None):
    tooltip, value, _ = FORMATS[eventType]
    data = [ {'id': str(lid),
     'value': value.format(f),
     'tooltip': makeTooltip(tooltip.format(f), '#event_boards:{0}/tooltip/{1}'.format(category, eventType)) if category else _ms(tooltip.format(f)),
     'selected': lid == selected} for lid, f in filters ]
    return data
Exemplo n.º 41
0
 def construct(self):
     block = []
     if self.configuration.crew:
         totalCrewSize = len(self.vehicle.descriptor.type.crewRoles)
         if self.configuration.externalCrewParam and self._roleLevel is not None:
             block.append(formatters.packTextParameterBlockData(name=text_styles.main(_ms(TOOLTIPS.VEHICLE_CREW_AWARD, self._roleLevel)), value=text_styles.stats(str(totalCrewSize)), valueWidth=self._valueWidth, padding=formatters.packPadding(left=-2)))
         elif self.vehicle.isInInventory and not self.configuration.externalCrewParam:
             currentCrewSize = len([ x for _, x in self.vehicle.crew if x is not None ])
             currentCrewSizeStr = str(currentCrewSize)
             if currentCrewSize < totalCrewSize:
                 currentCrewSizeStr = text_styles.error(currentCrewSizeStr)
             block.append(self._makeStatBlock(currentCrewSizeStr, totalCrewSize, TOOLTIPS.VEHICLE_CREW))
         else:
             block.append(formatters.packTextParameterBlockData(name=text_styles.main(_ms(TOOLTIPS.VEHICLE_CREW)), value=text_styles.stats(str(totalCrewSize)), valueWidth=self._valueWidth, padding=formatters.packPadding(left=-2)))
     return block
Exemplo n.º 42
0
 def __loginRejectedRateLimited(self):
     self.as_setErrorMessageS(_ms(MENU.LOGIN_STATUS_LOGIN_REJECTED_RATE_LIMITED), INVALID_FIELDS.ALL_VALID)
     if not self.__loginRetryDialogShown:
         self.__showLoginRetryDialog({'waitingOpen': WAITING.TITLES_QUEUE,
          'waitingClose': WAITING.BUTTONS_EXITQUEUE,
          'message': _ms(WAITING.MESSAGE_AUTOLOGIN, self.connectionMgr.serverUserName)})
Exemplo n.º 43
0
 def __getOperationTitle(self):
     currentOperation = self.getOperation()
     chainState = self.__getChainState(self.getChain())
     state = PERSONAL_MISSIONS_ALIASES.OPERATION_UNLOCKED_STATE
     tooltip = {
         'tooltip': None,
         'isSpecial': False,
         'specialAlias': None,
         'specialArgs': None
     }
     if not currentOperation.isUnlocked():
         label = text_styles.stats(
             PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_LOCKED)
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_LOCKED_STATE
     elif chainState.isFullCompleted:
         label = text_styles.bonusAppliedText(
             PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_EXCELLENTDONE)
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_COMPLETE_FULL_STATE
     elif chainState.isCompleted:
         infoIcon = icons.makeImageTag(
             RES_ICONS.MAPS_ICONS_LIBRARY_NOTIF_FILTERS_INFORMATION_16X16,
             16, 16, -2)
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_COMPLETE_STATE
         currentCount = currentOperation.getFreeTokensCount()
         totalCount = currentOperation.getFreeTokensTotalCount()
         if currentCount < totalCount:
             icon = icons.makeImageTag(
                 AwardSheetPresenter.getIcon(AwardSheetPresenter.Size.MID),
                 24, 24, -22)
             count = str(currentCount)
             total = str(totalCount)
             label = text_styles.stats(
                 _ms(PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_DONE,
                     icon=icon,
                     count=count,
                     total=total,
                     infoIcon=infoIcon))
             tooltip.update({
                 'isSpecial':
                 True,
                 'specialAlias':
                 TOOLTIPS_CONSTANTS.FREE_SHEET,
                 'specialArgs': [currentOperation.getCampaignID()]
             })
         else:
             count = str(len(currentOperation.getFullCompletedQuests()))
             total = str(currentOperation.getQuestsCount())
             label = text_styles.stats(
                 _ms(PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_TOMASTER,
                     count=count,
                     total=total,
                     infoIcon=infoIcon))
             tooltip[
                 'tooltip'] = TOOLTIPS.PERSONALMISSIONS_OPERATIONTITLE_COMPLETESTATE
     elif chainState.questInProgress:
         if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_INPROGRESS_PM2
         else:
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_INPROGRESS_REGULAR
         vehData = getChainVehRequirements(currentOperation,
                                           self.getChainID(),
                                           useIcons=True)
         label = text_styles.stats(_ms(template, vehData=vehData))
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_CURRENT_STATE
         tooltip[
             'tooltip'] = TOOLTIPS.PERSONALMISSIONS_OPERATIONTITLE_CURRENTSTATE
     elif not chainState.hasVehicle:
         if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_PM2
         else:
             template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_REGULAR
         vehData = getChainVehRequirements(currentOperation,
                                           self.getChainID(),
                                           useIcons=True)
         label = text_styles.stats(_ms(template, vehData=vehData))
         state = PERSONAL_MISSIONS_ALIASES.OPERATION_NO_VEHICLE_STATE
     else:
         if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
             template = text_styles.stats(
                 PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_UNLOCKED_PM2)
         else:
             template = text_styles.stats(
                 PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_UNLOCKED_REGULAR)
         vehData = getChainVehRequirements(currentOperation,
                                           self.getChainID(),
                                           useIcons=True)
         label = text_styles.stats(_ms(template, vehData=vehData))
     return {
         'title':
         text_styles.promoTitle(
             _ms(PERSONAL_MISSIONS.OPERATIONTITLE_TITLE,
                 title=_ms('#personal_missions:operations/title%d' %
                           currentOperation.getID()))),
         'label':
         label,
         'state':
         state,
         'tooltip':
         tooltip
     }
Exemplo n.º 44
0
 def description(self):
     return _ms(MENU.DISCOUNT_DESCRIPTION_VEHICLE, effectValue=self.getFormattedValue(), targetName=self.targetName)
Exemplo n.º 45
0
 def _makeLockText(self):
     clanLockTime = self.vehicle.clanLock
     time = time_utils.getDateTimeFormat(clanLockTime)
     timeStr = text_styles.main(text_styles.concatStylesWithSpace(_ms(TOOLTIPS.TANKCARUSEL_LOCK_TO), time))
     return text_styles.concatStylesToMultiLine(timeStr, text_styles.main(_ms(TOOLTIPS.TANKCARUSEL_LOCK_CLAN)))
Exemplo n.º 46
0
 def _makeStatBlock(self, current, total, text):
     return formatters.packTextParameterBlockData(name=text_styles.main(_ms(text)), value=text_styles.stats(str(current) + '/' + str(total)), valueWidth=self._valueWidth)
Exemplo n.º 47
0
 def _makeLockHeader(self):
     return text_styles.warning(_ms(TOOLTIPS.TANKCARUSEL_LOCK_ROTATION_HEADER, groupNum=self.vehicle.rotationGroupNum))
Exemplo n.º 48
0
    def _packBlocks(self, *args, **kwargs):
        items = super(RentVehicleAwardTooltipData, self)._packBlocks()
        blocks = list()
        blocks.append(
            formatters.packTextBlockData(
                text_styles.middleTitle(
                    TOOLTIPS.QUESTS_AWARDS_VEHICLERENT_HEADER),
                padding=formatters.packPadding(top=8)))
        blocks.append(
            formatters.packTextParameterWithIconBlockData(
                name=text_styles.premiumVehicleName(
                    TOOLTIPS.QUESTS_AWARDS_VEHICLERENT_EXPIRE),
                value='',
                icon=ICON_TEXT_FRAMES.RENTALS,
                padding=formatters.packPadding(left=-60),
                iconYOffset=3))
        vehiclesCount = 0
        for rentVehicleData in args:
            rentVehicleData = flashObject2Dict(rentVehicleData)
            vehicleName = rentVehicleData.get('vehicleName', '')
            vehicleType = rentVehicleData.get('vehicleType', '')
            isPremiumVehicle = rentVehicleData.get('isPremium', True)
            rentLeftCount = 0
            rentTypeName = None
            for rentType in _RENT_TYPES:
                rentTypeValue = rentVehicleData.get(rentType, 0)
                if rentTypeValue > 0:
                    rentTypeName = rentType
                    rentLeftCount = rentTypeValue
                    break

            if isPremiumVehicle:
                imgPaddings = formatters.packPadding(right=2)
            else:
                imgPaddings = formatters.packPadding(left=5, right=5, top=4)
            blocks.append(
                formatters.packImageTextBlockData(
                    title=text_styles.highlightText(vehicleName),
                    img=getTypeSmallIconPath(vehicleType, isPremiumVehicle),
                    imgPadding=imgPaddings,
                    txtPadding=formatters.packPadding(left=2)))
            if rentTypeName is not None and rentLeftCount > 0:
                rentCountStr = text_styles.premiumVehicleName(rentLeftCount)
                rentLeftStr = _ms(TOOLTIPS.getRentLeftTypeLabel(rentTypeName),
                                  count=rentCountStr)
                blocks.append(
                    formatters.packTextBlockData(
                        text_styles.main(rentLeftStr),
                        padding=formatters.packPadding(left=28,
                                                       top=-8,
                                                       bottom=5)))
            vehiclesCount += 1
            if vehiclesCount >= _MAX_AWARDS_PER_TOOLTIP:
                count = len(args) - vehiclesCount
                if count > 0:
                    blocks.append(
                        formatters.packTextBlockData(
                            text_styles.main(
                                backport.text(R.strings.tooltips.quests.awards.
                                              additional.bottom(),
                                              count=count))))
                break

        items.append(
            formatters.packBuildUpBlockData(
                blocks, padding=formatters.packPadding(bottom=-12)))
        return items
Exemplo n.º 49
0
 def qualityStr(self):
     return _ms(_BOOSTER_QUALITY_LOCALE % self.quality)
Exemplo n.º 50
0
    def _packBlocks(self, *args, **kwargs):
        items = super(QuestsPreviewTooltipData, self)._packBlocks()
        vehicle = g_currentVehicle.item
        quests = sorted([
            q for q in self._questController.getQuestForVehicle(vehicle)
            if not q.isCompleted() and self.__eventProgression.questPrefix
            not in q.getID() and not isDailyQuest(q.getID())
            and not isPremium(q.getID()) and not isRankedQuestID(q.getID())
        ],
                        key=events_helpers.questsSortFunc)
        if quests:
            items.append(
                self._getHeader(
                    len(quests), vehicle.shortUserName,
                    R.strings.tooltips.hangar.header.quests.description.
                    vehicle()))
            for quest in quests:
                bonusNames = []
                for bonus in quest.getBonuses():
                    if bonus.getName() == 'battleToken':
                        bonusNames.extend(
                            _StringTokenBonusFormatter().format(bonus))
                    bonusFormat = bonus.format()
                    if bonusFormat:
                        if isinstance(bonus, CustomizationsBonus):
                            for item in bonus.getCustomizations():
                                itemTypeName = item.get('custType')
                                if itemTypeName == 'projection_decal':
                                    itemTypeName = GUI_ITEM_TYPE_NAMES[
                                        GUI_ITEM_TYPE.PROJECTION_DECAL]
                                elif itemTypeName == 'personal_number':
                                    itemTypeName = GUI_ITEM_TYPE_NAMES[
                                        GUI_ITEM_TYPE.PERSONAL_NUMBER]
                                bonusFmt = _ms(
                                    ITEM_TYPES.customization(itemTypeName))
                                bonusNames.append(bonusFmt)

                        else:
                            bonusNames.extend(bonusFormat.split(', '))

                isAvailable, _ = quest.isAvailable()
                items.append(
                    self._packQuest(quest.getUserName(), bonusNames,
                                    isAvailable))
                if len(items) > _MAX_QUESTS_PER_TOOLTIP:
                    break

            rest = len(quests) - len(items) + 1
            if rest > 0:
                items.append(self._getBottom(rest))
        else:

            def _filter(q):
                return q.getType(
                ) not in constants.EVENT_TYPE.SHARED_QUESTS and not q.isCompleted(
                )

            allQuests = self._eventsCache.getQuests(filterFunc=_filter)
            if allQuests:
                items.append(
                    self._getHeader(
                        len(quests), vehicle.shortUserName,
                        R.strings.tooltips.hangar.header.quests.description.
                        vehicle()))
                items.append(
                    self._getBody(TOOLTIPS.HANGAR_HEADER_QUESTS_EMPTY_VEHICLE))
            else:
                items.append(
                    self._getHeader(
                        len(quests), vehicle.shortUserName,
                        R.strings.tooltips.hangar.header.quests.description()))
                items.append(self._getBody(
                    TOOLTIPS.HANGAR_HEADER_QUESTS_EMPTY))
            items.append(self._getBottom(0))
        return items
Exemplo n.º 51
0
 def __loginRejectedUpdateNeeded(self):
     success = yield DialogsInterface.showI18nConfirmDialog('updateNeeded')
     if success and not BigWorld.wg_quitAndStartLauncher():
         self.as_setErrorMessageS(_ms(MENU.LOGIN_STATUS_LAUNCHERNOTFOUND), INVALID_FIELDS.ALL_VALID)
Exemplo n.º 52
0
 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)
Exemplo n.º 53
0
 def _packBlocks(self, paramName):
     blocks = super(VehicleAvgParameterTooltipData, self)._packBlocks(paramName)
     rangeParamName = self._AVG_TO_RANGE_PARAMETER_NAME[paramName]
     value = self.context.getComparator().getExtendedData(rangeParamName).value
     fmtValue = param_formatter.formatParameter(rangeParamName, value)
     blocks.append(formatters.packBuildUpBlockData([formatters.packTextParameterBlockData(text_styles.main(_ms(TOOLTIPS.getAvgParameterCommentKey(rangeParamName), units=_ms(param_formatter.MEASURE_UNITS.get(rangeParamName)))), text_styles.stats(fmtValue), valueWidth=80)]))
     return blocks
Exemplo n.º 54
0
 def construct(self):
     block = []
     headerBlocks = []
     if self.vehicle.isElite:
         vehicleType = TOOLTIPS.tankcaruseltooltip_vehicletype_elite(self.vehicle.type)
         bgLinkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_ELITE_VEHICLE_BG_LINKAGE
     else:
         vehicleType = TOOLTIPS.tankcaruseltooltip_vehicletype_normal(self.vehicle.type)
         bgLinkage = BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_NORMAL_VEHICLE_BG_LINKAGE
     nameStr = text_styles.highTitle(self.vehicle.userName)
     typeStr = text_styles.main(vehicleType)
     levelStr = text_styles.concatStylesWithSpace(text_styles.stats(int2roman(self.vehicle.level)), text_styles.standard(_ms(TOOLTIPS.VEHICLE_LEVEL)))
     icon = getTypeBigIconPath(self.vehicle.type, self.vehicle.isElite)
     headerBlocks.append(formatters.packImageTextBlockData(title=nameStr, desc=text_styles.concatStylesToMultiLine(levelStr + ' ' + typeStr, ''), img=icon, imgPadding=formatters.packPadding(left=10, top=-15), txtGap=-2, txtOffset=99, padding=formatters.packPadding(top=15, bottom=-15 if self.vehicle.isFavorite else -21)))
     if self.vehicle.isFavorite:
         headerBlocks.append(formatters.packImageTextBlockData(title=text_styles.neutral(TOOLTIPS.VEHICLE_FAVORITE), img=RES_ICONS.MAPS_ICONS_TOOLTIP_MAIN_TYPE, imgPadding=formatters.packPadding(top=-15), imgAtLeft=False, txtPadding=formatters.packPadding(left=10), txtAlign=BLOCKS_TOOLTIP_TYPES.ALIGN_RIGHT, padding=formatters.packPadding(top=-28, bottom=-27)))
     block.append(formatters.packBuildUpBlockData(headerBlocks, stretchBg=False, linkage=bgLinkage, padding=formatters.packPadding(left=-self.leftPadding)))
     return block
Exemplo n.º 55
0
 def __getEmptyListMsg(self, hasMessages):
     return _ms(MESSENGER.LISTVIEW_EMPTYLIST_TEMPLATE, listType=_ms(MESSENGER.listview_emptylist(self.__currentGroup))) if not hasMessages else ''
Exemplo n.º 56
0
 def _packBlocks(self, *args, **kwargs):
     announcement = self.context.buildItem(*args, **kwargs)
     items = super(VehicleAnnouncementParametersTooltipData, self)._packBlocks()
     items.append(formatters.packTextBlockData(text_styles.main(_ms(announcement.tooltip))))
     return items
def makeParameterTooltipVO(method, amount, parameter):
    parametersWithTooltip = [_op.ORIGINALXP, _op.XP]
    maxOrSum = 'max' if method == _cm.MAX else 'sum'
    return makeTooltip(header=_ms(EVENT_BOARDS.TOOLTIP_TOP_NOREWARDGROUP), body=_ms(EVENT_BOARDS.tooltip_top_description_all(maxOrSum, parameter), number=int(amount))) if parameter in parametersWithTooltip and amount is not None else None
Exemplo n.º 58
0
 def _showSecurityMessage(self, responseData):
     securityWarningType = responseData.get('security_msg')
     if securityWarningType is not None:
         securityLink = ''
         if not GUI_SETTINGS.isEmpty('securitySettingsURL'):
             securityLink = makeHtmlString('html_templates:lobby/system_messages', 'link', {'text': _ms(SYSTEM_MESSAGES.SECURITYMESSAGE_CHANGE_SETINGS),
              'linkType': 'securityLink'})
         SystemMessages.pushI18nMessage('#system_messages:securityMessage/%s' % securityWarningType, type=SystemMessages.SM_TYPE.Warning, link=securityLink)
     return
Exemplo n.º 59
0
    def __updateFooter(self):
        chainState = self.__getChainState(self.getChain())
        isQuestInProgress = False
        btnVisible = False
        btnEnabled = False
        btnLabel = ''
        descr = ''
        currentOperation = self.getOperation()
        chainClassifier = currentOperation.getChainClassifier(
            self.getChainID())
        vehicleClass = getTypeShortUserName(chainClassifier.classificationAttr)
        pm = self._eventsCache.getPersonalMissions()
        branch = self.getBranch()
        freeSheets = pm.getFreeTokensCount(branch)
        pawnedSheets = pm.getPawnedTokensCount(branch)
        if not chainState.hasUnlocked:
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(PERSONAL_MISSIONS.STATUSPANEL_STATUS_LOCKED))
        elif chainState.questInProgress is not None:
            quest = chainState.questInProgress
            isQuestInProgress = True
            status = text_styles.concatStylesWithSpace(
                icons.inProgress(), text_styles.tutorial(quest.getUserName()))
            if quest.areTokensPawned():
                descr = text_styles.neutral(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_PAWNED,
                        count=quest.getPawnCost(),
                        icon=getHtmlAwardSheetIcon(quest.getQuestBranch())))
            elif quest.isMainCompleted():
                descr = text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_IMPROVE)
            elif quest.canBePawned() and not quest.isDisabled():
                btnVisible = True
                pawnCost = quest.getPawnCost()
                btnLabel = _ms(
                    PERSONAL_MISSIONS.STATUSPANEL_FREESHEETBTN_LABEL,
                    count=pawnCost,
                    icon=getHtmlAwardSheetIcon(quest.getQuestBranch()))
                if pawnCost <= freeSheets:
                    btnEnabled = True
        elif chainState.isFullCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.doubleCheckmark(-2),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLEXCELLENTDONE,
                        vehicleClass=vehicleClass)))
        elif chainState.isCompleted:
            status = text_styles.concatStylesWithSpace(
                icons.checkmark(-2),
                text_styles.bonusAppliedText(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_STATUS_ALLDONE,
                        vehicleClass=vehicleClass)))
        elif not chainState.hasVehicle:
            if self.getBranch() == PM_BRANCH.PERSONAL_MISSION_2:
                template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_PM2
            else:
                template = PERSONAL_MISSIONS.OPERATIONTITLE_LABEL_NOVEHICLE_REGULAR
            vehData = getChainVehRequirements(currentOperation,
                                              self.getChainID(),
                                              useIcons=False)
            status = text_styles.concatStylesWithSpace(
                icons.markerBlocked(),
                text_styles.error(_ms(template, vehData=vehData)))
        else:
            status = text_styles.concatStylesWithSpace(
                icons.makeImageTag(
                    RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16,
                    -2),
                text_styles.neutral(
                    PERSONAL_MISSIONS.STATUSPANEL_STATUS_SELECTTASK))
        tankwomanQuests = []
        for operation in pm.getAllOperations().itervalues():
            tankwomanQuests.extend(
                operation.getQuestsByFilter(
                    PersonalMission.needToGetTankWoman).itervalues())

        counterText = ''
        tankwomanVisible = False
        if tankwomanQuests:
            counterText = text_styles.highlightText('x%s' %
                                                    len(tankwomanQuests))
            tankwomanVisible = True
        self.as_setStatusDataS({
            'statusText': status,
            'descrText': descr,
            'btnVisible': btnVisible,
            'btnEnabled': btnEnabled,
            'btnLabel': btnLabel,
            'sheetsBlockData': {
                'freeSheetsIcon':
                AwardSheetPresenter.getIcon(AwardSheetPresenter.Size.MID),
                'freeSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_FREESHEETS,
                        count=text_styles.highlightText(freeSheets))),
                'pawnedSheetsText':
                text_styles.main(
                    _ms(PERSONAL_MISSIONS.STATUSPANEL_PAWNEDSHEETS,
                        count=text_styles.highlightText(pawnedSheets))),
                'tooltipData': {
                    'isSpecial':
                    True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.FREE_SHEET_RETURN if freeSheets
                    or pawnedSheets else TOOLTIPS_CONSTANTS.FREE_SHEET,
                    'specialArgs': [currentOperation.getCampaignID()]
                },
                'popover':
                PERSONAL_MISSIONS_ALIASES.FREE_SHEET_POPOVER,
                'popoverData': {
                    'branch': branch
                }
            },
            'tankgirlsBlockData': {
                'counterText': counterText,
                'visible': tankwomanVisible,
                'tooltipData': {
                    'isSpecial': True,
                    'specialAlias':
                    TOOLTIPS_CONSTANTS.PERSONAL_MISSIONS_TANKWOMAN,
                    'specialArgs': []
                },
                'popover': PERSONAL_MISSIONS_ALIASES.TANK_GIRLS_POPOVER
            },
            'tooltip': None,
            'isQuestInProgress': isQuestInProgress
        })
        return
Exemplo n.º 60
0
 def atReturn(self, cd):
     cd.self.as_showMiniClientInfoS(
         text_styles.alert(
             _ms('#miniclient:fort_welcome_view/description')),
         _ms('#miniclient:personal_quests_welcome_view/continue_download'))