コード例 #1
0
 def __makeDefencePeriodData(self):
     alertMessage = ''
     blockBtnEnabled = True
     fort = self.fortCtrl.getFort()
     inProcess, inCooldown = fort.getDefenceHourProcessing()
     if self._isFortFrozen():
         conditionPostfix = text_styles.standard(fort.getDefencePeriodStr())
     else:
         conditionPostfix = text_styles.neutral(fort.getDefencePeriodStr())
     blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEBTNENABLED
     descriptionTooltip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEPERIODDESCRIPTION
     if inProcess:
         defenceHourChangeDay, nextDefenceHour, _ = fort.events[FORT_EVENT_TYPE.DEFENCE_HOUR_CHANGE]
         timestampStart = time_utils.getTimeTodayForUTC(nextDefenceHour)
         value = '%s - %s' % (BigWorld.wg_getShortTimeFormat(timestampStart), BigWorld.wg_getShortTimeFormat(timestampStart + time_utils.ONE_HOUR))
         msgString = i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_INPROGRESS, value=value, date=BigWorld.wg_getShortDateFormat(defenceHourChangeDay))
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEBTNDISABLED
     elif inCooldown:
         msgString = i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_RECENTLYSCHEDULED)
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEBTNDISABLED
     conditionPrefix = text_styles.main(i18n.makeString(FORTIFICATIONS.settingswindow_blockcondition('defencePeriodTime')))
     blockDescr = text_styles.standard(i18n.makeString(FORTIFICATIONS.settingswindow_blockdescr('defencePeriodTime')))
     if alertMessage:
         alertMessage = icons.alert() + ' ' + alertMessage
     return {'blockBtnEnabled': blockBtnEnabled,
      'blockDescr': blockDescr,
      'blockCondition': conditionPrefix + ' ' + conditionPostfix,
      'alertMessage': alertMessage,
      'blockBtnToolTip': blockBtnToolTip,
      'descriptionTooltip': descriptionTooltip}
コード例 #2
0
ファイル: tabs__init__.py プロジェクト: Difrex/wotsdk
 def __getItemRestoreInfo(self, item):
     """
     Get formatted vehicle restore info
     :param item: <Vehicle>
     :return: <str>
     """
     if item.isRestorePossible():
         if constants.IS_CHINA and item.rentalIsActive:
             return text_styles.alert(
                 MENU.VEHICLE_RESTORELEFT_DISABLEDBYRENT)
         if item.hasLimitedRestore():
             restoreLeftTime = item.restoreInfo.getRestoreTimeLeft()
             timeKey, formattedTime = getTimeLeftInfo(restoreLeftTime)
             msg = i18n.makeString('#menu:vehicle/restoreLeft/%s' % timeKey,
                                   time=formattedTime)
             if restoreLeftTime < time_utils.ONE_DAY:
                 return icons.alert() + text_styles.alert(msg)
             return text_styles.stats(msg)
         if item.hasRestoreCooldown():
             timeKey, formattedTime = getTimeLeftInfo(
                 item.restoreInfo.getRestoreCooldownTimeLeft())
             msg = i18n.makeString('#menu:vehicle/restoreCooldownLeft/%s' %
                                   timeKey,
                                   time=formattedTime)
             return text_styles.stats(msg)
     return ''
コード例 #3
0
 def __packDescBlock():
     blocks = [
         formatters.packImageTextBlockData(title=text_styles.middleTitle(
             VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESCHEADER)),
         formatters.packImageTextBlockData(title=text_styles.main(
             _ms(VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC1,
                 influence=text_styles.alert(
                     VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC1_INFLUENCE))),
                                           img=RES_ICONS.
                                           MAPS_ICONS_LIBRARY_COUNTER_1,
                                           imgPadding={'top': 3},
                                           txtOffset=35),
         formatters.packImageTextBlockData(
             title=text_styles.main(
                 _ms(VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC2,
                     perc=text_styles.alert(
                         VEH_COMPARE.VEHCONF_TOOLTIPS_SKILLS_DESC2_PERC))),
             img=RES_ICONS.MAPS_ICONS_LIBRARY_COUNTER_2,
             imgPadding={'top': 3},
             txtOffset=35)
     ]
     return formatters.packBuildUpBlockData(
         blocks,
         linkage=BLOCKS_TOOLTIP_TYPES.
         TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE,
         gap=15)
コード例 #4
0
 def __makeDefencePeriodData(self):
     alertMessage = ''
     blockBtnEnabled = True
     fort = self.fortCtrl.getFort()
     inProcess, inCooldown = fort.getDefenceHourProcessing()
     if self._isFortFrozen():
         conditionPostfix = text_styles.standard(fort.getDefencePeriodStr())
     else:
         conditionPostfix = text_styles.neutral(fort.getDefencePeriodStr())
     blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEBTNENABLED
     descriptionTooltip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEPERIODDESCRIPTION
     if inProcess:
         defenceHourChangeDay, nextDefenceHour, _ = fort.events[FORT_EVENT_TYPE.DEFENCE_HOUR_CHANGE]
         timestampStart = time_utils.getTimeTodayForUTC(nextDefenceHour)
         value = '%s - %s' % (BigWorld.wg_getShortTimeFormat(timestampStart), BigWorld.wg_getShortTimeFormat(timestampStart + time_utils.ONE_HOUR))
         msgString = i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_INPROGRESS, value=value, date=BigWorld.wg_getShortDateFormat(defenceHourChangeDay))
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEBTNDISABLED
     elif inCooldown:
         msgString = i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_RECENTLYSCHEDULED)
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DEFENCEBTNDISABLED
     conditionPrefix = text_styles.main(i18n.makeString(FORTIFICATIONS.settingswindow_blockcondition('defencePeriodTime')))
     blockDescr = text_styles.standard(i18n.makeString(FORTIFICATIONS.settingswindow_blockdescr('defencePeriodTime')))
     if alertMessage:
         alertMessage = icons.alert() + ' ' + alertMessage
     return {'blockBtnEnabled': blockBtnEnabled,
      'blockDescr': blockDescr,
      'blockCondition': conditionPrefix + ' ' + conditionPostfix,
      'alertMessage': alertMessage,
      'blockBtnToolTip': blockBtnToolTip,
      'descriptionTooltip': descriptionTooltip}
コード例 #5
0
def makeBuildingIndicatorsVO(buildingLevel, progress, hpVal, hpTotalVal, defResVal, maxDefResVal):
    FORMAT_PATTERN = '###'
    if progress == FORT_ALIAS.STATE_FOUNDATION_DEF or progress == FORT_ALIAS.STATE_FOUNDATION:
        hpValueFormatter = text_styles.alert(FORMAT_PATTERN)
    else:
        hpValueFormatter = text_styles.defRes(FORMAT_PATTERN)
    hpTotalFormatted = str(BigWorld.wg_getIntegralFormat(hpTotalVal)) + ' '
    formattedHpTotal = ''.join((text_styles.standard(hpTotalFormatted), icons.nut()))
    defResValueFormatter = text_styles.alert(FORMAT_PATTERN) if defResVal > maxDefResVal else text_styles.defRes(FORMAT_PATTERN)
    maxDefDerFormatted = str(BigWorld.wg_getIntegralFormat(maxDefResVal)) + ' '
    formattedDefResTotal = ''.join((text_styles.standard(maxDefDerFormatted), icons.nut()))
    hpProgressLabels = {'currentValue': str(BigWorld.wg_getIntegralFormat(hpVal)),
     'currentValueFormatter': hpValueFormatter,
     'totalValue': formattedHpTotal,
     'separator': '/'}
    storeProgressLabels = {'currentValue': str(BigWorld.wg_getIntegralFormat(defResVal)),
     'currentValueFormatter': defResValueFormatter,
     'totalValue': formattedDefResTotal,
     'separator': '/'}
    result = {'hpLabel': i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_HPLBL),
     'defResLabel': i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_DEFRESLBL),
     'hpCurrentValue': hpVal,
     'hpTotalValue': hpTotalVal,
     'defResCurrentValue': defResVal,
     'defResCompensationValue': max(0, defResVal - maxDefResVal),
     'defResTotalValue': maxDefResVal,
     'hpProgressLabels': hpProgressLabels,
     'defResProgressLabels': storeProgressLabels}
    return result
コード例 #6
0
 def getServerData(self):
     event = self._event
     finished = event.isFinished()
     peripheryID = str(self._connectionMgr.peripheryID)
     primeTimes = event.getPrimeTimes().getPrimeTimes()
     availableServers = event.getAvailableServers()
     isAvailableServer = event.isAvailableServer(peripheryID)
     isAvailableAnyServer = any(availableServers)
     title = formatAllertTextWithIcon(text_styles.alert(EVENT_BOARDS.SERVER_LIST))
     result = {}
     if not finished and not self._canJoin and _psr.SPECIALACCOUNT in self._stateReasons:
         result = {'reloginBlock': {'title': formatAllertTextWithIcon(text_styles.alert(EVENT_BOARDS.STATUS_CANTJOIN_REASON_SPECIAL)),
                           'description': ''},
          'isRelogin': True}
         return result
     if finished or event.getPrimeTimes().isEmpty():
         return result
     availableServers = sorted(availableServers, key=lambda p: int(p.getServer()))
     if not isAvailableServer and isAvailableAnyServer and self._playerState.getPlayerState() == _es.JOINED:
         buttons = [ {'label': str(self._lobbyContext.getPeripheryName(int(pt.getServer()), False)),
          'server': pt.getServer(),
          'tooltip': makeTooltip(self._lobbyContext.getPeripheryName(int(pt.getServer()), False), TOOLTIPS.ELEN_BUTTON_SERVER_BODY)} for pt in availableServers ]
         result = {'serverBlock': {'title': title,
                          'buttons': buttons},
          'isUnsuitableServer': True}
     elif not isAvailableServer and self._playerState.getPlayerState() == _es.JOINED:
         primeTime = min(primeTimes, key=lambda pt: pt.timeToActive())
         server = str(self._lobbyContext.getPeripheryName(int(primeTime.getServer()), False))
         nonSuitableServer = text_styles.neutral(_ms(EVENT_BOARDS.SERVER_NOSUITABLE_SERVER, time=primeTime.getStartLocalTime(), server=server))
         description = text_styles.main(_ms(EVENT_BOARDS.SERVER_NOSUITABLE_BODY, data=nonSuitableServer))
         result = {'reloginBlock': {'title': EVENT_BOARDS.SERVER_NOSUITABLE_HEADER,
                           'description': description,
                           'descriptionTooltip': self.__getPrimeTimesTooltip()},
          'isRelogin': True}
     return result
