Esempio n. 1
1
    def __getCompanyAvailabilityData(self):
        tooltipData = TOOLTIPS.BATTLETYPES_COMPANY
        battle = g_eventsCache.getCompanyBattles()
        header = i18n.makeString(tooltipData + "/header")
        body = i18n.makeString(tooltipData + "/body")
        serversList = []
        if battle.isValid() and battle.isDestroyingTimeCorrect():
            for peripheryID in battle.peripheryIDs:
                host = g_preDefinedHosts.periphery(peripheryID)
                if host is not None:
                    serversList.append(host.name)

            beginDate = ""
            endDate = ""
            serversString = ""
            if battle.startTime is not None:
                beginDate = i18n.makeString(
                    TOOLTIPS.BATTLETYPES_AVAILABLETIME_SINCE, beginDate=BigWorld.wg_getShortDateFormat(battle.startTime)
                )
            if battle.finishTime is not None:
                endDate = i18n.makeString(
                    TOOLTIPS.BATTLETYPES_AVAILABLETIME_UNTIL, endDate=BigWorld.wg_getShortDateFormat(battle.finishTime)
                )
            if serversList:
                serversString = i18n.makeString(
                    TOOLTIPS.BATTLETYPES_AVAILABLETIME_SERVERS, servers=", ".join(serversList)
                )
            if beginDate or endDate or serversString:
                restrictInfo = i18n.makeString(
                    TOOLTIPS.BATTLETYPES_AVAILABLETIME, since=beginDate, until=endDate, servers=serversString
                )
                body = "%s\n\n%s" % (body, restrictInfo)
        return makeTooltip(header, body)
Esempio n. 2
0
    def __setSlotsData(self, cType):
        selectorSlotsData = []
        for slotIdx in range(0, len(self.__aData.installed[cType])):
            installedItem = self.__aData.installed[cType][slotIdx]
            itemID = installedItem.getID()
            if itemID is None or self.__aData.available[cType][itemID].getGroup() == 'auto':
                itemID = -1
            slotData = {'itemID': itemID,
             'slotTooltip': makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_SLOT_HEADER, groupName=_ms(_SLOT_TOOLTIP_MAPPING[cType])), TOOLTIPS.CUSTOMIZATION_SLOT_BODY),
             'removeBtnTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_SLOTREMOVE_HEADER, TOOLTIPS.CUSTOMIZATION_SLOTREMOVE_BODY),
             'spot': installedItem.getSpot(),
             'isInDossier': itemID >= 0}
            if itemID < 0:
                if cType == CUSTOMIZATION_TYPE.CAMOUFLAGE:
                    slotData['img'] = _EMPTY_SLOTS_MAP[cType][slotIdx]
                else:
                    slotData['img'] = _EMPTY_SLOTS_MAP[cType]
            else:
                availableItem = self.__aData.available[cType][itemID]
                slotData['img'] = availableItem.getTexturePath()
                slotData['bonus'] = self.__getSlotBonusString(availableItem.qualifier, True)
                if self.__aData.available[cType][itemID].isInDossier:
                    purchaseTypeIcon = RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2
                else:
                    purchaseTypeIcon = RES_ICONS.MAPS_ICONS_LIBRARY_CREDITSICON_2
                slotData['purchaseTypeIcon'] = purchaseTypeIcon
                slotData['duration'] = installedItem.duration
                slotData['price'] = 0
            selectorSlotsData.append(slotData)

        return selectorSlotsData
    def __createInitialVO(self):
        isTypeNotCamouflage = self.__filter.currentType != CUSTOMIZATION_TYPE.CAMOUFLAGE
        groupsUserNames = []
        for _, groupName in self.__groupsMap[self.__filter.currentType]:
            groupsUserNames.append(groupName)

        updateVO = self.__createUpdateVO()
        return {'lblTitle': text_styles.highTitle(VEHICLE_CUSTOMIZATION.FILTER_POPOVER_TITLE),
         'lblBonusType': text_styles.standard(VEHICLE_CUSTOMIZATION.FILTER_POPOVER_BONUSTYPE_TITLE),
         'lblCustomizationType': text_styles.standard(VEHICLE_CUSTOMIZATION.FILTER_POPOVER_GROUPS_TITLE),
         'lblPurchaseType': text_styles.standard(VEHICLE_CUSTOMIZATION.FILTER_POPOVER_WAYSTOBUY_TITLE),
         'btnDefault': VEHICLE_CUSTOMIZATION.FILTER_POPOVER_GETDEFAULTSETTINGS,
         'bonusTypeId': FILTER_TYPE.QUALIFIER,
         'bonusType': _getBonusTypeVO(self.__filter.selectedBonuses),
         'customizationBonusTypeVisible': isTypeNotCamouflage,
         'enableGroupFilter': updateVO['enableGroupFilter'],
         'customizationTypeId': FILTER_TYPE.GROUP,
         'customizationType': groupsUserNames,
         'customizationTypeSelectedIndex': updateVO['groupsSelectIndex'],
         'customizationTypeVisible': isTypeNotCamouflage,
         'bonusTypeDisableTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.TOOLTIP_FILTER_GROUPS_DISABLED_HEADER, VEHICLE_CUSTOMIZATION.TOOLTIP_FILTER_GROUPS_DISABLED_BODY),
         'refreshTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTERPOPOVER_REFRESH_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTERPOPOVER_REFRESH_BODY),
         'purchaseTypeId': FILTER_TYPE.PURCHASE_TYPE,
         'purchaseType': _getPurchaseTypeVO(),
         'purchaseTypeSelectedIndex': PURCHASE_TYPE.ALL.index(self.__filter.purchaseType)}
def _filter_popover_getInitialVO(base, filters, mapping, xpRateMultiplier):
    data = base(filters, mapping, xpRateMultiplier)
    #debug(data['specials'])
    #debug(mapping)
    try:
        premium = data['specials'][mapping[_SECTION.SPECIALS].index(PREFS.PREMIUM)]
        normal = {'label': l10n('Normal'), 'tooltip': makeTooltip(l10n('NormalTooltipHeader'), l10n('NormalTooltipBody')), 'selected': filters[PREFS.NORMAL]}
        elite = data['specials'][mapping[_SECTION.SPECIALS].index(PREFS.ELITE)]
        non_elite = {'label': l10n('NonElite'), 'tooltip': makeTooltip(l10n('NonEliteTooltipHeader'), l10n('NonEliteTooltipBody')), 'selected': filters[PREFS.NON_ELITE]}
        complete_crew = {'label': l10n('CompleteCrew'), 'tooltip': makeTooltip(l10n('CompleteCrewTooltipHeader'), l10n('CompleteCrewTooltipBody')), 'selected': filters[PREFS.FULL_CREW]}
        no_master = {'label': l10n('NoMaster'), 'tooltip': makeTooltip(l10n('NoMasterTooltipHeader'), l10n('NoMasterTooltipBody')), 'selected': filters[PREFS.NO_MASTER]}
        reserve = {'label': l10n('ReserveFilter'), 'tooltip': makeTooltip(l10n('ReserveFilterTooltipHeader'), l10n('ReserveFilterTooltipBody')), 'selected': filters[PREFS.RESERVE]}

        is_igr = PREFS.IGR in mapping[_SECTION.SPECIALS]
        if is_igr:
            igr = data['specials'][-1]

        data['specials'] = [
            premium,       normal, 
            elite,         non_elite, 
            complete_crew, no_master,
            reserve]

        if is_igr:
            data['specials'].append(igr)
    except Exception as ex:
        err('_filter_popover_getInitialVO() exception: ' + traceback.format_exc())
    return data
