本文整理汇总了Python中gui.Scaleform.framework.managers.TextManager.TextManager.getText方法的典型用法代码示例。如果您正苦于以下问题:Python TextManager.getText方法的具体用法?Python TextManager.getText怎么用?Python TextManager.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.Scaleform.framework.managers.TextManager.TextManager
的用法示例。
在下文中一共展示了TextManager.getText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getHelpTextAsDicts
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
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}]
示例2: _makeMeta
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
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))
示例3: getRentLeftTimeStr
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
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 ''
示例4: __getActionButtonStateVO
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
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}
示例5: __checkMoney
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
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)
示例6: getList
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
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
示例7: __updateHeader
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
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
示例8: __getExchangeBlockData
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def __getExchangeBlockData(self, resToExchange):
goldStepperTitleStr = i18n.makeString(DIALOGS.CONFIRMEXCHANGEDIALOG_GOLDITEMSSTEPPERTITLE)
goldStepperTitleFmt = TextManager.getText(TEXT_MANAGER_STYLES.MAIN_TEXT, goldStepperTitleStr)
return {'exchangeRateItemsIcon': self._getExchangeRateItemsIcon(),
'goldStepperTitle': goldStepperTitleFmt,
'needItemsIcon': self._getCurrencyIconPath(),
'needItemsStepperTitle': self._getResourceStepperTxt(),
'goldIcon': RES_ICONS.MAPS_ICONS_LIBRARY_GOLDICON_2,
'defaultExchangeRate': self._getDefaultExchangeRate(),
'exchangeRate': self.getExchangeRate(),
'defaultGoldValue': self.__getGoldToExchange(resToExchange),
'goldStepSize': self._getStepSize(),
'maxGoldValue': self._getMaxExchangeValue(),
'goldTextColorId': TEXT_MANAGER_STYLES.GOLD_TEXT,
'itemsTextColorId': self._getColorScheme()}
示例9: makeVO
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def makeVO(self):
item = self._items.getItemByCD(self.getTypeCompDescr())
resToExchange = self._getResourceToExchange()
extraData = None
if item.itemTypeID == GUI_ITEM_TYPE.GUN and item.isClipGun():
extraData = CLIP_ICON_PATH
state, stateMsg = self.__getState(resToExchange)
return {'title': self.getTitle(),
'exchangeBtnText': self.getButtonLabels()[0]['label'],
'cancelBtnText': self.getButtonLabels()[1]['label'],
'state': state,
'lockExchangeMessage': stateMsg,
'iconExtraInfo': extraData,
'iconModuleType': item.itemTypeName,
'icon': self.__getIcon(item) if self.__getIconType(item) == CONFIRM_EXCHANGE_DIALOG_TYPES.VEHICLE_ICON else item.getGUIEmblemID(),
'iconType': self.__getIconType(item),
'itemName': TextManager.getText(TEXT_MANAGER_STYLES.MIDDLE_TITLE, item.userName),
'needItemsText': self.__getResourceToExchangeTxt(resToExchange),
'needGoldText': self.__getGoldToExchangeTxt(resToExchange),
'exchangeBlockData': self.__getExchangeBlockData(resToExchange)}
示例10: _getNotEnoughGoldStateTxt
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def _getNotEnoughGoldStateTxt(self, strGold):
return TextManager.getText(TEXT_MANAGER_STYLES.ERROR_TEXT, self._makeString(I18N_GOLDNOTENOUGHTEXT_KEY.format(self._key), {'gold': strGold}))
示例11: _getNoNeedExchangeStateTxt
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def _getNoNeedExchangeStateTxt(self):
return TextManager.getText(TEXT_MANAGER_STYLES.SUCCESS_TEXT, self._makeString(I18N_EXCHANGENONEEDTEXT_KEY.format(self._key), {}))
示例12: _getResourceStepperTxt
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def _getResourceStepperTxt(self):
return TextManager.getText(TEXT_MANAGER_STYLES.MAIN_TEXT, self._makeString(I18N_NEEDITEMSSTEPPERTITLE_KEY.format(self._key), {}))
示例13: _getExchangeTxt
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def _getExchangeTxt(self, strGold):
return TextManager.getText(TEXT_MANAGER_STYLES.MAIN_TEXT, self._makeString(I18N_NEEDGOLDTEXT_KEY.format(self._key), {'gold': strGold}))
示例14: _getCurrencyTxt
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def _getCurrencyTxt(self, strResource):
return TextManager.getText(TEXT_MANAGER_STYLES.ERROR_TEXT, self._makeString(I18N_NEEDITEMSTEXT_KEY.format(self._key), {'value': strResource}))
示例15: __getGoldValueWithIcon
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import getText [as 别名]
def __getGoldValueWithIcon(self, gold):
formattedGold = BigWorld.wg_getGoldFormat(gold)
return TextManager.getText(TEXT_MANAGER_STYLES.GOLD_TEXT, formattedGold) + TextManager.getIcon(TextIcons.GOLD)