コード例 #7
0
ファイル: vo_converters.py プロジェクト: webiumsk/WOT-0.9.12
def makeBuildingIndicatorsVO(buildingLevel, progress, hpVal, hpTotalVal, defResVal, maxDefResVal):
    defResCompensationValue = 0
    FORMAT_PATTERN = '###'
    if progress == FORT_ALIAS.STATE_FOUNDATION_DEF or progress == FORT_ALIAS.STATE_FOUNDATION:
        hpValueFormatter = text_styles.alert(FORMAT_PATTERN)
    else:
        hpValueFormatter = text_styles.defRes(FORMAT_PATTERN)
    hpTotalFormatted = str(BigWorld.wg_getIntegralFormat(hpTotalVal)) + ' '
    formattedHpTotal = ''.join((text_styles.standard(hpTotalFormatted), icons.nut()))
    defResValueFormatter = text_styles.alert(FORMAT_PATTERN) if defResVal > maxDefResVal else text_styles.defRes(FORMAT_PATTERN)
    maxDefDerFormatted = str(BigWorld.wg_getIntegralFormat(maxDefResVal)) + ' '
    formattedDefResTotal = ''.join((text_styles.standard(maxDefDerFormatted), icons.nut()))
    hpProgressLabels = {'currentValue': str(BigWorld.wg_getIntegralFormat(hpVal)),
     'currentValueFormatter': hpValueFormatter,
     'totalValue': formattedHpTotal,
     'separator': '/'}
    storeProgressLabels = {'currentValue': str(BigWorld.wg_getIntegralFormat(defResVal)),
     'currentValueFormatter': defResValueFormatter,
     'totalValue': formattedDefResTotal,
     'separator': '/'}
    result = {'hpLabel': i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_HPLBL),
     'defResLabel': i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_DEFRESLBL),
     'hpCurrentValue': hpVal,
     'hpTotalValue': hpTotalVal,
     'defResCurrentValue': defResVal,
     'defResCompensationValue': defResCompensationValue,
     'defResTotalValue': maxDefResVal,
     'hpProgressLabels': hpProgressLabels,
     'defResProgressLabels': storeProgressLabels}
    return result
コード例 #8
0
 def _packSkillInfo(self):
     return {'upgradeBtnLoc': i18n.makeString(EPIC_BATTLE.METAABILITYSCREEN_UPGRADE_SKILL),
      'acquireBtnLoc': i18n.makeString(EPIC_BATTLE.METAABILITYSCREEN_ACQUIRE_SKILL),
      'abilityMaxLevelTxtLoc': text_styles.neutral(EPIC_BATTLE.METAABILITYSCREEN_ABILITY_MAX_LEVEL),
      'abilityLockedTxtLoc': text_styles.alert(EPIC_BATTLE.METAABILITYSCREEN_ABILITY_LOCKED),
      'abilityNotPointsTxtLoc': text_styles.alert(EPIC_BATTLE.METAABILITYSCREEN_ABILITY_NOT_POINTS),
      'statsTitleLoc': text_styles.highTitle('{}{}'.format(i18n.makeString(EPIC_BATTLE.ABILITYINFO_PROPERTIES), i18n.makeString(COMMON.COMMON_COLON)))}
コード例 #9
0
 def _packBlocks(self, *args, **kwargs):
     items = super(CrewSkinSoundTooltipDataBlock, self)._packBlocks()
     tankman = self.context.buildItem(*args, **kwargs).tankman
     topBlock = []
     topBlock.append(
         formatters.packTextBlockData(text=text_styles.middleTitle(
             backport.text(R.strings.tooltips.crewSkins.sound()))))
     topBlock.append(
         formatters.packTextBlockData(text=text_styles.main(
             backport.text(R.strings.tooltips.crewSkins.soundHeader()))))
     if tankman.role != Tankman.ROLES.COMMANDER:
         topBlock.append(
             formatters.packImageTextBlockData(
                 img=RES_ICONS.MAPS_ICONS_LIBRARY_ALERTBIGICON,
                 imgPadding={
                     'left': -3,
                     'top': -2
                 },
                 txtOffset=20,
                 padding=formatters.packPadding(bottom=0, top=8, left=0),
                 desc=text_styles.alert(
                     backport.text(R.strings.tooltips.crewSkins.
                                   soundWarningDescr2()))))
     elif not SoundGroups.g_instance.soundModes.currentNationalPreset[1]:
         topBlock.append(
             formatters.packImageTextBlockData(
                 img=RES_ICONS.MAPS_ICONS_LIBRARY_ALERTBIGICON,
                 imgPadding={
                     'left': -3,
                     'top': -2
                 },
                 txtOffset=20,
                 padding=formatters.packPadding(bottom=0, top=8, left=0),
                 desc=text_styles.alert(
                     backport.text(R.strings.tooltips.crewSkins.
                                   soundWarningDescr1()))))
     items.append(formatters.packBuildUpBlockData(topBlock))
     infoBlock = []
     infoBlock.append(
         formatters.packImageTextBlockData(
             img=RES_ICONS.MAPS_ICONS_LIBRARY_INFO,
             imgPadding={
                 'left': -3,
                 'top': -2
             },
             txtOffset=20,
             desc=text_styles.stats(
                 backport.text(R.strings.tooltips.crewSkins.soundInfo()))))
     infoBlock.append(
         formatters.packTextBlockData(text=text_styles.main(
             backport.text(R.strings.tooltips.crewSkins.soundInfoDescr())),
                                      padding=formatters.packPadding(
                                          left=20)))
     items.append(formatters.packBuildUpBlockData(infoBlock))
     return items
コード例 #10
0
 def __makeOffDayData(self):
     alertMessage = ''
     blockBtnEnabled = True
     fort = self.fortCtrl.getFort()
     inProcess, inCooldown = fort.getOffDayProcessing()
     dayOff = fort.getOffDayStr()
     if self._isFortFrozen():
         conditionPostfix = text_styles.standard(dayOff)
     else:
         conditionPostfix = text_styles.neutral(dayOff)
     blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_WEEKENDBTNENABLED
     descriptionTooltip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DAYOFFDESCRIPTION
     if inProcess:
         offDayChangeDate, nextOffDayUTC, _ = fort.events[
             FORT_EVENT_TYPE.OFF_DAY_CHANGE]
         nextOffDayLocal = adjustOffDayToLocal(
             nextOffDayUTC,
             self.fortCtrl.getFort().getLocalDefenceHour()[0])
         if nextOffDayLocal > NOT_ACTIVATED:
             value = i18n.makeString(
                 MENU.datetime_weekdays_full(str(nextOffDayLocal + 1)))
         else:
             value = i18n.makeString(
                 FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_NOWEEKEND)
         msgString = i18n.makeString(
             FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_INPROGRESS,
             value=value,
             date=BigWorld.wg_getLongDateFormat(offDayChangeDate))
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_WEEKENDBTNDISABLED
     elif inCooldown:
         msgString = i18n.makeString(
             FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_RECENTLYSCHEDULED)
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_WEEKENDBTNDISABLED
     conditionPrefix = text_styles.main(
         i18n.makeString(
             FORTIFICATIONS.settingswindow_blockcondition('weekEnd')))
     blockDescr = text_styles.standard(
         i18n.makeString(
             FORTIFICATIONS.settingswindow_blockdescr('weekEnd')))
     if alertMessage:
         alertMessage = icons.alert() + ' ' + alertMessage
     return {
         'blockBtnEnabled': blockBtnEnabled,
         'blockDescr': blockDescr,
         'blockCondition': conditionPrefix + ' ' + conditionPostfix,
         'alertMessage': alertMessage,
         'blockBtnToolTip': blockBtnToolTip,
         'descriptionTooltip': descriptionTooltip
     }