Esempio n. 5
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}})
Esempio n. 6
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
 def __getButtonData(self):
     if self.fortState.getStateID() == CLIENT_FORT_STATE.HAS_FORT:
         fort = self.fortCtrl.getFort()
         if not fort.isDefenceHourEnabled():
             if self.fortCtrl.getPermissions().canChangeDefHour():
                 fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_LEADER
             else:
                 fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_NOTLEADER
             additionalText = i18n.makeString(FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NOTACTIVATEDDEFENCETIME)
             return (False, makeTooltip(None, fortBattleBtnTooltip), additionalText)
         attacksInOneDay = fort.getAttacksIn(timePeriod=time_utils.ONE_DAY)
         defencesInOneDay = fort.getDefencesIn(timePeriod=time_utils.ONE_DAY)
         if attacksInOneDay or defencesInOneDay:
             return (True, TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_ENABLED, None)
         battlesInTwoWeeks = fort.getAttacksAndDefencesIn(timePeriod=2 * time_utils.ONE_WEEK)
         if battlesInTwoWeeks:
             closestBattle = battlesInTwoWeeks[0]
             battleDate = BigWorld.wg_getLongDateFormat(closestBattle.getStartTime())
             additionalText = i18n.makeString(FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLE, nextDate=battleDate)
             fortBattleBtnTooltip = i18n.makeString(TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_NEXTBATTLE, currentDate=battleDate)
             return (False, makeTooltip(None, fortBattleBtnTooltip), additionalText)
         if self.fortCtrl.getPermissions().canPlanAttack():
             fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_LEADERNOACTION
         else:
             fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_NOTLEADERNOACTION
         additionalText = i18n.makeString(FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NOTACTIVATED)
         return (False, makeTooltip(None, fortBattleBtnTooltip), additionalText)
     else:
         return (False, '', None)
Esempio n. 8
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 ""
Esempio n. 9
0
    def createInitVO(self):
        isTypeNotCamouflage = self.__filter.currentType != CUSTOMIZATION_TYPE.CAMOUFLAGE
        groupsUserNames = []
        groupsList = []
        for groupData in self.__groupsMap[self.__filter.currentType]:
            groupsUserNames.append(groupData[1])
            groupsList.append(groupData[0])

        if isTypeNotCamouflage:
            groupsSelectIndex = groupsList.index(self.__filter.currentGroup)
        else:
            groupsSelectIndex = 0
        return {'lblTitle': text_styles.highTitle(CUSTOMIZATION.FILTER_POPOVER_TITLE),
         'lblBonusType': text_styles.standard(CUSTOMIZATION.FILTER_POPOVER_BONUSTYPE_TITLE),
         'lblCustomizationType': text_styles.standard(CUSTOMIZATION.FILTER_POPOVER_GROUPS_TITLE),
         'lblPurchaseType': text_styles.standard(CUSTOMIZATION.FILTER_POPOVER_WAYSTOBUY_TITLE),
         'btnDefault': CUSTOMIZATION.FILTER_POPOVER_GETDEFAULTSETTINGS,
         'bonusTypeId': FILTER_TYPE.QUALIFIER,
         'bonusType': self.__getBonusTypeVO(),
         'customizationBonusTypeVisible': isTypeNotCamouflage,
         'customizationTypeId': FILTER_TYPE.GROUP,
         'customizationType': groupsUserNames,
         'customizationTypeSelectedIndex': groupsSelectIndex,
         'customizationTypeVisible': isTypeNotCamouflage,
         'bonusTypeDisableTooltip': makeTooltip(CUSTOMIZATION.TOOLTIP_FILTER_GROUPS_DISABLED_HEADER, CUSTOMIZATION.TOOLTIP_FILTER_GROUPS_DISABLED_BODY),
         'refreshTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_FILTERPOPOVER_REFRESH_HEADER, TOOLTIPS.CUSTOMIZATION_FILTERPOPOVER_REFRESH_BODY),
         'purchaseTypeId': FILTER_TYPE.PURCHASE_TYPE,
         'purchaseType': self.__getPurchaseTypeVO(),
         'purchaseTypeSelectedIndex': self.__purchaseTypeList.index(self.__filter.purchaseType)}
Esempio n. 10
0
 def __setCarouselInitData(self):
     self.as_setCarouselInitS({'icoFilter': RES_ICONS.MAPS_ICONS_BUTTONS_FILTER,
      'durationType': [self.__getDurationTypeVO('{0}{1}'.format(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_ALWAYS), icons.gold()), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_ALWAYS)), _ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_BODY, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_LOWERCASE_ALWAYS))), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_ALWAYS)), VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_DISABLED)), self.__getDurationTypeVO('{0}{1}'.format(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_MONTH), icons.credits()), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_MONTH)), _ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_BODY, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_LOWERCASE_MONTH))), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_MONTH)), VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_DISABLED)), self.__getDurationTypeVO('{0}{1}'.format(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_WEEK), icons.credits()), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_WEEK)), _ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_BODY, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_LOWERCASE_WEEK))), makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_WEEK)), VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_DISABLED))],
      'durationSelectIndex': 0,
      'onlyPurchased': True,
      'icoPurchased': RES_ICONS.MAPS_ICONS_FILTERS_PRESENCE,
      'message': '{2}{0}\n{1}'.format(text_styles.neutral(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_HEADER), text_styles.main(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_DESCRIPTION), icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16, -3, 0)),
      'fitterTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_CAROUSEL_FILTER_HEADER, TOOLTIPS.CUSTOMIZATION_CAROUSEL_FILTER_BODY),
      'chbPurchasedTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_HEADER, TOOLTIPS.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_BODY)})
 def _enableRefreshBtn(self, enable, toolTip=None):
     if enable:
         self.as_updateButtonRefreshStateS(
             True, makeTooltip(body=_ms(toolTip or CLANS.CLANPERSONALINVITESWINDOW_TOOLTIPS_REFRESHBUTTON_ENABLED))
         )
     else:
         self.as_updateButtonRefreshStateS(
             False, makeTooltip(body=_ms(toolTip or CLANS.CLANPERSONALINVITESWINDOW_TOOLTIPS_REFRESHBUTTON_DISABLED))
         )
