本文整理汇总了Python中gui.Scaleform.framework.managers.TextManager.TextManager类的典型用法代码示例。如果您正苦于以下问题:Python TextManager类的具体用法?Python TextManager怎么用?Python TextManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeBuildingIndicatorsVO
def makeBuildingIndicatorsVO(buildingLevel, progress, hpVal, hpTotalVal, defResVal, maxDefResVal):
textStyle = TextType.DEFRES_TEXT
if progress == FORT_ALIAS.STATE_FOUNDATION_DEF or progress == FORT_ALIAS.STATE_FOUNDATION:
textStyle = TextType.ALERT_TEXT
formattedHpValue = TextManager.reference().getText(textStyle, str(BigWorld.wg_getIntegralFormat(hpVal)))
hpTotalFormatted = str(BigWorld.wg_getIntegralFormat(hpTotalVal)) + ' '
formattedHpTotal = TextManager.reference().concatStyles(((TextType.STANDARD_TEXT, hpTotalFormatted), (TextIcons.NUT_ICON,)))
formattedDefResValue = TextManager.reference().getText(TextType.DEFRES_TEXT, str(BigWorld.wg_getIntegralFormat(defResVal)))
maxDefDerFormatted = str(BigWorld.wg_getIntegralFormat(maxDefResVal)) + ' '
formattedDefResTotal = TextManager.reference().concatStyles(((TextType.STANDARD_TEXT, maxDefDerFormatted), (TextIcons.NUT_ICON,)))
hpProgressLabels = {'currentValue': formattedHpValue,
'totalValue': formattedHpTotal,
'separator': '/'}
storeProgressLabels = {'currentValue': formattedDefResValue,
'totalValue': formattedDefResTotal,
'separator': '/'}
result = {'hpLabel': i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_HPLBL),
'defResLabel': i18n.makeString(FORTIFICATIONS.BUILDINGPOPOVER_INDICATORS_DEFRESLBL),
'hpCurrentValue': hpVal,
'hpTotalValue': hpTotalVal,
'defResCurrentValue': defResVal,
'defResTotalValue': maxDefResVal,
'hpProgressLabels': hpProgressLabels,
'defResProgressLabels': storeProgressLabels}
return result
示例2: getHelpTextAsDicts
def getHelpTextAsDicts(arenaType):
costKill, costFlags = getCosts(arenaType)
flagsHead = __getText(TEXT_MANAGER_STYLES.NEUTRAL_TEXT, FALLOUT.INFOPANEL_GETFLAGS_HEAD)
flagsDescr = __getText(TEXT_MANAGER_STYLES.MAIN_TEXT, FALLOUT.INFOPANEL_GETFLAGS_DESCR)
secretsWinHead = __getText(TEXT_MANAGER_STYLES.NEUTRAL_TEXT, FALLOUT.INFOPANEL_SECRETWIN_HEAD)
formatter = BigWorld.wg_getNiceNumberFormat
scorePatterns = []
if costKill > 0:
costKillText = makeString(FALLOUT.INFOPANEL_SECRETWIN_DESCR_COST, cost=formatter(costKill))
secretsWinDescrFirstPrefixStr = TextManager.getText(TEXT_MANAGER_STYLES.STATUS_WARNING_TEXT, costKillText)
secretsWinDescrFirstStr = __getText(TEXT_MANAGER_STYLES.MAIN_TEXT, FALLOUT.INFOPANEL_SECRETWIN_DESCR_FIRSTSTR)
scorePatterns.append(secretsWinDescrFirstPrefixStr + secretsWinDescrFirstStr)
if costFlags:
costFlagTextPatterns = []
for c in costFlags:
costFlagTextPatterns.append(TextManager.getText(TEXT_MANAGER_STYLES.STATUS_WARNING_TEXT, makeString(FALLOUT.INFOPANEL_SECRETWIN_DESCR_COST, cost=formatter(c))))
secretsWinJoinPattern = TextManager.getText(TEXT_MANAGER_STYLES.MAIN_TEXT, ', ')
secretsWinDescrSecondPrefixStr = secretsWinJoinPattern.join(costFlagTextPatterns)
secretsWinDescrSecondStr = __getText(TEXT_MANAGER_STYLES.MAIN_TEXT, FALLOUT.INFOPANEL_SECRETWIN_DESCR_SECONDSTR)
scorePatterns.append(secretsWinDescrSecondPrefixStr + secretsWinDescrSecondStr)
joinPattern = TextManager.getText(TEXT_MANAGER_STYLES.MAIN_TEXT, ';\n')
secretsWinDescr = __getText(TEXT_MANAGER_STYLES.MAIN_TEXT, FALLOUT.INFOPANEL_SECRETWIN_DESCR) % {'scorePattern': joinPattern.join(scorePatterns)}
repairHead = __getText(TEXT_MANAGER_STYLES.NEUTRAL_TEXT, FALLOUT.INFOPANEL_REPAIR_HEAD)
repairDescr = __getText(TEXT_MANAGER_STYLES.MAIN_TEXT, FALLOUT.INFOPANEL_REPAIR_DESCR)
garageHead = __getText(TEXT_MANAGER_STYLES.NEUTRAL_TEXT, FALLOUT.INFOPANEL_GARAGE_HEAD)
garageDescr = __getText(TEXT_MANAGER_STYLES.MAIN_TEXT, FALLOUT.INFOPANEL_GARAGE_DESCR)
return [{'head': flagsHead,
'descr': flagsDescr},
{'head': secretsWinHead,
'descr': secretsWinDescr},
{'head': repairHead,
'descr': repairDescr},
{'head': garageHead,
'descr': garageDescr}]
示例3: getDefRes
def getDefRes(value, addIcon = True):
valueStr = BigWorld.wg_getIntegralFormat(value)
text = TextManager.reference().getText(TEXT_MANAGER_STYLES.DEFRES_TEXT, valueStr)
if addIcon:
icon = TextManager.reference().getIcon(TextIcons.NUT_ICON)
return text + ' ' + icon
else:
return text
示例4: __checkMoney
def __checkMoney(self):
changeRoleCost = self.__items.shop.changeRoleCost
formattedPrice = BigWorld.wg_getIntegralFormat(changeRoleCost)
actualGold = self.__items.stats.gold
enoughGold = actualGold - changeRoleCost >= 0
textType = TextType.GOLD_TEXT if enoughGold else TextType.ERROR_TEXT
priceString = TextManager.getText(textType, formattedPrice)
priceString += TextManager.getIcon(TextIcons.GOLD)
self.as_setPriceS(priceString, enoughGold)
示例5: _makeMeta
def _makeMeta(self):
item = g_itemsCache.items.getItemByCD(self._unlockCtx.unlockCD)
xpCost = BigWorld.wg_getIntegralFormat(self._costCtx['xpCost'])
freeXp = BigWorld.wg_getIntegralFormat(self._costCtx['freeXP'])
ctx = {'xpCost': TextManager.getText(TextType.EXP_TEXT, xpCost),
'freeXP': TextManager.getText(TextType.EXP_TEXT, freeXp),
'typeString': item.userType,
'userString': item.userName}
if item.itemTypeID == GUI_ITEM_TYPE.VEHICLE:
key = 'confirmUnlockVehicle'
else:
key = 'confirmUnlockItem'
return dialogs.I18nConfirmDialogMeta('confirmUnlock', meta=dialogs.HtmlMessageLocalDialogMeta('html_templates:lobby/dialogs', key, ctx=ctx))
示例6: getRentLeftTimeStr
def getRentLeftTimeStr(localization, rentLeftTime, timeStyle = None, ctx = None):
if ctx is None:
ctx = {}
if rentLeftTime > 0:
if rentLeftTime > time_utils.ONE_DAY:
timeLeft = str(int(math.ceil(float(rentLeftTime) / time_utils.ONE_DAY)))
if timeStyle:
timeLeft = TextManager.getText(timeStyle, timeLeft)
return i18n.makeString((localization % 'days'), days=timeLeft, **ctx)
else:
timeLeft = str(int(math.ceil(float(rentLeftTime) / time_utils.ONE_HOUR)))
if timeStyle:
timeLeft = TextManager.getText(timeStyle, timeLeft)
return i18n.makeString((localization % 'hours'), hours=timeLeft, **ctx)
return ''
示例7: __getActionButtonStateVO
def __getActionButtonStateVO(self):
stateString = ''
unitFunctional = self.unitFunctional
pInfo = unitFunctional.getPlayerInfo()
isInQueue = unitFunctional.getFlags().isInIdle()
isEnabled = g_currentVehicle.isReadyToPrebattle() and not isInQueue
playerReady = pInfo.isReady
if not g_currentVehicle.isPresent():
stateString = i18n.makeString('#cybersport:window/unit/message/vehicleNotSelected')
elif not g_currentVehicle.isReadyToPrebattle():
stateString = i18n.makeString('#cybersport:window/unit/message/vehicleNotValid')
elif not playerReady:
stateString = i18n.makeString(MESSENGER.DIALOGS_SQUAD_MESSAGE_GETREADY)
elif g_eventsCache.isEventEnabled() and self.__isFallout is not None and self.__isFallout != g_currentVehicle.item.isEvent:
stateString = error(MENU.CURRENTVEHICLESTATUS_NOTVALIDVEHICLE)
elif playerReady and not isInQueue:
stateString = i18n.makeString(MESSENGER.DIALOGS_SQUAD_MESSAGE_GETNOTREADY)
stateString = TextManager.getText(TEXT_MANAGER_STYLES.MAIN_TEXT if isEnabled else TEXT_MANAGER_STYLES.ERROR_TEXT, stateString)
if playerReady:
label = CYBERSPORT.WINDOW_UNIT_NOTREADY
else:
label = CYBERSPORT.WINDOW_UNIT_READY
return {'stateString': stateString,
'label': label,
'isEnabled': isEnabled,
'isReady': playerReady}
示例8: __makeMainVO
def __makeMainVO(self):
result = {}
extra = self.unitFunctional.getExtra()
(_, _, arenaTypeID), _ = self.__currentBuilding
_getText = self.app.utilsManager.textManager.getText
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 = _getText(TEXT_MANAGER_STYLES.MAIN_TEXT, arenaType.name)
else:
mapName = ''
infoIcon = self.app.utilsManager.textManager.getIcon(TextIcons.INFO_ICON)
result['headerDescr'] = _getText(TEXT_MANAGER_STYLES.STANDARD_TEXT, 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'] = TextManager.getIcon(TextIcons.ALERT_ICON) + ' ' + TextManager.getText(TEXT_MANAGER_STYLES.ALERT_TEXT, i18n.makeString(FORTIFICATIONS.FORTCLANBATTLEROOM_HEADER_ORDERSDISABLED))
result['ordersDisabledTooltip'] = TOOLTIPS.FORTIFICATION_FORTCLANBATTLEROOM_ORDERSDISABLED_DIVISIONMISMATCH
self.as_setBattleRoomDataS(result)
return
示例9: __getTransportingBuildTooltipData
def __getTransportingBuildTooltipData(self, building):
state = None
headerArgs = {}
bodyArgs = {}
if building is not None:
buildingName = building.userName
if building.isInCooldown():
state = 'cooldown'
timeStr = TextManager.reference().getTimeDurationStr(building.getEstimatedCooldown())
headerArgs = {'buildingName': buildingName}
bodyArgs = {'time': timeStr}
elif not building.hasStorageToExport():
state = 'emptyStorage'
headerArgs = {'buildingName': buildingName}
elif not building.hasSpaceToImport() and self.isOnNextTransportingStep():
state = 'notEmptySpace'
headerArgs = {'buildingName': buildingName}
elif not building.isReady():
state = 'foundation'
else:
state = 'foundation'
if state == 'foundation':
headerArgs = {'buildingName': i18n.makeString(FORTIFICATIONS.BUILDINGS_TROWELLABEL)}
if state is not None:
header = TOOLTIPS.fortification_transporting(state + '/header')
body = TOOLTIPS.fortification_transporting(state + '/body')
return [i18n.makeString(header, **headerArgs), i18n.makeString(body, **bodyArgs)]
else:
return
return
示例10: makeSimpleClanListRenderVO
def makeSimpleClanListRenderVO(member, intTotalMining, intWeekMining, role, roleID):
week = BigWorld.wg_getIntegralFormat(intWeekMining)
week = TextManager.reference().getText(TextType.DEFRES_TEXT, week)
allTime = BigWorld.wg_getIntegralFormat(intTotalMining)
allTime = TextManager.reference().getText(TextType.DEFRES_TEXT, allTime)
databaseID = member.getID()
return {'dbID': databaseID,
'uid': databaseID,
'himself': bool(BigWorld.player().databaseID == databaseID),
'userName': member.getName(),
'playerRole': role,
'playerRoleID': roleID,
'thisWeek': week,
'allTime': allTime,
'intWeekMining': intWeekMining,
'intTotalMining': intTotalMining,
'fullName': member.getFullName()}
示例11: getBuildingTooltipBody
def getBuildingTooltipBody(self, hpVal, maxHpValue, defResVal, maxDefResValue):
nutIcon = ' ' + TextManager.reference().getIcon(TextIcons.NUT_ICON)
labelOne = i18n.makeString(FORTIFICATIONS.BUILDINGS_BUILDINGTOOLTIP_STRENGTH)
labelTwo = i18n.makeString(FORTIFICATIONS.BUILDINGS_BUILDINGTOOLTIP_STORE)
fstLine = labelOne + self.__toFormattedStr(hpVal) + '/' + self.__toFormattedStr(maxHpValue) + nutIcon
secLine = labelTwo + self.__toFormattedStr(defResVal) + '/' + self.__toFormattedStr(maxDefResValue) + nutIcon
toolTipData = fstLine + secLine
return toolTipData
示例12: getList
def getList(self):
result = []
for item in self.getCustomizations():
itemType = item.get('custType')
itemId = item.get('id', (-1, -1))
boundVehicle = item.get('vehTypeCompDescr', None)
boundToCurrentVehicle = item.get('boundToCurrentVehicle', False)
nationId = 0
texture = ''
res = ''
if itemType == CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE_TYPE:
customization = vehicles.g_cache.customization(itemId[0])
camouflages = customization.get('camouflages', {})
camouflage = camouflages.get(itemId[1], None)
if camouflage:
armorColor = customization.get('armorColor', 0)
texture = self._makeTextureUrl(67, 67, camouflage.get('texture'), camouflage.get('colors', (0, 0, 0, 0)), armorColor)
nationId, itemId = itemId
elif itemType == CUSTOMIZATION_ITEM_TYPE.EMBLEM_TYPE:
_, emblems, _ = vehicles.g_cache.playerEmblems()
emblem = emblems.get(itemId, None)
if emblem:
texture = emblem[2]
res = {'id': itemId,
'type': CUSTOMIZATION_ITEM_TYPE.EMBLEM,
'nationId': 0,
'texture': texture}
elif itemType == CUSTOMIZATION_ITEM_TYPE.INSCRIPTION_TYPE:
customization = vehicles.g_cache.customization(itemId[0])
inscriptions = customization.get(CUSTOMIZATION_ITEM_TYPE.INSCRIPTION_TYPE, {})
inscription = inscriptions.get(itemId[1], None)
if inscription:
texture = inscription[2]
nationId, itemId = itemId
if texture.startswith('gui'):
texture = texture.replace('gui', '..', 1)
isPermanent = item.get('isPermanent', False)
value = item.get('value', 0)
valueStr = None
if not isPermanent:
value *= 86400
elif value > 1:
valueStr = TextManager.getText(message=i18n.makeString(QUESTS.BONUSES_CUSTOMIZATION_VALUE, count=value))
res = {'id': itemId,
'type': CUSTOMIZATION_ITEM_TYPE.CI_TYPES.index(itemType),
'nationId': nationId,
'texture': texture,
'isPermanent': isPermanent,
'value': value,
'valueStr': valueStr,
'boundVehicle': boundVehicle,
'boundToCurrentVehicle': boundToCurrentVehicle}
result.append(res)
return result
示例13: __updateHeader
def __updateHeader(self):
isCreator = self.unitFunctional.getPlayerInfo().isCreator() if self.unitFunctional is not None else False
club = self.clubsCtrl.getClub(self.__clubDBID)
hasRankForModeChange = club is not None and club.getPermissions().canSetRanked()
seasonActive = isSeasonInProgress()
modeLabel = ''
modeTooltip = ''
modeTextStyle = TEXT_MANAGER_STYLES.STANDARD_TEXT
if not seasonActive:
modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_NOSEASON
modeTooltip = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_NOSEASONTOOLTIP
elif isCreator:
if not hasRankForModeChange:
modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_LOWRANK
modeTooltip = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_LOWRANKTOOLTIP
elif self.__extra.isRatedBattle:
modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_SETUNRANKEDMODE
else:
modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_SETRANKEDMODE
elif self.__extra.isRatedBattle:
modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_RANKEDMODE
modeTextStyle = TEXT_MANAGER_STYLES.NEUTRAL_TEXT
else:
modeLabel = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_WRONGROLE
modeTooltip = CYBERSPORT.STATICFORMATION_UNITVIEW_MODECHANGEWARNING_WRONGROLETOOLTIP
bgSource = RES_ICONS.MAPS_ICONS_LIBRARY_CYBERSPORT_LEAGUERIBBONS_UNRANKED
battles = self.ABSENT_VALUES
winRate = self.ABSENT_VALUES
leagueIcon = getLadderChevron64x64()
enableWinRateTF = False
if club is not None:
clubTotalStats = club.getTotalDossier().getTotalStats()
battles = BigWorld.wg_getNiceNumberFormat(clubTotalStats.getBattlesCount())
division = club.getLadderInfo().division
leagueIcon = getLadderChevron64x64(division)
winRateValue = ProfileUtils.getValueOrUnavailable(clubTotalStats.getWinsEfficiency())
if winRateValue != ProfileUtils.UNAVAILABLE_VALUE:
enableWinRateTF = True
winRate = ProfileUtils.formatFloatPercent(winRateValue)
else:
winRate = self.ABSENT_VALUES
if self.__extra.isRatedBattle:
bgSource = getLadderBackground(division)
self.requestClubEmblem64x64(club.getClubDbID(), club.getEmblem64x64())
self.as_setHeaderDataS({'teamName': self.__extra.clubName,
'isRankedMode': bool(self.__extra.isRatedBattle),
'battles': battles,
'winRate': winRate,
'enableWinRateTF': enableWinRateTF,
'leagueIcon': leagueIcon,
'isFixedMode': not seasonActive or not isCreator,
'modeLabel': TextManager.getText(modeTextStyle, _ms(modeLabel)),
'modeTooltip': modeTooltip,
'bgSource': bgSource})
return
示例14: getHangarMessage
def getHangarMessage(self):
if self.isPresent():
state, stateLvl = self.item.getState()
if state == Vehicle.VEHICLE_STATE.IN_PREMIUM_IGR_ONLY:
localization = '#menu:vehicle/igrRentLeft/%s'
rentLeftStr = getRentLeftTimeStr(localization, self.item.rentLeftTime)
icon = TextManager.getIcon(TextIcons.PREMIUM_IGR_BIG)
message = i18n.makeString('#menu:currentVehicleStatus/' + state, icon=icon, time=rentLeftStr)
return (state, message, stateLvl)
return (state, '#menu:currentVehicleStatus/' + state, stateLvl)
return ('notpresent', MENU.CURRENTVEHICLESTATUS_NOTPRESENT, Vehicle.VEHICLE_STATE_LEVEL.CRITICAL)
示例15: __reSubHandler
def __reSubHandler(cls, match):
try:
arenaUniqueID, arenaTypeID, vehTypeCompDescr, xp, _ = unpackPostBattleUniqueSubUrl(match.group(3))
return g_settings.htmlTemplates.format('postBattleSharingLink', {'linkCode': pickle.dumps((arenaUniqueID, match.group(2))),
'arena': functions.getArenaShortName(arenaTypeID),
'vehicle': Vehicle(typeCompDescr=vehTypeCompDescr).shortUserName,
'xp': BigWorld.wg_getIntegralFormat(xp),
'arrowButton': TextManager.getIcon(TextIcons.ARROW_BUTTON)})
except:
LOG_DEBUG('Invalid post battle results in message', match)
LOG_CURRENT_EXCEPTION()
return match.group()