コード例 #11
0
 def _packBlocks(self, *args, **kwargs):
     items = super(BattleProgressionTooltipData,
                   self)._packBlocks(*args, **kwargs)
     titleStr = text_styles.highTitle(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.title()))
     titleDescrStr = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.titleDescr()))
     items.append(
         formatters.packItemTitleDescBlockData(title=titleStr,
                                               desc=titleDescrStr,
                                               txtGap=5))
     highlight1Str = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.noteHighlight1()))
     highlight2Str = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.noteHighlight2()))
     noteStr = text_styles.main(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.note(),
                       highlight1=highlight1Str,
                       highlight2=highlight2Str))
     noteBlock = formatters.packTextBlockData(text=noteStr)
     items.append(
         formatters.packBuildUpBlockData(
             blocks=[noteBlock],
             linkage=BLOCKS_TOOLTIP_TYPES.
             TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     tutorialHighlightStr = text_styles.neutral(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.tutorialHighlight()))
     treeKey = text_styles.alert(
         getHotKeyString(CommandMapping.CMD_UPGRADE_PANEL_SHOW))
     leftModuleKey = text_styles.alert(
         getHotKeyString(CommandMapping.CMD_CM_VEHICLE_UPGRADE_PANEL_LEFT))
     rightModuleKey = text_styles.alert(
         getHotKeyString(CommandMapping.CMD_CM_VEHICLE_UPGRADE_PANEL_RIGHT))
     tutorialStr = text_styles.main(
         backport.text(R.strings.battle_royale.hangarVehicleInfo.tooltips.
                       battleProgression.tutorial(),
                       treeKey=treeKey,
                       leftModuleKey=leftModuleKey,
                       rightModuleKey=rightModuleKey))
     tutorialStr = text_styles.concatStylesWithSpace(
         tutorialHighlightStr, tutorialStr)
     items.append(formatters.packTextBlockData(text=tutorialStr))
     return items
コード例 #12
0
 def getDescription(self):
     description = self.__localizeDescr()
     if self.__limiter:
         warningText = i18n.makeString(PERSONAL_MISSIONS.CONDITIONS_LIMITER_LABEL)
         limiterDescription = self.__localizeLimiter()
         description = '%s\n%s %s' % (description, text_styles.alert(warningText), limiterDescription)
     return description
コード例 #13
0
ファイル: fortclanbattleroom.py プロジェクト: kblw/wot_client
 def __makeMainVO(self):
     result = {}
     extra = self.unitFunctional.getExtra()
     (_, _, arenaTypeID), _ = self.__currentBuilding
     unitPermissions = self.unitFunctional.getPermissions()
     activeConsumes = extra.getConsumables()
     result["mapID"] = arenaTypeID
     arenaType = ArenaType.g_cache.get(arenaTypeID)
     canUseEquipments = self.__battle.itemData.canUseEquipments
     if arenaType is not None:
         mapName = text_styles.main(arenaType.name)
     else:
         mapName = ""
     infoIcon = icons.info()
     result["headerDescr"] = text_styles.standard(
         i18n.makeString(FORTIFICATIONS.FORTCLANBATTLEROOM_HEADER_MAPTITLE, mapName=mapName) + " " + infoIcon
     )
     result["isOrdersBgVisible"] = bool(
         not unitPermissions.canChangeConsumables() and len(activeConsumes) and not canUseEquipments
     )
     result["mineClanName"] = g_clanCache.clanTag
     _, enemyClanAbbev, _ = self.__battle.getOpponentClanInfo()
     result["enemyClanName"] = "[%s]" % enemyClanAbbev
     if not canUseEquipments and unitPermissions.canChangeConsumables():
         result["ordersDisabledMessage"] = (
             icons.alert()
             + " "
             + text_styles.alert(i18n.makeString(FORTIFICATIONS.FORTCLANBATTLEROOM_HEADER_ORDERSDISABLED))
         )
         result["ordersDisabledTooltip"] = TOOLTIPS.FORTIFICATION_FORTCLANBATTLEROOM_ORDERSDISABLED_DIVISIONMISMATCH
     self.as_setBattleRoomDataS(result)
コード例 #14
0
 def _populate(self):
     super(UseAwardSheetWindow, self)._populate()
     self.as_setSettingsS({
         'title': self.meta.getTitle(),
         'submitBtnLabel': self.meta.getSubmitButtonLabel(),
         'cancelBtnLabel': self.meta.getCancelButtonLabel()
     })
     icon = icons.makeImageTag(
         RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICONFILLED, 16, 16, -3,
         0) if self.meta.isAvailable() else icons.makeImageTag(
             RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON, 16, 16, -4, 0)
     text = text_styles.neutral(self.meta.getInfoText(
     )) if self.meta.isAvailable() else text_styles.alert(
         self.meta.getWarningText())
     statusText = text_styles.concatStylesWithSpace(icon, text)
     self.as_setDataS({
         'neededLabel':
         text_styles.highlightText(self.meta.getNeededText()),
         'neededValue':
         text_styles.highlightText(self.meta.getPawnCost()),
         'totalLabel':
         text_styles.main(self.meta.getTotalText()),
         'totalValue':
         text_styles.main(self.meta.getFreeSheets()),
         'statusText':
         statusText,
         'icon':
         self.meta.getIcon()
     })
コード例 #15
0
 def __getControlsData(self):
     enableApplyBtn = self.__sessionStatsSettings.validateSettings(
         self.__currentSettings)
     warning = {}
     if not enableApplyBtn:
         maxStats = MAX_STATS - len(
             SESSION_STATS.getImmutableEfficiencyBlockParameters())
         text = backport.text(
             R.strings.session_stats.settings.efficiencyBlock.error(),
             max=maxStats)
         warning['text'] = text_styles.alert(text)
         warning['icon'] = backport.image(
             R.images.gui.maps.icons.library.alertBigIcon())
     else:
         enableApplyBtn = self.__currentSettings != self.__sessionStatsSettings.getSettings(
         )
     return {
         'warning':
         warning,
         'states': [{
             'btnEnabled':
             enableApplyBtn,
             'btnLabel':
             backport.text(
                 R.strings.session_stats.settings.controls.applyBtn())
         }, {
             'btnEnabled':
             True,
             'btnLabel':
             backport.text(
                 R.strings.session_stats.settings.controls.backBtn())
         }]
     }
コード例 #16
0
ファイル: module.py プロジェクト: webiumsk/WOT-0.9.15-CT
 def construct(self):
     block = []
     paddingTop = 8
     block.append(formatters.packImageTextBlockData(title=text_styles.alert(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_BODY), img=RES_ICONS.MAPS_ICONS_TOOLTIP_COMPLEX_EQUIPMENT, imgPadding=formatters.packPadding(left=2, top=3), txtOffset=20))
     block.append(formatters.packTextBlockData(text=text_styles.main(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_NOTE), padding=formatters.packPadding(top=paddingTop)))
     block.append(formatters.packTextParameterWithIconBlockData(name=text_styles.main(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_DISMANTLING_PRICE), value=text_styles.gold(g_itemsCache.items.shop.paidRemovalCost), icon=ICON_TEXT_FRAMES.GOLD, valueWidth=60, padding=formatters.packPadding(left=43, top=paddingTop)))
     return block
コード例 #17
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)
コード例 #18
0
 def __updateStatus(self):
     prefix = i18n.makeString(FORTIFICATIONS.SETTINGSDEFENCEHOURPOPOVER_DEFENCEHOURTITLE)
     prefix = text_styles.highTitle(prefix)
     if self._isFortFrozen():
         toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_FREEZED)
         icon = RES_ICONS.MAPS_ICONS_LIBRARY_ERRORICON_1
         imageSource = icons.makeImageTag(icon, 16, 16, -4, 0)
         currentStatus = text_styles.error(i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_FREEZED))
         currentStatus = imageSource + " " + currentStatus
     elif self.__defencePeriod:
         toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_ACTIVATED)
         currentStatus = "".join(
             (
                 icons.checkmark(),
                 text_styles.success(" " + i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_ACTIVATED)),
             )
         )
     elif self.__checkConditions():
         toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_CANBEACTIVATED)
         currentStatus = "".join(
             (
                 icons.alert(),
                 text_styles.alert(" " + i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_NOTACTIVATED)),
             )
         )
     else:
         toolTip = i18n.makeString(TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_STATUSSTRING_CANNOTBEACTIVATED)
         currentStatus = "".join(
             (
                 icons.notAvailable(),
                 text_styles.standard(" " + i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_STATUSMSG_NOTAVAILABLE)),
             )
         )
     self.as_setMainStatusS(prefix, currentStatus, toolTip)
 def _prepareData(self, serverList, serverName, serverTimeLeft):
     if len(serverList) == 1:
         serversDDEnabled = False
     else:
         serversDDEnabled = True
     applyButtonLabel = _ms(RANKED_BATTLES.PRIMETIME_APPLYBTN)
     title = text_styles.epicTitle(RANKED_BATTLES.PRIMETIME_TITLE)
     if self._isEnabled:
         timeLeftStr = time_utils.getTillTimeString(
             serverTimeLeft,
             MENU.HEADERBUTTONS_BATTLE_TYPES_RANKED_AVAILABILITY)
         status = text_styles.main(
             _ms(RANKED_BATTLES.PRIMETIME_STATUS_THISENABLE,
                 server=serverName,
                 time=text_styles.warning(timeLeftStr)))
         mainBackground = RES_ICONS.MAPS_ICONS_RANKEDBATTLES_PRIMETIME_PRIME_TIME_BACK_DEFAULT
         title = text_styles.epicTitle(
             RANKED_BATTLES.PRIMETIME_TITLEWELCOME)
     else:
         applyButtonLabel = _ms(RANKED_BATTLES.PRIMETIME_CONTINUEBTN)
         status = '{} {}\n{}'.format(
             icons.alert(-3),
             text_styles.alert(
                 RANKED_BATTLES.PRIMETIME_STATUS_DISABLEFIRST),
             text_styles.main(RANKED_BATTLES.PRIMETIME_STATUS_DISABLE))
         mainBackground = RES_ICONS.MAPS_ICONS_RANKEDBATTLES_PRIMETIME_PRIME_TIME_BACK_BW
     return {
         'title': title,
         'apply': applyButtonLabel,
         'mainBackground': mainBackground,
         'status': status,
         'serversDDEnabled': serversDDEnabled,
         'serverDDVisible': True
     }
コード例 #20
0
 def __makeTimeOfBattle(self, item, battleItem, currentState):
     result = {}
     if currentState == FORTIFICATION_ALIASES.CLAN_BATTLE_IS_IN_BATTLE:
         icon = icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_BATTLERESULTICON_1, 16, 16, -3, 0)
         formattedText = text_styles.error(i18n.makeString(I18N_FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_ISBATTLE))
         result['text'] = icon + ' ' + formattedText
     elif currentState == FORTIFICATION_ALIASES.CLAN_BATTLE_BEGINS:
         battleID = item.getBattleID()
         timer = {}
         htmlFormatter = text_styles.alert('###')
         locale = text_styles.main(i18n.makeString(I18N_FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_BEFOREBATTLE))
         result['text'] = locale
         if battleItem:
             startTimeLeft = battleItem.getRoundStartTimeLeft()
         else:
             startTimeLeft = item.getStartTimeLeft()
         timer['useUniqueIdentifier'] = True
         timer['uniqueIdentifier'] = battleID
         timer['deltaTime'] = startTimeLeft
         timer['htmlFormatter'] = htmlFormatter
         timer['timerDefaultValue'] = '00'
         result['timer'] = timer
     else:
         lastBattleTimeUserString = '%s - %s' % (BigWorld.wg_getShortTimeFormat(item.getStartTime()), BigWorld.wg_getShortTimeFormat(item.getFinishTime()))
         result['text'] = text_styles.main(lastBattleTimeUserString)
     return result
コード例 #21
0
 def getInfo(self):
     userAnonymized = self.__anonymizerController.isAnonymized
     return '{}\n{}'.format(
         backport.text(_R_SQUAD.simpleChatName()),
         text_styles.alert(
             backport.text(_R_SQUAD.simpleChatAlert.anonymizer()))
         if userAnonymized else '')
コード例 #22
0
 def _buildVO(self):
     deletedTankmen = self.restore.getTankmenBeingDeleted()
     alertImgSrc = ''
     alertText = ''
     alertTooltip = ''
     if not self._tankman.isRestorable():
         alertText = text_styles.alert(
             icons.alert() + _ms(DIALOGS.PROTECTEDDISMISSTANKMAN_ALERT))
         alertTooltip = TOOLTIPS.DISMISSTANKMANDIALOG_CANTRESTORALERT
     elif deletedTankmen:
         alertImgSrc = RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON
         alertTooltip = makeTooltip(
             TOOLTIPS.DISMISSTANKMANDIALOG_BUFFERISFULL_HEADER,
             _ms(TOOLTIPS.DISMISSTANKMANDIALOG_BUFFERISFULL_BODY,
                 placeCount=self.restore.getMaxTankmenBufferLength(),
                 currCount=len(self.restore.getDismissedTankmen()),
                 tankmanNew=self._tankman.fullUserName,
                 tankmanOld=formatDeletedTankmanStr(deletedTankmen[0])))
     return {
         'alertText': alertText,
         'alertTooltip': alertTooltip,
         'alertImgSrc': alertImgSrc,
         'questionText':
         text_styles.main(_ms(DIALOGS.DISMISSTANKMAN_MESSAGE))
     }