Esempio n. 12
0
 def __setCarouselInitData(self):
     self.as_setCarouselInitS({'icoFilter': RES_ICONS.MAPS_ICONS_BUTTONS_FILTER,
      'durationType': _getDurationTypeVO(),
      'durationSelectIndex': 0,
      'onlyPurchased': True,
      'icoPurchased': RES_ICONS.MAPS_ICONS_FILTERS_PRESENCE,
      'message': '{2}{0}\n{1}'.format(text_styles.neutral(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_HEADER), text_styles.main(VEHICLE_CUSTOMIZATION.CAROUSEL_MESSAGE_DESCRIPTION), icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, vSpace=-3)),
      'fitterTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_FILTER_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_FILTER_BODY),
      'chbPurchasedTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_CHBPURCHASED_BODY)})
Esempio n. 13
0
 def updateSlot(self, item, cType = None, slotIdx = None, duration = 0):
     slotIdx = self.__currentIdx if slotIdx is None else slotIdx
     cType = self.__currentType if cType is None else cType
     if item['id'] < 0:
         if cType == CUSTOMIZATION_TYPE.CAMOUFLAGE:
             img = _EMPTY_SLOTS_MAP[cType][slotIdx]
         else:
             img = _EMPTY_SLOTS_MAP[cType]
         price = 0
         bonus = ''
         isInDossier = False
     else:
         img = item['object'].getTexturePath()
         price = item['object'].getPrice(duration)
         isInDossier = item['object'].isInDossier
         bonus = self.__getSlotBonusString(item['object'].qualifier, isInDossier)
     typedData = self.__data['data'][cType]['data']
     if len(typedData) == 2:
         thisItemSlotIdx = slotIdx
         anotherSlotIdx = 1 - slotIdx
         if item['id'] < 0:
             if typedData[thisItemSlotIdx]['itemID'] == typedData[anotherSlotIdx]['itemID']:
                 typedData[anotherSlotIdx]['price'] = self.getSlotItem(cType=cType, slotIdx=anotherSlotIdx).getPrice(typedData[anotherSlotIdx]['duration'])
         elif item['id'] == typedData[anotherSlotIdx]['itemID']:
             if duration == 0:
                 typedData[anotherSlotIdx]['price'] = 0
             elif typedData[anotherSlotIdx]['duration'] == 0:
                 price = 0
     oldSlotItem = self.__data['data'][cType]['data'][slotIdx]
     newSlotItem = {'itemID': item['id'],
      'img': img,
      'purchaseTypeIcon': RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2 if duration == 0 else RES_ICONS.MAPS_ICONS_LIBRARY_CREDITSICON_2,
      'bonus': bonus,
      'duration': duration,
      'spot': oldSlotItem['spot'],
      'price': price,
      'isInDossier': isInDossier,
      'slotTooltip': makeTooltip(_ms(TOOLTIPS.CUSTOMIZATION_SLOT_HEADER, groupName=_ms(_SLOT_TOOLTIP_MAPPING[self.__currentType])), TOOLTIPS.CUSTOMIZATION_SLOT_BODY),
      'removeBtnTooltip': makeTooltip(TOOLTIPS.CUSTOMIZATION_SLOTREMOVE_HEADER, TOOLTIPS.CUSTOMIZATION_SLOTREMOVE_BODY)}
     self.__updateViewModel(cType, slotIdx, newSlotItem)
     if newSlotItem['itemID'] < 0:
         if oldSlotItem['itemID'] >= 0:
             if oldSlotItem['isInDossier']:
                 self.cart.buyItem(cType, newSlotItem['spot'], self.calculateVehicleIndex(slotIdx, cType), oldSlotItem['itemID'], 0)
             else:
                 initialSlotItem = copy.deepcopy(self.__initialData['data'][cType]['data'][slotIdx])
                 self.__setSlotAndUpdateView(cType, slotIdx, initialSlotItem)
     elif newSlotItem['isInDossier']:
         if item['object'].numberOfDays is not None:
             itemDuration = item['object'].numberOfDays
         else:
             itemDuration = 0
         self.cart.buyItem(cType, newSlotItem['spot'], self.calculateVehicleIndex(slotIdx, cType), newSlotItem['itemID'], itemDuration, price=0)
     else:
         self.__setSlotAndUpdateView(cType, slotIdx, newSlotItem)
     return
Esempio n. 14
0
 def __updateState(self):
     state = g_currentVehicle.getViewState()
     self.as_setCrewEnabledS(state.isCrewOpsEnabled())
     self.__updateCarouselEnabled()
     if state.isOnlyForEventBattles():
         customizationTooltip = makeTooltip(_ms(TOOLTIPS.HANGAR_TUNING_DISABLEDFOREVENTVEHICLE_HEADER), _ms(TOOLTIPS.HANGAR_TUNING_DISABLEDFOREVENTVEHICLE_BODY))
     else:
         customizationTooltip = makeTooltip(_ms(TOOLTIPS.HANGAR_TUNING_HEADER), _ms(TOOLTIPS.HANGAR_TUNING_BODY))
     self.as_setupAmmunitionPanelS(state.isMaintenanceEnabled(), makeTooltip(_ms(TOOLTIPS.HANGAR_MAINTENANCE_HEADER), _ms(TOOLTIPS.HANGAR_MAINTENANCE_BODY)), state.isCustomizationEnabled(), customizationTooltip)
     self.as_setControlsVisibleS(state.isUIShown())
Esempio n. 15
0
    def __showDismissedTankmen(self, criteria):
        tankmen = getRestoreController().getDismissedTankmen()
        tankmenList = list()
        for tankman in tankmen:
            if not criteria(tankman):
                continue
            skillsList = []
            for skill in tankman.skills:
                skillsList.append({'tankmanID': tankman.invID,
                 'id': str(tankman.skills.index(skill)),
                 'name': skill.userName,
                 'desc': skill.description,
                 'icon': skill.icon,
                 'level': skill.level,
                 'active': skill.isEnable and skill.isActive})

            newSkillsCount, lastNewSkillLvl = tankman.newSkillCount
            if newSkillsCount > 0:
                skillsList.append({'buy': True,
                 'buyCount': newSkillsCount - 1,
                 'tankmanID': tankman.invID,
                 'level': lastNewSkillLvl})
            restoreInfo = getTankmenRestoreInfo(tankman)
            actionBtnTooltip = makeTooltip(TOOLTIPS.BARRACKS_TANKMEN_RECOVERYBTN_HEADER, getRecoveryStatusText(restoreInfo))
            tankmanData = _packTankmanData(tankman)
            tankmanData.update({'isRankNameVisible': False,
             'recoveryPeriodText': _makeRecoveryPeriodText(restoreInfo),
             'actionBtnLabel': MENU.BARRACKS_BTNRECOVERY,
             'actionBtnTooltip': actionBtnTooltip,
             'skills': skillsList,
             'isSkillsVisible': True})
            tankmenList.append(tankmanData)

        tankmenCountStr = _ms(MENU.BARRACKS_DISMISSEDTANKMENCOUNT, curValue=len(tankmenList), total=len(tankmen))
        placeCount = getRestoreController().getMaxTankmenBufferLength()
        placeCountStr = _ms(MENU.BARRACKS_RECOVERYCOUNT, total=placeCount, info=icons.info())
        noInfoData = None
        hasNoInfoData = len(tankmenList) == 0
        if hasNoInfoData:
            if len(tankmen) == 0:
                tankmenRestoreConfig = g_itemsCache.items.shop.tankmenRestoreConfig
                freeDays = tankmenRestoreConfig.freeDuration / time_utils.ONE_DAY
                creditsDays = tankmenRestoreConfig.creditsDuration / time_utils.ONE_DAY - freeDays
                noInfoData = {'title': text_styles.highTitle(MENU.BARRACKS_NORECOVERYTANKMEN_TITLE),
                 'message': text_styles.main(_ms(MENU.BARRACKS_NORECOVERYTANKMEN_MESSAGE, price=moneyWithIcon(tankmenRestoreConfig.cost), totalDays=freeDays + creditsDays, freeDays=freeDays, paidDays=creditsDays))}
            else:
                noInfoData = {'message': text_styles.main(MENU.BARRACKS_NOFILTEREDRECOVERYTANKMEN_MESSAGE)}
        placesCountTooltip = makeTooltip(TOOLTIPS.BARRACKS_PLACESCOUNT_DISMISS_HEADER, _ms(TOOLTIPS.BARRACKS_PLACESCOUNT_DISMISS_BODY, placeCount=placeCount))
        self.as_setTankmenS({'tankmenCount': text_styles.playerOnline(tankmenCountStr),
         'placesCount': text_styles.playerOnline(placeCountStr),
         'placesCountTooltip': placesCountTooltip,
         'tankmenData': tankmenList,
         'hasNoInfoData': hasNoInfoData,
         'noInfoData': noInfoData})
        return
Esempio n. 16
0
 def _getInitialFilterVO(self):
     filters = self.filter.getFilters(self._usedFilters)
     xpRateStr = 'x{}'.format(self._itemsCache.items.shop.dailyXPFactor)
     return {'counterCloseTooltip': makeTooltip('#tooltips:tanksFilter/counter/close/header', '#tooltips:tanksFilter/counter/close/body'),
      'mainBtn': {'value': getButtonsAssetPath('params'),
                  'tooltip': makeTooltip('#tank_carousel_filter:filter/paramsFilter/header', '#tank_carousel_filter:filter/paramsFilter/body')},
      'hotFilters': [{'value': getButtonsAssetPath('bonus_{}'.format(xpRateStr)),
                      'selected': filters['bonus'],
                      'tooltip': makeTooltip('#tank_carousel_filter:filter/bonusFilter/header', i18n.makeString('#tank_carousel_filter:filter/bonusFilter/body', bonus=xpRateStr))}, {'value': getButtonsAssetPath('favorite'),
                      'selected': filters['favorite'],
                      'tooltip': makeTooltip('#tank_carousel_filter:filter/favoriteFilter/header', '#tank_carousel_filter:filter/favoriteFilter/body')}]}
 def getSlotTooltipBody(self, slotIdx):
     boosterID = self._slotsMap.get(int(slotIdx), None)
     if boosterID == _EMPTY_BOOSTER_ID:
         tooltip = ''
     elif boosterID in (ADD_BOOSTER_ID, _ADD_AVAILABLE_BOOSTER_ID):
         body = TOOLTIPS.BOOSTERSPANEL_OPENBOOSTERSWINDOW_BODY
         tooltip = makeTooltip(None, body)
     else:
         booster = g_goodiesCache.getBooster(int(boosterID))
         tooltip = makeTooltip(i18n.makeString(MENU.BOOSTERSWINDOW_BOOSTERSTABLERENDERER_HEADER, boosterName=booster.userName, quality=booster.qualityStr), booster.description, i18n.makeString(TOOLTIPS.BOOSTERSPANEL_BOOSTERDESCRIPTION_NOTE, time=booster.getUsageLeftTimeStr()))
     return tooltip
Esempio n. 18
0
 def _initializeFilters(self):
     xpRate = 'x%d' % g_itemsCache.items.shop.dailyXPFactor
     falloutBattleType = i18n.makeString('#menu:headerButtons/battle/menu/fallout/{0}'.format(getFalloutCtrl().getBattleType()))
     self.as_initCarouselFilterS({'counterCloseTooltip': makeTooltip(TOOLTIPS.TANKSFILTER_COUNTER_CLOSE_HEADER, TOOLTIPS.TANKSFILTER_COUNTER_CLOSE_BODY),
      'paramsFilter': {'icon': getButtonsAssetPath('params'),
                       'tooltip': makeTooltip('#tank_carousel_filter:filter/paramsFilter/header', '#tank_carousel_filter:filter/paramsFilter/body')},
      'favoriteFilter': {'icon': getButtonsAssetPath('favorite'),
                         'tooltip': makeTooltip('#tank_carousel_filter:filter/favoriteFilter/header', '#tank_carousel_filter:filter/favoriteFilter/body')},
      'gameModeFilter': {'icon': getButtonsAssetPath('game_mode'),
                         'tooltip': makeTooltip('#tank_carousel_filter:filter/gameModeFilter/header', i18n.makeString('#tank_carousel_filter:filter/gameModeFilter/body', type=falloutBattleType))},
      'bonusFilter': {'icon': getButtonsAssetPath('bonus_%s' % xpRate),
                      'tooltip': makeTooltip('#tank_carousel_filter:filter/bonusFilter/header', i18n.makeString('#tank_carousel_filter:filter/bonusFilter/body', bonus=xpRate))}})
Esempio n. 19
0
    def __getInitialFilterVO(self, contexts):
        filters = self.filter.getFilters(self._usedFilters)
        filtersVO = {'counterCloseTooltip': makeTooltip('#tooltips:tanksFilter/counter/close/header', '#tooltips:tanksFilter/counter/close/body'),
         'mainBtn': {'value': getButtonsAssetPath('params'),
                     'tooltip': makeTooltip('#tank_carousel_filter:tooltip/params/header', '#tank_carousel_filter:tooltip/params/body')},
         'hotFilters': []}
        for entry in self._usedFilters:
            filterCtx = contexts.get(entry, FilterSetupContext())
            filtersVO['hotFilters'].append({'value': getButtonsAssetPath(filterCtx.asset or entry),
             'selected': filters[entry],
             'tooltip': makeTooltip('#tank_carousel_filter:tooltip/{}/header'.format(entry), _ms('#tank_carousel_filter:tooltip/{}/body'.format(entry), **filterCtx.ctx))})

        return filtersVO
Esempio n. 20
0
def _getDurationTypeVO():
    durationTypeVOs = []
    for duration, (tooltipText, tooltipLowercaseText) in _DURATION_TOOLTIPS.items():
        if duration == DURATION.PERMANENT:
            icon = icons.gold()
        else:
            icon = icons.credits()
        label = '{0}{1}'.format(_ms(tooltipText), icon)
        tooltip = makeTooltip(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(tooltipText)), _ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_BODY, time=_ms(tooltipLowercaseText)))
        tooltipDisabled = makeTooltip(_ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_CAROUSEL_DURATIONTYPE_HEADER, time=_ms(tooltipText)), VEHICLE_CUSTOMIZATION.CUSTOMIZATION_FILTER_DURATION_DISABLED)
        durationTypeVOs.append({'label': label,
         'tooltip': tooltip,
         'tooltipDisabled': tooltipDisabled})

    return durationTypeVOs
 def __createTexts(self):
     self.__textsCreated = True
     return {'windowLbl': FORTIFICATIONS.PERIODDEFENCEWINDOW_HEADERLBL,
      'headerLbl': text_styles.highTitle(FORTIFICATIONS.PERIODDEFENCEWINDOW_READY),
      'peripheryLbl': text_styles.neutral(FORTIFICATIONS.PERIODDEFENCEWINDOW_PERIPHERY),
      'peripheryDescr': text_styles.standard(FORTIFICATIONS.PERIODDEFENCEWINDOW_PERIPHERY_DESCRIPTION),
      'hourDefenceLbl': text_styles.neutral(FORTIFICATIONS.PERIODDEFENCEWINDOW_HOURDEFENCE),
      'hourDefenceDescr': text_styles.standard(FORTIFICATIONS.PERIODDEFENCEWINDOW_HOURDEFENCE_DESCRIPTION),
      'holidayLbl': text_styles.neutral(FORTIFICATIONS.PERIODDEFENCEWINDOW_HOLIDAY),
      'holidayDescr': text_styles.standard(FORTIFICATIONS.PERIODDEFENCEWINDOW_HOLIDAY_DESCRIPTION),
      'acceptBtn': FORTIFICATIONS.PERIODDEFENCEWINDOW_BTN_ACTIVATE,
      'cancelBtn': FORTIFICATIONS.PERIODDEFENCEWINDOW_BTN_NOTNOW,
      'cancelBtnTooltip': makeTooltip(None, FORTIFICATIONS.PERIODDEFENCEWINDOW_NOTNOW_BODY),
      'acceptBtnEnabledTooltip': makeTooltip(None, FORTIFICATIONS.PERIODDEFENCEWINDOW_BTN_POINTSAREFILLED_BODY),
      'acceptBtnDisabledTooltip': makeTooltip(None, FORTIFICATIONS.PERIODDEFENCEWINDOW_BTN_POINTSARENOTFILLED_BODY)}