コード例 #23
0
ファイル: module.py プロジェクト: webiumsk/WOT-0.9.15.1
 def construct(self):
     block = []
     paddingTop = 8
     block.append(formatters.packImageTextBlockData(title=text_styles.alert(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_BODY), img=RES_ICONS.MAPS_ICONS_TOOLTIP_COMPLEX_EQUIPMENT, imgPadding=formatters.packPadding(left=2, top=3), txtOffset=20))
     block.append(formatters.packTextBlockData(text=text_styles.main(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_NOTE), padding=formatters.packPadding(top=paddingTop)))
     block.append(formatters.packTextParameterWithIconBlockData(name=text_styles.main(TOOLTIPS.MODULEFITS_NOT_REMOVABLE_DISMANTLING_PRICE), value=text_styles.gold(g_itemsCache.items.shop.paidRemovalCost), icon=ICON_TEXT_FRAMES.GOLD, valueWidth=60, padding=formatters.packPadding(left=43, top=paddingTop)))
     return block
コード例 #24
0
 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)
コード例 #25
0
 def __getAvailabilityStr(self):
     battle = g_eventsCache.getCompanyBattles()
     if not battle.isValid():
         return
     startTimeLeft = battle.getCreationTimeLeft()
     finishTimeLeft = battle.getDestroyingTimeLeft()
     if startTimeLeft is not None and startTimeLeft > 0:
         if startTimeLeft < time_utils.ONE_DAY:
             return text_styles.alert(
                 i18n.makeString(
                     MENU.HEADERBUTTONS_BATTLE_AVAILABLESINCESOON,
                     time=text_styles.stats(
                         time_formatters.getTimeDurationStr(
                             startTimeLeft, True))))
         else:
             return text_styles.stats(
                 i18n.makeString(MENU.HEADERBUTTONS_BATTLE_AVAILABLESINCE,
                                 datetime=self._getDateTimeString(
                                     battle.startTime)))
     elif finishTimeLeft is not None and finishTimeLeft > 0:
         if finishTimeLeft < time_utils.ONE_DAY:
             return text_styles.success(
                 i18n.makeString(
                     MENU.HEADERBUTTONS_BATTLE_AVAILABLEUNTILSOON,
                     time=text_styles.stats(
                         time_formatters.getTimeDurationStr(
                             finishTimeLeft, True))))
         else:
             return text_styles.success(
                 i18n.makeString(MENU.HEADERBUTTONS_BATTLE_AVAILABLEUNTIL,
                                 datetime=self._getDateTimeString(
                                     battle.finishTime)))
コード例 #26
0
ファイル: vo_converters.py プロジェクト: jamesxia4/wot_client
def makeSortieShortVO(unitFunctional, unitIdx=None, app=None):
    fullData = unitFunctional.getUnitFullData(unitIdx=unitIdx)
    if fullData is None:
        title = i18n.makeString(FORTIFICATIONS.SORTIE_LISTVIEW_ALERTTEXT_TITLE)
        body = i18n.makeString(FORTIFICATIONS.SORTIE_LISTVIEW_ALERTTEXT_BODY)
        alertView = {
            'icon': RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON,
            'titleMsg': text_styles.alert(title),
            'bodyMsg': text_styles.main(body),
            'buttonLbl': FORTIFICATIONS.SORTIE_LISTVIEW_ENTERBTN
        }
        return {'isShowAlertView': True, 'alertView': alertView}
    unit, unitState, unitStats, pInfo, slotsIter = fullData
    division = getDivisionNameByType(unit.getRosterTypeID())
    divisionTypeStr = i18n.makeString(
        FORTIFICATIONS.sortie_division_name(division))
    unit, unitState, _, pInfo, slotsIter = fullData
    return {
        'isFreezed':
        unitState.isLocked(),
        'hasRestrictions':
        unit.isRosterSet(ignored=settings.CREATOR_ROSTER_SLOT_INDEXES),
        'slots':
        _getSlotsData(unitIdx, unit, unitState, pInfo, slotsIter, app,
                      unitFunctional.getRosterSettings().getLevelsRange()),
        'description':
        divisionTypeStr if divisionTypeStr else
        unitFunctional.getCensoredComment(unitIdx=unitIdx)
    }
コード例 #27
0
 def __makeMainVO(self):
     result = {}
     extra = self.prbEntity.getExtra()
     (_, _, arenaTypeID), _ = self.__currentBuilding
     unitPermissions = self.prbEntity.getPermissions()
     activeConsumes = extra.getConsumables()
     result['mapID'] = arenaTypeID
     arenaType = ArenaType.g_cache.get(arenaTypeID)
     canUseEquipments = self.__battle.itemData.canUseEquipments
     if arenaType is not None:
         mapName = text_styles.main(arenaType.name)
     else:
         mapName = ''
     infoIcon = icons.info()
     result['headerDescr'] = text_styles.standard(
         i18n.makeString(FORTIFICATIONS.FORTCLANBATTLEROOM_HEADER_MAPTITLE,
                         mapName=mapName) + ' ' + infoIcon)
     result['isOrdersBgVisible'] = bool(
         not unitPermissions.canChangeConsumables() and len(activeConsumes))
     result['mineClanName'] = g_clanCache.clanTag
     _, enemyClanAbbev, _ = self.__battle.getOpponentClanInfo()
     result['enemyClanName'] = '[%s]' % enemyClanAbbev
     if not canUseEquipments and unitPermissions.canChangeConsumables():
         result['ordersDisabledMessage'] = icons.alert(
         ) + ' ' + text_styles.alert(
             i18n.makeString(
                 FORTIFICATIONS.FORTCLANBATTLEROOM_HEADER_ORDERSDISABLED))
         result[
             'ordersDisabledTooltip'] = TOOLTIPS.FORTIFICATION_FORTCLANBATTLEROOM_ORDERSDISABLED_DIVISIONMISMATCH
     self.as_setBattleRoomDataS(result)
     return
コード例 #28
0
 def _packUnsupportedBlock(self):
     return formatters.packImageTextBlockData(
         img=RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON,
         imgPadding=formatters.packPadding(top=3, right=3),
         desc=text_styles.alert(
             _ms(VEHICLE_CUSTOMIZATION.CUSTOMIZATION_TOOLTIP_WARNING_TITLE)
         ))
コード例 #29
0
ファイル: clubsummaryview.py プロジェクト: kblw/wot_client
def _getDivisionText(ladderInfo):
    if ladderInfo.isInLadder():
        leagueStr = text_styles.warning(getLeagueString(ladderInfo.getLeague()))
        divisionStr = text_styles.warning(getDivisionString(ladderInfo.division))
        return text_styles.middleTitle(_ms(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_LADDER_LEAGUEDIVISION, league=leagueStr, division=divisionStr))
    else:
        return text_styles.alert(CYBERSPORT.STATICFORMATIONSUMMARYVIEW_NOTENOUGHGAMES_WARNING)
コード例 #30
0
 def setNoClubChevron(self, isApplicationSent):
     if isApplicationSent:
         self.__data['isClockIconVisible'] = True
         self.__data['clockIconSource'] = RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_CLOCKICON
         self.__data['isRequestWaitingTextVisible'] = True
         self.__data['requestWaitingText'] = text_styles.alert(CYBERSPORT.WINDOW_INTRO_REQUESTWAITING)
     else:
         self.__data['ladderIconSource'] = '%s/256/empty.png' % LADDER_CHEVRON_ICON_PATH
コード例 #31
0
 def construct(self):
     block = list()
     module = self.module
     vehicle = self.configuration.vehicle
     if vehicle is not None and not module.isAffectsOnVehicle(vehicle):
         block.append(formatters.packImageTextBlockData(title=text_styles.alert(TOOLTIPS.BATTLEBOOSTER_USELESS_HEADER), img=RES_ICONS.MAPS_ICONS_TOOLTIP_ALERTICON, imgPadding=formatters.packPadding(left=2, top=3), txtOffset=20))
         block.append(formatters.packTextBlockData(text=text_styles.main(TOOLTIPS.BATTLEBOOSTER_USELESS_BODY), padding=formatters.packPadding(top=8)))
     return block
コード例 #32
0
 def _getBonuses(self, svrEvents, bonuses=None):
     bonuses = bonuses or self.event.getBonuses()
     result = OldStyleBonusesFormatter(
         self.event).getFormattedBonuses(bonuses)
     return formatters.todict(result) if result else formatters.todict([
         formatters.packTextBlock(
             text_styles.alert('#quests:bonuses/notAvailable'))
     ])
コード例 #33
0
 def __stateTextStyleFormatter(self, state):
     if self.__restrictionType in self.__WARNING_UNIT_MESSAGES and self._playerInfo.isReady:
         return ' '.join(
             (icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON,
                                 vSpace=-3), text_styles.alert(state)))
     if self.__restrictionType not in self.__NOT_CRITICAL_STATES:
         return text_styles.error(state)
     return text_styles.main(state)
コード例 #34
0
 def __prepareIndicatorData(self, isCanModernization, increment = False, resLeft = 0):
     if increment:
         hpTotalVal = self.nextLevel.levelRef.hp
         hpVal = self.nextLevel.hp
         defResVal = self.__defResVal - self.__cost + resLeft
         maxDefResVal = self.nextLevel.levelRef.storage
     else:
         hpTotalVal = self.__hpTotalVal
         hpVal = self.__hpVal
         defResVal = self.__defResVal
         maxDefResVal = self.__maxDerResVal
     formatter = text_styles.defRes
     if self.__progress == FORTIFICATION_ALIASES.STATE_FOUNDATION_DEF or self.__progress == FORTIFICATION_ALIASES.STATE_FOUNDATION:
         formatter = text_styles.alert
     if not isCanModernization and increment:
         currentHpLabel = text_styles.main('--')
         currentHpValue = 0
     else:
         currentHpLabel = str(BigWorld.wg_getIntegralFormat(hpVal))
         currentHpValue = hpVal
     FORMAT_PATTERN = '###'
     formattedHpValue = formatter(FORMAT_PATTERN)
     formatter = text_styles.standard
     if increment:
         formatter = text_styles.neutral
     formattedHpTotal = formatter(str(BigWorld.wg_getIntegralFormat(hpTotalVal)))
     formattedHpTotal += ' ' + icons.nut()
     if not isCanModernization and increment:
         currentDefResLabel = text_styles.main('--')
         currentDefResValue = 0
     else:
         currentDefResLabel = str(BigWorld.wg_getIntegralFormat(defResVal))
         currentDefResValue = defResVal
     defResValueFormatter = text_styles.alert(FORMAT_PATTERN) if defResVal > maxDefResVal else text_styles.defRes(FORMAT_PATTERN)
     formattedDefResTotal = formatter(str(BigWorld.wg_getIntegralFormat(maxDefResVal)))
     formattedDefResTotal += ' ' + icons.nut()
     result = {}
     result['hpLabel'] = i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_HPLBL)
     result['defResLabel'] = i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_DEFRESLBL)
     result['hpCurrentValue'] = currentHpValue
     result['hpTotalValue'] = hpTotalVal
     result['defResCurrentValue'] = currentDefResValue
     result['defResTotalValue'] = maxDefResVal
     result['defResTotalValue'] = maxDefResVal
     result['defResCompensationValue'] = max(0, defResVal - maxDefResVal)
     hpProgressLabels = {}
     hpProgressLabels['currentValue'] = currentHpLabel
     hpProgressLabels['currentValueFormatter'] = formattedHpValue
     hpProgressLabels['totalValue'] = formattedHpTotal
     hpProgressLabels['separator'] = '/'
     storeProgressLabels = {}
     storeProgressLabels['currentValue'] = currentDefResLabel
     storeProgressLabels['currentValueFormatter'] = defResValueFormatter
     storeProgressLabels['totalValue'] = formattedDefResTotal
     storeProgressLabels['separator'] = '/'
     result['hpProgressLabels'] = hpProgressLabels
     result['defResProgressLabels'] = storeProgressLabels
     return result