Esempio n. 22
0
def makeVehicleVO(vehicle, levelsRange = None, vehicleTypes = None, isCurrentPlayer = True):
    if vehicle is None:
        return
    vState, vStateLvl = vehicle.getState(isCurrentPlayer)
    if vState == Vehicle.VEHICLE_STATE.UNDAMAGED or vState == Vehicle.VEHICLE_STATE.IN_PREBATTLE or vState in Vehicle.GROUP_STATES:
        vStateStr = ''
        isReadyToFight = True
    else:
        isReadyToFight = vehicle.isReadyToFight
        if vState == Vehicle.VEHICLE_STATE.IN_PREMIUM_IGR_ONLY:
            vStateStr = makeHtmlString('html_templates:lobby', 'inPremiumIgrOnly')
        else:
            vStateStr = i18n.makeString('#menu:tankCarousel/vehicleStates/%s' % vState)
    enabled, tooltip = True, None
    if not isReadyToFight:
        enabled, tooltip = False, makeTooltip('#tooltips:vehicleStatus/%s/header' % vState, '#tooltips:vehicleStatus/body')
    elif levelsRange is not None and vehicle.level not in levelsRange:
        enabled, tooltip = False, TOOLTIPS.VEHICLESELECTOR_OVERFLOWLEVEL
    elif vehicleTypes is not None and vehicle.type not in vehicleTypes:
        enabled, tooltip = False, TOOLTIPS.VEHICLESELECTOR_INCOMPATIBLETYPE
    return {'intCD': vehicle.intCD,
     'nationID': vehicle.nationID,
     'name': vehicle.name,
     'userName': vehicle.userName,
     'shortUserName': vehicle.shortUserName,
     'level': vehicle.level,
     'type': vehicle.type,
     'typeIndex': VEHICLE_TABLE_TYPES_ORDER_INDICES[vehicle.type],
     'smallIconPath': '../maps/icons/vehicle/small/{0}.png'.format(vehicle.name.replace(':', '-')),
     'isReadyToFight': isReadyToFight,
     'enabled': enabled,
     'tooltip': tooltip,
     'state': vStateStr,
     'isFalloutVehicle': vehicle.isFalloutSelected}
Esempio n. 23
0
 def __buildBlackListVO(self, contact):
     """
     Builds vo related to the Black List button.
     
     :param contact: an instance of UserEntity
     :return: dict
     """
     isEnabled = not self._ignoreActionCooldown.isInCooldown()
     if contact:
         if contact.isTemporaryIgnored():
             status = BATTLE_MESSAGES_CONSTS.REMOVE_FROM_BLACKLIST
             header = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_REMOVE_FROM_BLACKLIST_HEADER
             body = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_REMOVE_FROM_BLACKLIST_BODY
         elif contact.isIgnored():
             status = BATTLE_MESSAGES_CONSTS.ADD_IN_BLACKLIST
             header = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_CANT_ADD_IN_BLACKLIST_HEADER
             body = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_CANT_ADD_IN_BLACKLIST_BODY
             isEnabled = False
         else:
             status = BATTLE_MESSAGES_CONSTS.ADD_IN_BLACKLIST
             header = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_ADD_IN_BLACKLIST_HEADER
             body = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_ADD_IN_BLACKLIST_BODY
     else:
         status = BATTLE_MESSAGES_CONSTS.ADD_IN_BLACKLIST
         header = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_ADD_IN_BLACKLIST_HEADER
         body = INGAME_GUI.BATTLEMESSENGER_TOXIC_BLACKLIST_ADD_IN_BLACKLIST_BODY
     return {'status': status,
      'tooltip': makeTooltip(header=header, body=body),
      'enabled': isEnabled}
Esempio n. 24
0
 def __getFightBtnTooltipData(self, state):
     falloutCtrl = getFalloutCtrl()
     config = falloutCtrl.getConfig()
     if state == PREBATTLE_RESTRICTION.VEHICLE_FALLOUT_ONLY:
         header = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutOnly/header')
         body = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutOnly/body')
     elif state == PREBATTLE_RESTRICTION.FALLOUT_NOT_SELECTED:
         header = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutNotSelected/header')
         body = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutNotSelected/body')
     elif state == PREBATTLE_RESTRICTION.VEHICLE_GROUP_IS_NOT_READY:
         header = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutNotReady/header')
         body = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutNotReady/body')
     elif state == UNIT_RESTRICTION.FALLOUT_NOT_ENOUGH_PLAYERS:
         header = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutNotEnoughPlayer/header')
         body = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutNotEnoughPlayer/body')
     elif state in (UNIT_RESTRICTION.FALLOUT_VEHICLE_LEVEL_REQUIRED, PREBATTLE_RESTRICTION.VEHICLE_GROUP_REQUIRED):
         header = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutVehLevelRequired/header')
         body = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutVehLevelRequired/body', level=int2roman(config.vehicleLevelRequired))
     elif state in (UNIT_RESTRICTION.FALLOUT_VEHICLE_MIN, PREBATTLE_RESTRICTION.VEHICLE_GROUP_MIN):
         allowedLevelsList = list(config.allowedLevels)
         if len(allowedLevelsList) > 1:
             header = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutVehMin/header')
             body = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutVehMin/body', min=str(config.minVehiclesPerPlayer), level=toRomanRangeString(allowedLevelsList, 1))
         else:
             header = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutVehLevelRequired/header')
             body = i18n.makeString('#menu:headerButtons/fightBtn/tooltip/falloutVehLevelRequired/body', level=int2roman(config.vehicleLevelRequired))
     else:
         return None
     return {makeTooltip(header, body)}
Esempio n. 25
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
 def __getNotEnoughMembersText(self, data):
     minClanSize = data.get('minClanSize', 0)
     text = text_styles.alert(i18n.makeString(FORTIFICATIONS.FORTWELCOMEVIEW_WARNING, minClanSize=minClanSize))
     header = i18n.makeString(TOOLTIPS.FORTIFICATION_WELCOME_CANTCREATEFORT_HEADER)
     body = i18n.makeString(TOOLTIPS.FORTIFICATION_WELCOME_CANTCREATEFORT_BODY, minClanSize=minClanSize)
     tooltip = makeTooltip(header, body)
     return (text, tooltip)
Esempio n. 27
0
 def _getUseBtnTooltip(self, order, buildingDescr, isDisabled):
     hasBuilding = order.hasBuilding
     buildingID = self.getBuildingUIDbyID(order.buildingID)
     buildingStr = i18n.makeString(FORTIFICATIONS.buildings_buildingname(buildingID))
     body = None
     note = None
     if not isDisabled:
         header = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_HEADER
         body = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_DESCRIPTION
     else:
         header = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_CANTUSE_HEADER
         fort = self.fortCtrl.getFort()
         if not order.isSupported:
             body = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_NOTAVAILABLE
         elif not hasBuilding:
             body = i18n.makeString(TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_NOBUILDING, building=buildingStr)
         elif order.inCooldown:
             body = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_WASUSED
         elif not order.isCompatible and fort.hasActivatedContinualOrders():
             body = TOOLTIPS.FORTIFICATION_ORDERSPANEL_CANTUSEORDER
         elif order.isPermanent and not fort.isDefenceHourEnabled():
             body = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_DEFENCEHOURDISABLED
         elif order.count < 1:
             body = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_NOORDERS
         elif self._isBuildingDamaged(buildingDescr) or self._isBaseBuildingDamaged() or self._isFortFrozen():
             body = TOOLTIPS.FORTIFICATION_ORDERPOPOVER_USEORDERBTN_CANTUSE_BODY
     return makeTooltip(header, body, note)
 def updateHeader(self):
     playersCount = len(g_clanCache.clanMembers)
     openedDirections = len(self.fortCtrl.getFort().getOpenedDirections())
     requiredPlayersCount = self.fortCtrl.getLimits().getDirectionsMembersRequirements().get(openedDirections + 1, 0)
     isAllDirctnsOpened = openedDirections == g_fortCache.maxDirections
     canOpenDirections = False
     ttHeader = ''
     ttDescr = ''
     if isAllDirctnsOpened:
         description = i18n.makeString(FORTIFICATIONS.FORTDIRECTIONSWINDOW_DESCR_COMPLETED)
     elif self._isFortFrozen():
         baseName = makeHtmlString('html_templates:lobby/fortifications', 'baseFrozen', {'baseName': i18n.makeString(FORTIFICATIONS.BUILDINGS_BUILDINGNAME_BASE_BUILDING) + '.'})
         description = i18n.makeString(FORTIFICATIONS.FORTDIRECTIONSWINDOW_DESCR_BASEREPAIRREQUIRE, baseName=baseName)
         ttHeader = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTCREATEDIRWIN_NEWDIRBTN_DISABLEDBYFROZEN_HEADER)
         ttDescr = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTCREATEDIRWIN_NEWDIRBTN_DISABLEDBYFROZEN_BODY)
     else:
         if playersCount >= requiredPlayersCount:
             template = 'valid'
             canOpenDirections = True
             ttHeader = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTCREATEDIRWIN_NEWDIRBTN_ENABLED_HEADER)
             ttDescr = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTCREATEDIRWIN_NEWDIRBTN_ENABLED_BODY)
         else:
             template = 'notValid'
             ttHeader = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTCREATEDIRWIN_NEWDIRBTN_DISABLEDBYPLAYERS_HEADER)
             ttDescr = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTCREATEDIRWIN_NEWDIRBTN_DISABLEDBYPLAYERS_BODY, count=requiredPlayersCount)
         playersLabel = makeHtmlString('html_templates:lobby/fortifications/playersCount', template, {'count': requiredPlayersCount})
         description = i18n.makeString(FORTIFICATIONS.FORTDIRECTIONSWINDOW_DESCR_REQUIREMENTS, count=playersLabel)
     self.as_setDescriptionS(description)
     tooltip = makeTooltip(ttHeader, ttDescr)
     self.as_setupButtonS(canOpenDirections, not isAllDirctnsOpened, tooltip)