コード例 #35
0
def getBattlePassQuestInfo(progress):
    postBattleR = R.strings.battle_pass_2020.reward.postBattle
    if progress.state == BattlePassState.BASE:
        questName = backport.text(postBattleR.title.base(),
                                  level=progress.level)
    else:
        questName = backport.text(postBattleR.title.post(),
                                  level=progress.level)
    progressDesc = backport.text(postBattleR.progress())
    progressDiffTooltip = backport.text(postBattleR.progress.tooltip(),
                                        points=progress.pointsBattleDiff)
    questInfo = {
        'status': 'done' if progress.isDone else '',
        'questID': BattlePassConsts.FAKE_QUEST_ID,
        'rendererType': QUESTS_ALIASES.RENDERER_TYPE_QUEST,
        'eventType': EVENT_TYPE.BATTLE_QUEST,
        'maxProgrVal': progress.pointsTotal,
        'tooltip': TOOLTIPS.QUESTS_RENDERER_LABEL,
        'description': questName,
        'currentProgrVal': progress.pointsNew,
        'tasksCount': -1,
        'progrBarType': 'current' if not progress.isDone else '',
        'linkTooltip': TOOLTIPS.QUESTS_LINKBTN_BATTLEPASS
    }
    progressList = []
    if not progress.isDone:
        progressList = [{
            'description': progressDesc,
            'maxProgrVal': progress.pointsTotal,
            'progressDiff': '+ {}'.format(progress.pointsDiff),
            'progressDiffTooltip': progressDiffTooltip,
            'currentProgrVal': progress.pointsNew,
            'progrBarType': 'current'
        }]
    awards = []
    if progress.isDone:
        awardsList = QuestsBonusComposer(
            BattlePassTextBonusesPacker()).getPreformattedBonuses(
                progress.awards)
        if awardsList:
            awards = [award.getDict() for award in awardsList]
        else:
            awards = [
                formatters.packTextBlock(
                    text_styles.alert(
                        backport.text(R.strings.quests.bonuses.notAvailable()))
                ).getDict()
            ]
    info = {
        'awards': awards,
        'questInfo': questInfo,
        'questType': EVENT_TYPE.BATTLE_QUEST,
        'progressList': progressList,
        'questState': {
            'statusState': 'done' if progress.isDone else 'inProgress'
        }
    }
    return info
コード例 #36
0
 def _packBlocks(self, *args, **kwargs):
     items = super(CrewSkinRestrictedTooltipDataBlock, self)._packBlocks()
     skinTankmanContext = self.context.buildItem(*args, **kwargs)
     crewSkin = skinTankmanContext.crewSkin
     tankman = skinTankmanContext.tankman
     block = []
     block.append(
         formatters.packTextBlockData(text=text_styles.middleTitle(
             backport.text(
                 R.strings.tooltips.crewSkins.restrictions.header()))))
     block.append(
         formatters.packTextBlockData(text=text_styles.main(
             backport.text(R.strings.tooltips.crewSkins.restrictions()))))
     if crewSkin.getRoleID() is not None:
         text = backport.text(
             R.strings.item_types.tankman.roles.dyn(crewSkin.getRoleID())())
         highlight = text_styles.alert(text) if crewSkin.getRoleID(
         ) != tankman.role else text_styles.main(text)
         block.append(
             formatters.packTextBlockData(text=u'\u2022 ' + highlight))
     if crewSkin.getSex() in TANKMAN_SEX.ALL:
         text = backport.text(
             R.strings.item_types.tankman.gender.dyn(
                 GenderRestrictionsLocales.KEYS[
                     skinTankmanContext.crewSkin.getSex()])())
         isTankmanAndSkinMale = crewSkin.getSex(
         ) == TANKMAN_SEX.MALE and not tankman.isFemale
         isTankmanAndSkinFemale = crewSkin.getSex(
         ) == TANKMAN_SEX.FEMALE and tankman.isFemale
         if isTankmanAndSkinMale or isTankmanAndSkinFemale:
             highlight = text_styles.main(text)
         else:
             highlight = text_styles.alert(text)
         block.append(
             formatters.packTextBlockData(text=u'\u2022 ' + highlight))
     if crewSkin.getNation() is not None:
         text = backport.text(R.strings.nations.dyn(crewSkin.getNation())())
         if crewSkin.getNation() != NAMES[tankman.nationID]:
             highlight = text_styles.alert(text)
         else:
             highlight = text_styles.main(text)
         block.append(
             formatters.packTextBlockData(text=u'\u2022 ' + highlight))
     items.append(formatters.packBuildUpBlockData(block))
     return items
コード例 #37
0
ファイル: vehicle.py プロジェクト: webiumsk/WOT-0.9.15.1
    def __createTankmanIsOutStr(self, types):
        men = ''
        typesLen = len(types)
        for i, type in enumerate(types):
            men += _ms(ITEM_TYPES.tankman_roles(type))
            if i < typesLen - 1:
                men += ', '

        return text_styles.alert(_ms(TOOLTIPS.VEHICLEPARAMS_WARNING_TANKMANISOUT, tankmen=men))
コード例 #38
0
 def __getBottomPanelData(self):
     isBuyingAvailable = not g_currentPreviewVehicle.item.isHidden
     if isBuyingAvailable:
         buyingLabel = text_styles.main(VEHICLE_PREVIEW.BUYINGPANEL_LABEL)
     else:
         buyingLabel = text_styles.alert(VEHICLE_PREVIEW.BUYINGPANEL_ALERTLABEL)
     return {'buyingLabel': buyingLabel,
      'modulesLabel': text_styles.middleTitle(VEHICLE_PREVIEW.MODULESPANEL_TITLE),
      'isBuyingAvailable': isBuyingAvailable}
コード例 #39
0
 def __makeOffDayData(self):
     alertMessage = ""
     blockBtnEnabled = True
     fort = self.fortCtrl.getFort()
     inProcess, inCooldown = fort.getOffDayProcessing()
     dayOff = fort.getOffDayStr()
     if self._isFortFrozen():
         conditionPostfix = text_styles.standard(dayOff)
     else:
         conditionPostfix = text_styles.neutral(dayOff)
     blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_WEEKENDBTNENABLED
     descriptionTooltip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_DAYOFFDESCRIPTION
     if inProcess:
         offDayChangeDate, nextOffDayUTC, _ = fort.events[FORT_EVENT_TYPE.OFF_DAY_CHANGE]
         nextOffDayLocal = adjustOffDayToLocal(nextOffDayUTC, self.fortCtrl.getFort().getLocalDefenceHour()[0])
         if nextOffDayLocal > NOT_ACTIVATED:
             value = i18n.makeString(MENU.datetime_weekdays_full(str(nextOffDayLocal + 1)))
         else:
             value = i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_NOWEEKEND)
         msgString = i18n.makeString(
             FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_INPROGRESS,
             value=value,
             date=BigWorld.wg_getLongDateFormat(offDayChangeDate),
         )
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_WEEKENDBTNDISABLED
     elif inCooldown:
         msgString = i18n.makeString(FORTIFICATIONS.SETTINGSWINDOW_BLOCKCONDITION_RECENTLYSCHEDULED)
         alertMessage = text_styles.alert(msgString)
         blockBtnEnabled = False
         blockBtnToolTip = TOOLTIPS.FORTIFICATION_FORTSETTINGSWINDOW_WEEKENDBTNDISABLED
     conditionPrefix = text_styles.main(i18n.makeString(FORTIFICATIONS.settingswindow_blockcondition("weekEnd")))
     blockDescr = text_styles.standard(i18n.makeString(FORTIFICATIONS.settingswindow_blockdescr("weekEnd")))
     if alertMessage:
         alertMessage = icons.alert() + " " + alertMessage
     return {
         "blockBtnEnabled": blockBtnEnabled,
         "blockDescr": blockDescr,
         "blockCondition": conditionPrefix + " " + conditionPostfix,
         "alertMessage": alertMessage,
         "blockBtnToolTip": blockBtnToolTip,
         "descriptionTooltip": descriptionTooltip,
     }
コード例 #40
0
 def setRecord(self, result, reusable):
     self.isMoneyEnabled = not reusable.isWGMoneyOffline
     self.moneyEnabledTooltip = makeTooltip(
         ' '.join(
             (icons.alert(-3),
              i18n.makeString(TOOLTIPS.BATTLERESULTS_MONEYALERT_HEADER))),
         TOOLTIPS.BATTLERESULTS_MONEYALERT_BODY, None, None)
     self.creditsNotAccrueStr = text_styles.alert(
         BATTLE_RESULTS.COMMON_CREDITS_NOTACCRUED)
     return
 def __timeOver(self):
     self.__endTime = None
     self._disableBuyButton = True
     formattedTime = '{} {}'.format(
         icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON2,
                            vSpace=-2),
         text_styles.alert(MENU.VEHICLEPREVIEW_ENDTIME))
     self.as_updateLeftTimeS(formattedTime=formattedTime)
     self.__updateBtnState()
     return
コード例 #42
0
ファイル: tooltipsvehicle.py プロジェクト: Difrex/wotsdk
    def __createTankmanIsOutStr(self, types):
        men = ''
        typesLen = len(types)
        for i, type in enumerate(types):
            men += _ms(ITEM_TYPES.tankman_roles(type))
            if i < typesLen - 1:
                men += ', '

        return text_styles.alert(
            _ms(TOOLTIPS.VEHICLEPARAMS_WARNING_TANKMANISOUT, tankmen=men))