Esempio n. 29
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
Esempio n. 30
0
 def _updateCurrentServerInfo(self):
     from ConnectionManager import connectionManager
     if connectionManager.serverUserName:
         tooltipBody = i18n.makeString('#tooltips:header/info/players_online_full/body')
         tooltipFullData = makeTooltip('#tooltips:header/info/players_online_full/header', tooltipBody % {'servername': connectionManager.serverUserName})
         self.as_setServerStatsInfoS(tooltipFullData)
     self.__onStatsReceived(game_control.g_instance.serverStats.getStats())
Esempio n. 31
0
 def __setBlockedByXPToTman(self):
     self.xpValue = ''
     if self.__battleResults.getVehicleForArena(self.__arenaUniqueID).isXPToTman:
         textKey = R.strings.battle_results.common.premiumBonus.isXPToTmenEnabled()
     else:
         textKey = R.strings.battle_results.common.premiumBonus.isXPToTmenDisabled()
     self.statusBonusLabel = text_styles.neutral(backport.text(textKey))
     self.statusBonusTooltip = makeTooltip(body=TOOLTIPS.BATTLERESULTS_PREMIUMBONUS_XPTOTMENCHANGED_BODY)
Esempio n. 32
0
 def __getButtonData(self):
     if self.fortState.getStateID() == CLIENT_FORT_STATE.HAS_FORT:
         fort = self.fortCtrl.getFort()
         if not fort.isDefenceHourEnabled():
             if self.fortCtrl.getPermissions().canChangeDefHour():
                 fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_LEADER
             else:
                 fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_NOTLEADER
             additionalText = i18n.makeString(
                 FORTIFICATIONS.
                 SORTIE_INTROVIEW_FORTBATTLES_NOTACTIVATEDDEFENCETIME)
             return (False, makeTooltip(None, fortBattleBtnTooltip),
                     additionalText)
         attacksInOneDay = fort.getAttacksIn(timePeriod=time_utils.ONE_DAY)
         defencesInOneDay = fort.getDefencesIn(
             timePeriod=time_utils.ONE_DAY)
         if attacksInOneDay or defencesInOneDay:
             return (True,
                     TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_ENABLED,
                     None)
         battlesInTwoWeeks = fort.getAttacksAndDefencesIn(
             timePeriod=2 * time_utils.ONE_WEEK)
         if battlesInTwoWeeks:
             closestBattle = battlesInTwoWeeks[0]
             battleDate = BigWorld.wg_getLongDateFormat(
                 closestBattle.getStartTime())
             additionalText = i18n.makeString(
                 FORTIFICATIONS.
                 SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLE,
                 nextDate=battleDate)
             fortBattleBtnTooltip = i18n.makeString(
                 TOOLTIPS.
                 FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_NEXTBATTLE,
                 currentDate=battleDate)
             return (False, makeTooltip(None, fortBattleBtnTooltip),
                     additionalText)
         if self.fortCtrl.getPermissions().canPlanAttack():
             fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_LEADERNOACTION
         else:
             fortBattleBtnTooltip = TOOLTIPS.FORTIFICATION_INTROVIEW_CLANBATTLEBTN_DISABLED_NOTLEADERNOACTION
         additionalText = i18n.makeString(
             FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NOTACTIVATED)
         return (False, makeTooltip(None,
                                    fortBattleBtnTooltip), additionalText)
     else:
         return (False, '', None)
Esempio n. 33
0
def getLevelInvalidTooltip(teamLimits, restriction):
    minLevel, maxLevel = getLevelLimits(teamLimits)
    return makeTooltip(
        i18n.makeString(
            '#tooltips:redButton/disabled/{0:>s}/header'.format(restriction)),
        i18n.makeString(
            '#tooltips:redButton/disabled/{0:>s}/body'.format(restriction),
            minLevel, maxLevel))
def getCompletetBonusLimitTooltip():
    return {
        'tooltip':
        makeTooltip(body=_ms(TOOLTIPS.QUESTS_COMPLETE_PROGRESS_STATUSTOOLTIP)),
        'isSpecial':
        False,
        'specialArgs': []
    }
Esempio n. 35
0
    def __createFilterToggles(self):
        filterToggles = []
        for entry in VEHICLE_TYPES_ORDER:
            filterToggles.append({'value': self.__getAssetPath(entry),
             'tooltip': makeTooltip('#menu:carousel_tank_filter/{}'.format(entry), '#tank_carousel_filter:tooltip/vehicleTypes/body'),
             'selected': False})

        return filterToggles
Esempio n. 36
0
 def _getStatusTooltip(self):
     leaderboard = self._leaderboard
     recalculationInterval = leaderboard.getRecalculationInterval()
     if recalculationInterval is None:
         recalculationInterval = 0
     interval = int(recalculationInterval / ONE_MINUTE)
     return makeTooltip(
         body=_ms(TOOLTIPS.SUMMARY_STATUS_TOOLTIP, interval=interval))
Esempio n. 37
0
def getTotalLevelInvalidTooltip(teamsLimit, restriction):
    minLevel, maxLevel = prb_getters.getTotalLevelLimits(teamsLimit)
    return makeTooltip(
        i18n.makeString(
            '#tooltips:redButton/disabled/{0:>s}/header'.format(restriction)),
        i18n.makeString(
            '#tooltips:redButton/disabled/{0:>s}/body'.format(restriction),
            minLevel, maxLevel))