コード例 #43
0
ファイル: tankcarousel.py プロジェクト: webiumsk/WOT-0.9.12
    def __getMultiselectionSlots(self):
        result = []
        if not self.__multiselectionMode:
            return ()
        else:
            falloutCfg = self.__falloutCtrl.getConfig()
            selectedSlots = self.__falloutCtrl.getSelectedSlots()
            selectedSlotsNumber = len(selectedSlots)
            requiredSlots = self.__falloutCtrl.getRequiredSlots()
            mustSelectRequiredVehicle = self.__falloutCtrl.mustSelectRequiredVehicle()
            for slotIdx in range(falloutCfg.maxVehiclesPerPlayer):
                vehicle = None
                if slotIdx < selectedSlotsNumber:
                    vehicle = g_itemsCache.items.getVehicle(selectedSlots[slotIdx])
                if slotIdx in requiredSlots:
                    if mustSelectRequiredVehicle:
                        formattedStatusStr = alert(i18n.makeString(FALLOUT.MULTISELECTIONSLOT_DOMINATION_REQUIREDVEHICLENOTACTIVATED, level=int2roman(falloutCfg.vehicleLevelRequired)))
                    else:
                        formattedStatusStr = alert(FALLOUT.MULTISELECTIONSLOT_DOMINATION_VEHICLENOTACTIVATED)
                else:
                    formattedStatusStr = standard(FALLOUT.MULTISELECTIONSLOT_MULTITEAM_VEHICLENOTACTIVATED)
                data = {'indexStr': i18n.makeString(FALLOUT.MULTISELECTIONSLOT_INDEX, index=slotIdx + 1),
                 'isActivated': False,
                 'formattedStatusStr': formattedStatusStr,
                 'stateLevel': '',
                 'showAlert': slotIdx in requiredSlots,
                 'alertTooltip': TOOLTIPS.MULTISELECTION_ALERT}
                if vehicle is not None:
                    vState, vStateLvl = vehicle.getState()
                    data.update({'isActivated': True,
                     'formattedStatusStr': self.getStringStatus(vState),
                     'inventoryId': vehicle.invID,
                     'vehicleName': vehicle.shortUserName,
                     'vehicleIcon': vehicle.iconSmall,
                     'vehicleType': vehicle.type,
                     'vehicleLevel': vehicle.level,
                     'isElite': vehicle.isElite,
                     'stat': vState,
                     'stateLevel': vStateLvl,
                     'showAlert': False})
                result.append(data)

            return result
コード例 #44
0
    def __setQuestTrackingData(self):
        questProgress = self.sessionProvider.shared.questProgress
        selectedQuest = questProgress.getSelectedQuest()
        setting = self.settingsCore.getSetting(QUESTS_PROGRESS.VIEW_TYPE)
        self.__isProgressTrackingEnabled = setting == QuestsProgressViewType.TYPE_STANDARD
        self.__isProgressTrackingAvailable = selectedQuest and selectedQuest.hasBattleProgress(
        )
        trackingData = []
        personalMissions = self.eventsCache.getPersonalMissions()
        for quest in sorted(questProgress.getInProgressQuests().itervalues(),
                            key=lambda q: q.getQuestBranch()):
            isSelected = quest == selectedQuest
            operation = personalMissions.getOperationsForBranch(
                quest.getQuestBranch())[quest.getOperationID()]
            trackingData.append({
                'isTrackingAvailable':
                quest.hasBattleProgress(),
                'eyeBtnVisible':
                self.__isProgressTrackingEnabled and isSelected,
                'selected':
                isSelected,
                'missionName':
                makeString(quest.getShortUserName()),
                'fullMissionName':
                makeString(quest.getUserName()),
                'operationName':
                makeString(operation.getShortUserName()),
                'vehicle':
                QUESTSPROGRESS.getOperationTrackingIcon(operation.getID()),
                'questID':
                quest.getID(),
                'onPause':
                quest.isOnPause
            })

        progressTracingText = ''
        if not self.__isProgressTrackingAvailable:
            progressTracingText = ''.join(
                (icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ALERTBIGICON,
                                    24, 24, -6, 0),
                 text_styles.alert(
                     INGAME_GUI.STATISTICS_TAB_PROGRESSTRACING_NOTAVAILABLE)))
        trackingStatus = ''
        if len(trackingData) > 1:
            trackingStatus = ''.join(
                (icons.makeImageTag(
                    RES_ICONS.MAPS_ICONS_LIBRARY_NOTIFICATIONS_OFF, 16, 16, -2,
                    0), ' ',
                 text_styles.standard(
                     PERSONAL_MISSIONS.QUESTPROGRESSTRACKING_TRACKINGSTATUS)))
        self.as_updateProgressTrackingS({
            'text': progressTracingText,
            'trackingStatus': trackingStatus,
            'trackingData': trackingData
        })
コード例 #45
0
 def __getQuestStatusData(self, quest):
     if not quest.isUnlocked():
         return (text_styles.standard(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_UNAVAILABLE_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_NOTAVAILABLEICON)
     if quest.needToGetReward():
         return (text_styles.alert(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_AWARDNOTRECEIVED_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_ATTENTIONICON)
     if quest.isInProgress():
         return (text_styles.neutral(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_INPROGRESS_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_INPROGRESSICON)
     if quest.isFullCompleted():
         return (text_styles.statInfo(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_FULLCOMPLETED_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_CHECKMARK)
     if quest.isMainCompleted():
         return (text_styles.statInfo(_ms(QUESTS.TILECHAINSVIEW_TASKTYPE_COMPLETED_TEXT)), RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_CHECKMARK)
     return (text_styles.main(''), None)
コード例 #46
0
ファイル: tabs__init__.py プロジェクト: aevitas/wotsdk
 def __getItemRestoreInfo(self, item):
     """
     Get formatted vehicle restore info
     :param item: <Vehicle>
     :return: <str>
     """
     if item.isRestorePossible():
         if constants.IS_CHINA and item.rentalIsActive:
             return text_styles.alert(MENU.VEHICLE_RESTORELEFT_DISABLEDBYRENT)
         if item.hasLimitedRestore():
             restoreLeftTime = item.restoreInfo.getRestoreTimeLeft()
             timeKey, formattedTime = getTimeLeftInfo(restoreLeftTime)
             msg = i18n.makeString('#menu:vehicle/restoreLeft/%s' % timeKey, time=formattedTime)
             if restoreLeftTime < time_utils.ONE_DAY:
                 return icons.alert() + text_styles.alert(msg)
             return text_styles.stats(msg)
         if item.hasRestoreCooldown():
             timeKey, formattedTime = getTimeLeftInfo(item.restoreInfo.getRestoreCooldownTimeLeft())
             msg = i18n.makeString('#menu:vehicle/restoreCooldownLeft/%s' % timeKey, time=formattedTime)
             return text_styles.stats(msg)
     return ''
コード例 #47
0
ファイル: lobbyheader.py プロジェクト: krzcho/WOTDecompiled
 def __getFightBtnTooltipData(self, state):
     eventVehicles = g_eventsCache.getEventVehicles()
     vehicleNames = ', '.join(map(operator.attrgetter('userName'), eventVehicles))
     if state == UNIT_RESTRICTION.VEHICLE_NOT_VALID:
         header = i18n.makeString(MENU.HEADERBUTTONS_FIGHTBTN_TOOLTIP_VEHICLENOTVALID_HEADER)
         body = i18n.makeString(MENU.HEADERBUTTONS_FIGHTBTN_TOOLTIP_VEHICLENOTVALID_BODY)
         note = i18n.makeString(MENU.HEADERBUTTONS_FIGHTBTN_TOOLTIP_GROUPNOTREADY_NOTE, vehicles=vehicleNames)
     else:
         header = i18n.makeString(MENU.HEADERBUTTONS_FIGHTBTN_TOOLTIP_GROUPNOTREADY_HEADER)
         body = i18n.makeString(MENU.HEADERBUTTONS_FIGHTBTN_TOOLTIP_GROUPNOTREADY_BODY)
         note = i18n.makeString(MENU.HEADERBUTTONS_FIGHTBTN_TOOLTIP_GROUPNOTREADY_NOTE, vehicles=vehicleNames)
     return {'header': header,
      'body': body,
      'note': text_styles.alert(note)}
コード例 #48
0
 def __getAvailabilityStr(self):
     battle = g_eventsCache.getCompanyBattles()
     if not battle.isValid():
         return
     startTimeLeft = battle.getCreationTimeLeft()
     finishTimeLeft = battle.getDestroyingTimeLeft()
     if startTimeLeft is not None and startTimeLeft > 0:
         if startTimeLeft < time_utils.ONE_DAY:
             return text_styles.alert(i18n.makeString(MENU.HEADERBUTTONS_BATTLE_AVAILABLESINCESOON, time=text_styles.stats(time_formatters.getTimeDurationStr(startTimeLeft, True))))
         else:
             return text_styles.stats(i18n.makeString(MENU.HEADERBUTTONS_BATTLE_AVAILABLESINCE, datetime=self._getDateTimeString(battle.startTime)))
     elif finishTimeLeft is not None and finishTimeLeft > 0:
         if finishTimeLeft < time_utils.ONE_DAY:
             return text_styles.success(i18n.makeString(MENU.HEADERBUTTONS_BATTLE_AVAILABLEUNTILSOON, time=text_styles.stats(time_formatters.getTimeDurationStr(finishTimeLeft, True))))
         else:
             return text_styles.success(i18n.makeString(MENU.HEADERBUTTONS_BATTLE_AVAILABLEUNTIL, datetime=self._getDateTimeString(battle.finishTime)))
コード例 #49
0
 def _buildVO(self):
     from gui.game_control import getRestoreController
     restoreController = getRestoreController()
     deletedTankmen = restoreController.getTankmenBeingDeleted()
     alertImgSrc = ''
     alertText = ''
     alertTooltip = ''
     if not self._tankman.isRestorable():
         alertText = text_styles.alert(icons.alert() + _ms(DIALOGS.PROTECTEDDISMISSTANKMAN_ALERT))
         alertTooltip = TOOLTIPS.DISMISSTANKMANDIALOG_CANTRESTORALERT
     elif len(deletedTankmen) > 0:
         alertImgSrc = RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON
         alertTooltip = makeTooltip(TOOLTIPS.DISMISSTANKMANDIALOG_BUFFERISFULL_HEADER, _ms(TOOLTIPS.DISMISSTANKMANDIALOG_BUFFERISFULL_BODY, placeCount=restoreController.getMaxTankmenBufferLength(), currCount=len(restoreController.getDismissedTankmen()), tankmanNew=self._tankman.fullUserName, tankmanOld=formatDeletedTankmanStr(deletedTankmen[0])))
     return {'alertText': alertText,
      'alertTooltip': alertTooltip,
      'alertImgSrc': alertImgSrc,
      'questionText': text_styles.main(_ms(DIALOGS.DISMISSTANKMAN_MESSAGE))}
コード例 #50
0
    def _getBonuses(self, svrEvents, bonuses = None, useIconFormat = False):
        bonuses = bonuses or self.event.getBonuses()
        result, simpleBonusesList, customizationsList, vehiclesList, iconBonusesList = ([],
         [],
         [],
         [],
         [])
        for b in bonuses:
            if b.isShowInGUI():
                if b.getName() == 'dossier':
                    for record in b.getRecords():
                        if record[0] != ACHIEVEMENT_BLOCK.RARE:
                            result.append(formatters.packAchieveElement(RECORD_DB_IDS[record]))

                elif b.getName() == 'customizations':
                    customizationsList.extend(b.getList())
                elif b.getName() == 'vehicles':
                    flist = b.formattedList()
                    if flist:
                        vehiclesList.extend(flist)
                elif b.hasIconFormat() and useIconFormat:
                    iconBonusesList.extend(b.getList())
                else:
                    flist = b.formattedList()
                    if flist:
                        simpleBonusesList.extend(flist)

        if len(customizationsList):
            result.append(formatters.packCustomizations(customizationsList))
        if len(iconBonusesList):
            result.append(formatters.packIconAwardBonusBlock(iconBonusesList))
        if len(vehiclesList) > 0:
            vehiclesLbl, _ = self._joinUpToMax(vehiclesList)
            result.append(formatters.packVehiclesBonusBlock(vehiclesLbl, str(self.event.getID())))
        if len(simpleBonusesList) > 0:
            result.append(formatters.packSimpleBonusesBlock(simpleBonusesList))
        parents = [ qID for _, qIDs in self.event.getParents().iteritems() for qID in qIDs ]
        for qID, q in self._getEventsByIDs(parents, svrEvents or {}).iteritems():
            result.append(formatters.packTextBlock(i18n.makeString('#quests:bonuses/item/task', q.getUserName()), questID=qID))

        if len(result):
            return formatters.todict(result)
        return formatters.todict([formatters.packTextBlock(text_styles.alert('#quests:bonuses/notAvailable'))])
コード例 #51
0
ファイル: vo_converters.py プロジェクト: kblw/wot_client
def makeSortieShortVO(unitFunctional, unitIdx = None, app = None):
    fullData = unitFunctional.getUnitFullData(unitIdx=unitIdx)
    if fullData is None:
        title = i18n.makeString(FORTIFICATIONS.SORTIE_LISTVIEW_ALERTTEXT_TITLE)
        body = i18n.makeString(FORTIFICATIONS.SORTIE_LISTVIEW_ALERTTEXT_BODY)
        alertView = {'icon': RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON,
         'titleMsg': text_styles.alert(title),
         'bodyMsg': text_styles.main(body),
         'buttonLbl': FORTIFICATIONS.SORTIE_LISTVIEW_ENTERBTN}
        return {'isShowAlertView': True,
         'alertView': alertView}
    unit, unitState, unitStats, pInfo, slotsIter = fullData
    division = getDivisionNameByType(unit.getRosterTypeID())
    divisionTypeStr = i18n.makeString(FORTIFICATIONS.sortie_division_name(division))
    unit, unitState, _, pInfo, slotsIter = fullData
    return {'isFreezed': unitState.isLocked(),
     'hasRestrictions': unit.isRosterSet(ignored=settings.CREATOR_ROSTER_SLOT_INDEXES),
     'slots': _getSlotsData(unitIdx, unit, unitState, pInfo, slotsIter, app, unitFunctional.getRosterSettings().getLevelsRange()),
     'description': divisionTypeStr if divisionTypeStr else unitFunctional.getCensoredComment(unitIdx=unitIdx)}
コード例 #52
0
 def _buildVO(self):
     actionPriceVO = None
     restorePrice, lengthInHours = getTankmenRestoreInfo(self._tankman)
     warningTexts = []
     if restorePrice.credits == 0:
         restoreCurrency = ICON_TEXT_FRAMES.EMPTY
         restorePriceStr = text_styles.success(_ms(DIALOGS.RESTORETANKMAN_FORFREE))
     else:
         restoreCurrency = ICON_TEXT_FRAMES.CREDITS
         restorePriceStr = str(currency.getBWFormatter(Currency.CREDITS)(restorePrice.credits))
         if self._showPeriodEndWarning:
             daysCount = lengthInHours / time_utils.HOURS_IN_DAY
             warningTexts.append(text_styles.alert(_ms(DIALOGS.RESTORETANKMNAN_NEWPERIODWARNING, daysCount=daysCount)))
         if constants.IS_KOREA and restorePrice.gold > 0:
             warningTexts.append(text_styles.standard(DIALOGS.BUYVEHICLEDIALOG_WARNING))
     return {'questionText': text_styles.stats(_ms(DIALOGS.RESTORETANKMAN_PRICE)),
      'restoreCurrency': restoreCurrency,
      'restorePrice': restorePriceStr,
      'isEnoughMoneyForRestore': g_itemsCache.items.stats.money.credits >= restorePrice.credits,
      'actionPriceVO': actionPriceVO,
      'warningText': '\n\n'.join(warningTexts)}
コード例 #53
0
ファイル: questscontrol.py プロジェクト: webiumsk/WOT0.9.10
 def __onQuestsUpdated(self, *args):
     svrEvents = g_eventsCache.getEvents()
     quest_settings.updateCommonEventsSettings(svrEvents)
     btnInfo = _createBtnInfo(QUESTS.QUESTSCONTROL_ADDITIONALTITLE_EMPTY, TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_EMPTY, highlight=False)
     if isPotapovQuestEnabled():
         if not quest_settings.isNeedToShowHeaderAlert():
             quest_settings.markHeaderAlertAsVisited()
             btnInfo = _createBtnInfo(QUESTS.QUESTSCONTROL_ADDITIONALTITLE_FIRSTRUN, TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_NEW)
         elif g_eventsCache.potapov.hasQuestsForReward():
             btnInfo = _createBtnInfo(QUESTS.QUESTSCONTROL_ADDITIONALTITLE_NEEDRECEIVEDAWARD, TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_RECEIVETHEAWARD, alert=True)
         elif g_eventsCache.potapov.hasQuestsForSelect():
             btnInfo = _createBtnInfo(QUESTS.QUESTSCONTROL_ADDITIONALTITLE_FREESLOTSANDFREEQUESTS, TOOLTIPS.PRIVATEQUESTS_QUESTCONTROL_AVAILABLE, alert=True)
     self.as_setDataS({'titleText': QUESTS.QUESTSCONTROL_TITLE,
      'additionalText': text_styles.alert(i18n.makeString(btnInfo.text)),
      'tooltip': btnInfo.tooltip})
     self.as_isShowAlertIconS(btnInfo.alert, btnInfo.highlight)
     premiumIgrVehiclesQuests = g_eventsCache.getQuests(lambda q: q.getStartTimeLeft() <= 0 < q.getFinishTimeLeft() and q.hasPremIGRVehBonus())
     if len(premiumIgrVehiclesQuests):
         storedValue = AccountSettings.getFilter(IGR_PROMO)
         if not storedValue['wasShown']:
             self.fireEvent(events.LoadViewEvent(VIEW_ALIAS.PROMO_PREMIUM_IGR_WINDOW))
コード例 #54
0
 def _packBlocks(self, compensationValue):
     title = TOOLTIPS.FORTIFICATION_POPOVER_DEFRESPROGRESS_HEADER
     items = super(FortPopoverDefResTooltipData, self)._packBlocks()
     items.append(formatters.packTitleDescBlock(text_styles.highTitle(title), desc=text_styles.main(self._descr)))
     if compensationValue is not None:
         blocksGap = 12
         compensationHeader = text_styles.main(TOOLTIPS.FORTIFICATION_POPOVER_DEFRESPROGRESS_COMPENSATION_HEADER) + text_styles.alert('+' + compensationValue) + icons.nut()
         compensationBody = text_styles.standard(TOOLTIPS.FORTIFICATION_POPOVER_DEFRESPROGRESS_COMPENSATION_BODY)
         items.append(formatters.packBuildUpBlockData([formatters.packTextBlockData(text_styles.concatStylesToMultiLine(compensationHeader, compensationBody))], blocksGap, BLOCKS_TOOLTIP_TYPES.TOOLTIP_BUILDUP_BLOCK_WHITE_BG_LINKAGE))
     return items
コード例 #55
0
ファイル: aspects.py プロジェクト: webiumsk/WOT-0.9.15-CT
 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'))
コード例 #56
0
 def __makeData(self):
     baseBuildingMaxLevel = MAX_LEVEL.MAX_BASE_LEVEL_SECOND_ITERATION if self.__isFortBattleAvailable else MAX_LEVEL.MAX_BASE_LEVEL_FIRST_ITERATION
     result = {}
     cndBody = ''
     limits = self.fortCtrl.getLimits()
     canUpgrade, upgradeRestriction = limits.canUpgrade(self.intBuildingID)
     LOG_DEBUG(upgradeRestriction)
     cndPostfix = ''
     isCanModernization = canUpgrade
     conditionIcon = icons.checkmark()
     canUpgradeByDefPeriod = True
     isBaseBuilding = self.__uid == FORTIFICATION_ALIASES.FORT_BASE_BUILDING
     if self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         cndBody = i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_GENERALCONDITION, level=fort_formatters.getTextLevel(self.__buildingLevel + 1))
         if canUpgrade:
             isCanModernization = True
         else:
             isCanModernization = False
         if self.__buildingLevel == MAX_LEVEL.MAX_BUILD_LEVEL:
             if self.__isFortBattleAvailable:
                 cndBody = i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_DEFENCEPERIODANDBASEBUILDING, level=fort_formatters.getTextLevel(self.__buildingLevel + 1))
                 if not self.__defencePeriod or self.__baseBuildingLevel < MAX_LEVEL.MAX_BASE_LEVEL_SECOND_ITERATION:
                     cndPostfix = text_styles.error(i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_NOTFULFILLED))
                     isCanModernization = False
                     canUpgradeByDefPeriod = False
                     conditionIcon = text_styles.standard('-')
             elif self.__buildingLevel == self.__baseBuildingLevel:
                 cndPostfix = text_styles.error(i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_NOTFULFILLED))
         elif self.__buildingLevel == self.__baseBuildingLevel:
             cndPostfix = text_styles.error(i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_NOTFULFILLED))
             isCanModernization = False
     elif self.__buildingLevel == baseBuildingMaxLevel:
         cndBody = i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_BASEBUILDINGFIVELEVEL)
         if not self.__defencePeriod and self.__isFortBattleAvailable:
             cndPostfix = text_styles.error(i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_NOTFULFILLED))
             isCanModernization = False
             canUpgradeByDefPeriod = False
             conditionIcon = text_styles.standard('-')
         elif not self.__isFortBattleAvailable:
             isCanModernization = False
             canUpgradeByDefPeriod = False
             cndBody = text_styles.alert(i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_FORTMAXLEVEL))
             conditionIcon = ''
     prefixBody = text_styles.main(cndBody)
     result['condition'] = prefixBody + cndPostfix
     result['costUpgrade'] = text_styles.defRes(i18n.makeString(FORTIFICATIONS.MODERNIZATION_MODERNIZATIONINFO_COUNTCOST))
     result['intBuildingID'] = self.intBuildingID
     if not canUpgrade and upgradeRestriction != FORT_RESTRICTION.BUILDING_NOT_ENOUGH_RESOURCE:
         conditionIcon = text_styles.standard('-')
     if self._buildingDescr.storage < self.__cost:
         costMsg = text_styles.error(BigWorld.wg_getIntegralFormat(self.__cost))
         constIcon = icons.nut()
         costMsg = costMsg + ' ' + constIcon
     else:
         costMsg = fort_formatters.getDefRes(self.__cost, True)
     result['costValue'] = costMsg
     if cndBody != '':
         result['conditionIcon'] = conditionIcon
     result['canUpgrade'] = isCanModernization
     if not isCanModernization:
         btnToolTip = {}
         if not canUpgradeByDefPeriod and self.__isFortBattleAvailable:
             btnToolTip['header'] = i18n.makeString(TOOLTIPS.FORTIFICATION_MODERNIZATION_NOTACTIVATEDDEFPERIOD_HEADER)
             btnToolTip['body'] = i18n.makeString(i18n.makeString(TOOLTIPS.FORTIFICATION_MODERNIZATION_NOTACTIVATEDDEFPERIOD_BODY))
         else:
             btnToolTip['header'] = i18n.makeString(TOOLTIPS.FORTIFICATION_MODERNIZATION_APPLYBUTTON_HEADER)
             if not self.__isFortBattleAvailable and isBaseBuilding and self.__buildingLevel == baseBuildingMaxLevel:
                 btnToolTip['header'] = i18n.makeString('#tooltips:fortification/popOver/upgradeFoundationBtn_Disabled/header')
                 btnToolTip['body'] = i18n.makeString(FORTIFICATIONS.MODERNIZATION_CONDITIONS_FORTMAXLEVEL)
             elif upgradeRestriction == FORT_RESTRICTION.BUILDING_NOT_ENOUGH_RESOURCE_AND_LOW_LEVEL:
                 btnToolTip['body'] = i18n.makeString(TOOLTIPS.FORTIFICATION_MODERNIZATION_APPLYBUTTON_LOWLEVELANDRESOURCE, baseLevel=fort_formatters.getTextLevel(self.__baseBuildingLevel + 1))
             elif upgradeRestriction == FORT_RESTRICTION.BUILDING_FORT_LEVEL_TOO_LOW:
                 btnToolTip['body'] = i18n.makeString(TOOLTIPS.FORTIFICATION_MODERNIZATION_APPLYBUTTON_LOWBASELEVEL, baseLevel=fort_formatters.getTextLevel(self.__baseBuildingLevel + 1))
             elif upgradeRestriction == FORT_RESTRICTION.BUILDING_NOT_ENOUGH_RESOURCE:
                 btnToolTip['body'] = i18n.makeString(TOOLTIPS.FORTIFICATION_MODERNIZATION_APPLYBUTTON_NETENOUGHRESOURCE)
         result['btnToolTip'] = btnToolTip
     fort = self.fortCtrl.getFort()
     newCount = 0
     resLeft = 0
     orderCount = 0
     if self.__uid != FORTIFICATION_ALIASES.FORT_BASE_BUILDING:
         order = fort.getOrder(self._buildingDescr.typeRef.orderType)
         orderCount = order.count
         newCount, resLeft = fort.recalculateOrder(order.orderID, order.count, order.level, order.level + 1)
     inProcess, _ = fort.getDefenceHourProcessing()
     isDefenceOn = fort.isDefenceHourEnabled() or inProcess
     before = {}
     before['buildingType'] = self.__uid
     before['buildingLevel'] = self.__buildingLevel
     before['buildingIcon'] = FortViewHelper.getMapIconSource(self.__uid, self.__buildingLevel, isDefenceOn=isDefenceOn)
     before['buildingIndicators'] = self.__prepareIndicatorData(isCanModernization, False)
     before['defResInfo'] = self.__prepareOrderInfo(False, orderCount, self.__buildingLevel)
     before['titleText'] = text_styles.middleTitle(i18n.makeString(FORTIFICATIONS.MODERNIZATION_MODERNIZATIONINFO_BEFORELABEL))
     result['beforeUpgradeData'] = before
     after = {}
     after['buildingType'] = self.__uid
     after['buildingLevel'] = self.__buildingLevel + 1
     after['buildingIcon'] = FortViewHelper.getMapIconSource(self.__uid, self.__buildingLevel + 1)
     after['buildingIndicators'] = self.__prepareIndicatorData(isCanModernization, True, resLeft)
     after['defResInfo'] = self.__prepareOrderInfo(True, newCount, self.__buildingLevel + 1)
     after['titleText'] = text_styles.middleTitle(i18n.makeString(FORTIFICATIONS.MODERNIZATION_MODERNIZATIONINFO_AFTERLABEL))
     result['afterUpgradeData'] = after
     return result