Esempio n. 38
0
 def __setTotalData(self, *args):
     priceGold = self.__controller.cart.totalPriceGold
     priceCredits = self.__controller.cart.totalPriceCredits
     notEnoughGoldTooltip = notEnoughCreditsTooltip = ''
     enoughGold = g_itemsCache.items.stats.gold >= priceGold
     enoughCredits = g_itemsCache.items.stats.credits >= priceCredits
     canBuy = bool(priceGold
                   or priceCredits) and enoughGold and enoughCredits
     if not enoughGold:
         diff = text_styles.gold(priceGold - 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(priceCredits -
                                    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_setTotalDataS({
         'credits':
         formatPriceCredits(priceCredits),
         'gold':
         formatPriceGold(priceGold),
         'totalLabel':
         text_styles.highTitle(
             _ms(VEHICLE_CUSTOMIZATION.WINDOW_PURCHASE_TOTALCOST,
                 selected=len(self.__searchDP.selectedItems),
                 total=len(self.__searchDP.items))),
         'buyEnabled':
         canBuy,
         'enoughGold':
         enoughGold,
         'enoughCredits':
         enoughCredits,
         'notEnoughGoldTooltip':
         notEnoughGoldTooltip,
         'notEnoughCreditsTooltip':
         notEnoughCreditsTooltip
     })
 def _getContentFields(self, vehicle):
     slotCheckboxTooltip = None
     if self.itemsCache.items.inventory.getFreeSlots(self.itemsCache.items.stats.vehicleSlots) <= 0:
         slotCheckboxTooltip = makeTooltip(TOOLTIPS.CONTENTBUYVIEW_SLOTCHECKBOX_NOTENOUGHSLOTS_HEADER, TOOLTIPS.CONTENTBUYVIEW_SLOTCHECKBOX_NOTENOUGHSLOTS_BODY)
     return {'slotCheckboxTooltip': slotCheckboxTooltip,
      'priceLabel': i18n.makeString(DIALOGS.BUYVEHICLEWINDOW_PRICELABEL, vehiclename=vehicle.shortUserName),
      'crewCheckbox': i18n.makeString(DIALOGS.BUYVEHICLEWINDOW_TANKMENCHECKBOX),
      'warningMsg': i18n.makeString(DIALOGS.BUYVEHICLEWINDOW_WARNING) if constants.IS_KOREA else None}
Esempio n. 40
0
 def _getTitleMakeTooltip(self, tooltipBody, addInfo):
     label = backport.text(self._data.label)
     return makeTooltip(header=backport.text(
         R.strings.marathon.vehiclePreview.title.tooltip.header(),
         event_name=label),
                        body=backport.text(tooltipBody,
                                           event_name=label,
                                           addInfo=addInfo))
Esempio n. 41
0
 def _createTooltip(self):
     return makeTooltip(
         backport.text(
             R.strings.platoon.headerButton.tooltips.dyn(
                 self._data).header()),
         backport.text(
             R.strings.platoon.headerButton.tooltips.dyn(
                 self._data).body()))
Esempio n. 42
0
 def atReturn(self, cd):
     original_return_value = cd.returned
     original_return_value['inviteBtnTooltip'] = makeTooltip(
         None, None, None,
         self.__config.get('sandbox_platform_message',
                           MINICLIENT.ACCOUNTPOPOVER_WARNING))
     original_return_value['inviteBtnEnabled'] = False
     return original_return_value
Esempio n. 43
0
def makeVehicleVO(vehicle,
                  levelsRange=None,
                  vehicleTypes=None,
                  isCurrentPlayer=True):
    if vehicle is None:
        return
    vState, vStateLvl = vehicle.getState(isCurrentPlayer)
    if vState == Vehicle.VEHICLE_STATE.UNDAMAGED or vState == Vehicle.VEHICLE_STATE.IN_PREBATTLE or vState in Vehicle.GROUP_STATES:
        vStateStr = ''
        isReadyToFight = True
    else:
        isReadyToFight = vehicle.isReadyToFight
        if vState == Vehicle.VEHICLE_STATE.IN_PREMIUM_IGR_ONLY:
            vStateStr = makeHtmlString('html_templates:lobby',
                                       'inPremiumIgrOnly')
        else:
            vStateStr = i18n.makeString('#menu:tankCarousel/vehicleStates/%s' %
                                        vState)
    enabled, tooltip = True, None
    if not isReadyToFight:
        enabled, tooltip = False, makeTooltip(
            '#tooltips:vehicleStatus/%s/header' % vState,
            '#tooltips:vehicleStatus/body')
    elif levelsRange is not None and vehicle.level not in levelsRange:
        enabled, tooltip = False, TOOLTIPS.VEHICLESELECTOR_OVERFLOWLEVEL
    elif vehicleTypes is not None and vehicle.type not in vehicleTypes:
        enabled, tooltip = False, TOOLTIPS.VEHICLESELECTOR_INCOMPATIBLETYPE
    return {
        'intCD':
        vehicle.intCD,
        'nationID':
        vehicle.nationID,
        'name':
        vehicle.name,
        'userName':
        vehicle.userName,
        'shortUserName':
        vehicle.shortUserName,
        'level':
        vehicle.level,
        'type':
        vehicle.type,
        'typeIndex':
        VEHICLE_TABLE_TYPES_ORDER_INDICES[vehicle.type],
        'smallIconPath':
        '../maps/icons/vehicle/small/{0}.png'.format(
            vehicle.name.replace(':', '-')),
        'isReadyToFight':
        isReadyToFight,
        'enabled':
        enabled,
        'tooltip':
        tooltip,
        'state':
        vStateStr,
        'isFalloutVehicle':
        vehicle.isFalloutSelected
    }
Esempio n. 44
0
 def _initializeFilters(self):
     xpRate = 'x%d' % g_itemsCache.items.shop.dailyXPFactor
     falloutBattleType = i18n.makeString(
         '#menu:headerButtons/battle/menu/fallout/{0}'.format(
             getFalloutCtrl().getBattleType()))
     self.as_initCarouselFilterS({
         'counterCloseTooltip':
         makeTooltip(TOOLTIPS.TANKSFILTER_COUNTER_CLOSE_HEADER,
                     TOOLTIPS.TANKSFILTER_COUNTER_CLOSE_BODY),
         'paramsFilter': {
             'icon':
             getButtonsAssetPath('params'),
             'tooltip':
             makeTooltip('#tank_carousel_filter:filter/paramsFilter/header',
                         '#tank_carousel_filter:filter/paramsFilter/body')
         },
         'favoriteFilter': {
             'icon':
             getButtonsAssetPath('favorite'),
             'tooltip':
             makeTooltip(
                 '#tank_carousel_filter:filter/favoriteFilter/header',
                 '#tank_carousel_filter:filter/favoriteFilter/body')
         },
         'gameModeFilter': {
             'icon':
             getButtonsAssetPath('game_mode'),
             'tooltip':
             makeTooltip(
                 '#tank_carousel_filter:filter/gameModeFilter/header',
                 i18n.makeString(
                     '#tank_carousel_filter:filter/gameModeFilter/body',
                     type=falloutBattleType))
         },
         'bonusFilter': {
             'icon':
             getButtonsAssetPath('bonus_%s' % xpRate),
             'tooltip':
             makeTooltip(
                 '#tank_carousel_filter:filter/bonusFilter/header',
                 i18n.makeString(
                     '#tank_carousel_filter:filter/bonusFilter/body',
                     bonus=xpRate))
         }
     })
Esempio n. 45
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
 def _packBonuses(self):
     result = []
     bonusFactor = self._eventsCache.getSquadXPFactor() * 100
     result.append(self._makeBonus(bonusFactor, 'experience'))
     if result:
         bonusFormatted = text_styles.neutral('{}{}'.format(bonusFactor, backport.text(R.strings.common.common.percent())))
         result[-1]['tooltip'] = makeTooltip(header=backport.text(R.strings.tooltips.squadBonus.complex.header()), body=backport.text(R.strings.tooltips.squadBonus.complex.body(), bonus=bonusFormatted))
         result[-1]['tooltipType'] = TOOLTIPS_CONSTANTS.COMPLEX
     return result
Esempio n. 47
0
 def getSlotTooltipBody(self, orderID):
     header = i18n.makeString(
         FORTIFICATIONS.orders_orderpopover_ordertype(orderID))
     note = None
     fort = self.fortCtrl.getFort()
     order = fort.getOrder(self.getOrderIDbyUID(orderID))
     buildingDescr = fort.getBuilding(order.buildingID)
     if order.hasBuilding:
         description = ''
         ordersListStr = i18n.makeString(
             TOOLTIPS.FORTIFICATION_ORDERPOPOVER_CLANPERMISSIONS)
         if order.inCooldown:
             description = self._getCooldownInfo(order)
         elif order.count > 0:
             if self._isProductionInPause(buildingDescr):
                 description = i18n.makeString(
                     TOOLTIPS.FORTIFICATION_ORDERSPANEL_CANTUSEORDER)
                 description += '\n' + i18n.makeString(
                     TOOLTIPS.FORTIFICATION_ORDERPROCESS_INFO)
             elif not order.isPermanent and not order.isCompatible and fort.hasActivatedContinualOrders(
             ):
                 description = i18n.makeString(
                     TOOLTIPS.FORTIFICATION_ORDERSPANEL_CANTUSEORDER)
             else:
                 description = i18n.makeString(
                     TOOLTIPS.FORTIFICATION_ORDERPOPOVER_ORDERISREADY)
             if not self._canGiveOrder():
                 description += '\n' + ordersListStr
         else:
             if not order.inProgress:
                 description = i18n.makeString(
                     TOOLTIPS.FORTIFICATION_ORDERPOPOVER_CREATEORDER)
             if not self._canGiveOrder():
                 description = i18n.makeString(
                     TOOLTIPS.
                     FORTIFICATION_ORDERPOPOVER_USEORDERBTN_NOORDERS)
                 description += '\n' + ordersListStr
         if order.inProgress:
             if self._isProductionInPause(buildingDescr):
                 pauseText = i18n.makeString(
                     TOOLTIPS.FORTIFICATION_ORDERPROCESS_INPAUSE)
                 if len(description) > 0:
                     description += '\n' + pauseText
                 else:
                     description = pauseText
                 description += '\n' + i18n.makeString(
                     TOOLTIPS.FORTIFICATION_ORDERPROCESS_INFO)
             else:
                 description = self._getProgressInfo(description, order)
     else:
         buildingStr = i18n.makeString(
             FORTIFICATIONS.buildings_buildingname(
                 self.getBuildingUIDbyID(order.buildingID)))
         description = i18n.makeString(
             FORTIFICATIONS.ORDERS_ORDERPOPOVER_ORDERNOTREADY,
             building=buildingStr)
     return makeTooltip(header, description, note)
Esempio n. 48
0
 def atCall(self, cd):
     tooltip = makeTooltip(None, None, None,
                           MINICLIENT.AMMUNITION_PANEL_WARN_TOOLTIP)
     if g_currentVehicle.isPresent() and not self.__vehicle_is_available(
             g_currentVehicle.item):
         cd.change()
         return ((False, tooltip, False, tooltip), cd.kwargs)
     else:
         return
Esempio n. 49
0
 def __updateState(self):
     state = g_currentVehicle.getViewState()
     self.as_setCrewEnabledS(state.isCrewOpsEnabled())
     self.__updateCarouselEnabled()
     if state.isOnlyForEventBattles():
         customizationTooltip = makeTooltip(
             _ms(TOOLTIPS.HANGAR_TUNING_DISABLEDFOREVENTVEHICLE_HEADER),
             _ms(TOOLTIPS.HANGAR_TUNING_DISABLEDFOREVENTVEHICLE_BODY))
     else:
         customizationTooltip = makeTooltip(
             _ms(TOOLTIPS.HANGAR_TUNING_HEADER),
             _ms(TOOLTIPS.HANGAR_TUNING_BODY))
     self.as_setupAmmunitionPanelS(
         state.isMaintenanceEnabled(),
         makeTooltip(_ms(TOOLTIPS.HANGAR_MAINTENANCE_HEADER),
                     _ms(TOOLTIPS.HANGAR_MAINTENANCE_BODY)),
         state.isCustomizationEnabled(), customizationTooltip)
     self.as_setControlsVisibleS(state.isUIShown())
Esempio n. 50
0
def getVehicleClassInvalidTooltip(teamsLimit, restriction):
    classTag = PREBATTLE_RESTRICTION.getVehClassRestrictions().get(restriction)
    minLevel, maxLevel = prb_getters.getClassLevelLimits(teamsLimit, classTag)
    return makeTooltip(
        i18n.makeString(
            '#tooltips:redButton/disabled/{0:>s}/header'.format(restriction)),
        i18n.makeString(
            '#tooltips:redButton/disabled/{0:>s}/body'.format(restriction),
            minLevel, maxLevel))
Esempio n. 51
0
def _getSeasonOnMain(isMastered):
    mainMenuLinkage = RANKEDBATTLES_ALIASES.RANKED_BATTLES_DIVISIONS_VIEW_UI
    if isMastered:
        mainMenuLinkage = RANKEDBATTLES_ALIASES.RANKED_BATTLES_LEAGUES_VIEW_UI
    return {'id': RANKEDBATTLES_CONSTS.RANKED_BATTLES_RANKS_ID,
     'viewId': mainMenuLinkage,
     'linkage': mainMenuLinkage,
     'background': backport.image(R.images.gui.maps.icons.rankedBattles.bg.main()),
     'tooltip': makeTooltip(header=backport.text(R.strings.tooltips.rankedBattlesView.ranks.header()), body=backport.text(R.strings.tooltips.rankedBattlesView.ranks.body()))}
Esempio n. 52
0
def makeParameterTooltipVO(method, amount, parameter):
    parametersWithTooltip = [_op.ORIGINALXP, _op.XP]
    maxOrSum = 'max' if method == _cm.MAX else 'sum'
    if parameter in parametersWithTooltip and amount is not None:
        return makeTooltip(body=_ms(EVENT_BOARDS.tooltip_top_description_all(
            maxOrSum, parameter),
                                    number=amount))
    else:
        return
 def getSlotTooltipBody(self, orderID):
     if orderID == ORDER_TYPES.EMPTY_ORDER:
         return makeTooltip(
             i18n.makeString(
                 FORTIFICATIONS.orders_orderpopover_ordertype(orderID)),
             i18n.makeString(
                 TOOLTIPS.FORTORDERSPANELCOMPONENT_EMPTYSLOT_BODY), None)
     else:
         return ''
Esempio n. 54
0
 def __setHeaderInitData(self):
     isElite = g_currentVehicle.item.isElite
     vTypeId = g_currentVehicle.item.type
     vTypeId = '{0}_elite'.format(vTypeId) if isElite else vTypeId
     self.as_setHeaderDataS({'titleText': text_styles.promoTitle(VEHICLE_CUSTOMIZATION.CUSTOMIZATIONHEADER_TITLE),
      'tankName': text_styles.promoSubTitle(g_currentVehicle.item.userName),
      'tankType': vTypeId,
      'isElite': isElite,
      'closeBtnTooltip': makeTooltip(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_HEADERCLOSEBTN_HEADER, VEHICLE_CUSTOMIZATION.CUSTOMIZATION_HEADERCLOSEBTN_BODY)})
    def _getToolTip(cls, bonus):
        tooltipData = []
        for group in bonus.getTankmenGroups().itervalues():
            tooltipData.append(
                createTooltipData(
                    makeTooltip(TOOLTIPS.getAwardHeader(bonus.getName()),
                                cls._getLabel(group))))

        return tooltipData
Esempio n. 56
0
 def __getTooltip(self, bonus):
     chapter = bonus.getChapter()
     style = getStyleForChapter(chapter)
     tooltip = ''
     if style is None:
         body = backport.text(
             R.strings.battle_pass.styleProgressBonus.notChosen.tooltip())
         tooltip = makeTooltip(body=body)
     return tooltip
 def __updateSearchInput(self):
     searchInputTooltip = makeTooltip(
         TANK_CAROUSEL_FILTER.TOOLTIP_SEARCHINPUT_HEADER,
         _ms(TANK_CAROUSEL_FILTER.TOOLTIP_SEARCHINPUT_BODY,
             count=_SEARCH_INPUT_MAX_CHARS))
     searchInputLabel = _ms(
         TANK_CAROUSEL_FILTER.POPOVER_LABEL_SEARCHNAMEVEHICLE)
     self.as_updateSearchS(searchInputLabel, '', searchInputTooltip,
                           _SEARCH_INPUT_MAX_CHARS)
Esempio n. 58
0
 def getTooltip(self):
     """ Get award's tooltip for award carousel.
     """
     header = i18n.makeString(TOOLTIPS.getAwardHeader(self._name))
     body = i18n.makeString(TOOLTIPS.getAwardBody(self._name))
     if header or body:
         return makeTooltip(header or None, body or None)
     else:
         return ''
Esempio n. 59
0
    def __getItemTabsData(self):
        data = []
        for tabIdx in self.__getVisibleTabs():
            data.append({'label': g_config.i18n['UI_flash_tabs_%s_label' % tabIdx],
                         'tooltip': makeTooltip(g_config.i18n['UI_flashCol_tabs_%s_text' % tabIdx],
                                                g_config.i18n['UI_flashCol_tabs_%s_tooltip' % tabIdx]),
                         'id': tabIdx})

        return data
Esempio n. 60
0
def _getRewardsPage(isSeasonOff=False):
    viewID = RANKEDBATTLES_ALIASES.RANKED_BATTLES_REWARDS_UI
    if isSeasonOff:
        viewID = RANKEDBATTLES_ALIASES.RANKED_BATTLES_REWARDS_SEASON_OFF_ALIAS
    return {'id': RANKEDBATTLES_CONSTS.RANKED_BATTLES_REWARDS_ID,
     'viewId': viewID,
     'linkage': RANKEDBATTLES_ALIASES.RANKED_BATTLES_REWARDS_UI,
     'background': backport.image(R.images.gui.maps.icons.rankedBattles.bg.main()),
     'tooltip': makeTooltip(header=backport.text(R.strings.tooltips.rankedBattlesView.rewards.header()), body=backport.text(R.strings.tooltips.rankedBattlesView.rewards.body()))}