コード例 #57
0
 def __makeAdditionalText(self, value):
     return text_styles.alert(value)
コード例 #58
0
 def __stateTextStyleFormatter(self, state):
     if self.__restrictionType in self.__WARNING_UNIT_MESSAGES and self._playerInfo.isReady:
         return ' '.join((icons.makeImageTag(RES_ICONS.MAPS_ICONS_LIBRARY_ALERTICON, vSpace=-3), text_styles.alert(state)))
     if self.__restrictionType not in self.__NOT_CRITICAL_STATES:
         return text_styles.error(state)
     return text_styles.main(state)
コード例 #59
0
    def _prepareAndSetData(self):
        battles = []
        invalidateCbDelay = sys.maxint
        fort = self.fortCtrl.getFort()
        self.__clearCallback()
        for battleItem in self.__applyBattlesFilter(fort.getAttacksIn(timePeriod=time_utils.ONE_DAY)):
            battles.append((battleItem,
             i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERBATTLENAME_CLANBATTLEOFFENCE, clanName=self.__getFmtClanName(battleItem)),
             RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_OFFENCEFUTURE,
             TOOLTIPS.FORTIFICATION_FORTBATTLEDIRECTIONPOPOVER_OFFENSE))

        for battleItem in self.__applyBattlesFilter(fort.getDefencesIn(timePeriod=time_utils.ONE_DAY)):
            battles.append((battleItem,
             i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERBATTLENAME_CLANBATTLEDEFENCE, clanName=self.__getFmtClanName(battleItem)),
             RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_DEFENCEFUTURE,
             TOOLTIPS.FORTIFICATION_FORTBATTLEDIRECTIONPOPOVER_DEFENSE))

        result = []
        for battleItem, descr, icon, typeTip in sorted(battles, key=operator.itemgetter(0)):
            startTime, startTimeLeft = battleItem.getStartTime(), battleItem.getStartTimeLeft()
            fortBattle = fort.getBattle(battleItem.getBattleID())
            if fortBattle is not None:
                startTime, startTimeLeft = fortBattle.getRoundStartTime(), fortBattle.getRoundStartTimeLeft()
                if fortBattle.isBattleRound():
                    startTimeLeft = 0
            if startTimeLeft > time_utils.QUARTER_HOUR:
                invalidateCbDelay = min(invalidateCbDelay, startTimeLeft - time_utils.QUARTER_HOUR)
            elif startTimeLeft > 0:
                invalidateCbDelay = min(invalidateCbDelay, startTimeLeft)
            if startTimeLeft <= 0:
                infoTip = TOOLTIPS.FORTIFICATION_FORTBATTLEDIRECTIONPOPOVER_ISINBATTLE
            else:
                infoTip = ''
            if battleItem.isHot() and startTimeLeft > 0:
                timerData = {'timeBeforeBattle': startTimeLeft,
                 'htmlFormatter': text_styles.alert('###')}
            else:
                timerData = None
            battleHourFmt = i18n.makeString('#fortifications:fortBattleDirectionPopover/battleDurationFmt')
            battleHourLabel = text_styles.main(battleHourFmt % {'prevHour': BigWorld.wg_getShortTimeFormat(startTime),
             'nextHour': BigWorld.wg_getShortTimeFormat(startTime + time_utils.ONE_HOUR)})
            divisionIcon = getDivisionIcon(battleItem.defenderFortLevel, battleItem.attackerFortLevel, determineAlert=battleItem.getType() == BATTLE_ITEM_TYPE.ATTACK)
            result.append({'description': descr,
             'canJoin': battleItem.isHot(),
             'battleInfo': self.__getBattleInfo(startTime, startTimeLeft),
             'battleHour': battleHourLabel,
             'battleTypeIcon': icon,
             'fortBattleID': battleItem.getBattleID(),
             'battleTypeTooltip': typeTip,
             'battleInfoTooltip': infoTip,
             'timer': timerData,
             'divisionIcon': divisionIcon})

        title = i18n.makeString(FORTIFICATIONS.GENERAL_DIRECTION, value=i18n.makeString('#fortifications:General/directionName%d' % self._direction))
        nextBattles = i18n.makeString(FORTIFICATIONS.FORTBATTLEDIRECTIONPOPOVER_COMMINGBATTLES)
        nextBattlesLabel = ''.join((text_styles.standard(nextBattles), text_styles.main(len(result))))
        self.as_setDataS({'title': title,
         'nextBattles': nextBattlesLabel,
         'battlesList': result})
        if invalidateCbDelay != sys.maxint:
            LOG_DEBUG('FortBattleDirectionPopover, load invalidation callback', invalidateCbDelay)
            self.__loadCallback(invalidateCbDelay)
        return