本文整理汇总了Python中gui.Scaleform.framework.managers.TextManager.TextManager.reference方法的典型用法代码示例。如果您正苦于以下问题:Python TextManager.reference方法的具体用法?Python TextManager.reference怎么用?Python TextManager.reference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.Scaleform.framework.managers.TextManager.TextManager
的用法示例。
在下文中一共展示了TextManager.reference方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeBuildingIndicatorsVO
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
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: getDefRes
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
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
示例3: __getTransportingBuildTooltipData
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
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
示例4: makeSimpleClanListRenderVO
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
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()}
示例5: getBuildingTooltipBody
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
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
示例6: makeSortieShortVO
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
def makeSortieShortVO(unitFunctional, unitIdx = None, app = None):
fullData = unitFunctional.getUnitFullData(unitIdx=unitIdx)
if fullData is None:
textMgr = TextManager.reference()
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': textMgr.getText(TextType.ALERT_TEXT, title),
'bodyMsg': textMgr.getText(TextType.MAIN_TEXT, 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)}
示例7: getCommonBuildTooltipData
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
def getCommonBuildTooltipData(self, buildingDescr):
hpVal = 0
maxHpValue = 0
defResVal = 0
maxDefResValue = 0
orderTooltipData = None
if buildingDescr is not None:
hpVal = buildingDescr.hp
maxHpValue = buildingDescr.levelRef.hp
defResVal = buildingDescr.storage
maxDefResValue = buildingDescr.levelRef.storage
if buildingDescr.orderInProduction:
if self._isProductionInPause(buildingDescr):
orderTooltipData = '\n' + i18n.makeString(TOOLTIPS.FORTIFICATION_ORDERPROCESS_INPAUSE)
else:
order = self.fortCtrl.getFort().getOrder(self.fortCtrl.getFort().getBuildingOrder(buildingDescr.typeID))
orderTime = TextManager.reference().getTimeDurationStr(order.getProductionLeftTime())
orderTooltipData = i18n.makeString(FORTIFICATIONS.BUILDINGS_BUILDINGTOOLTIP_ORDER, order.productionCount, orderTime)
toolTipData = self.getBuildingTooltipBody(hpVal, maxHpValue, defResVal, maxDefResValue)
if orderTooltipData is not None:
toolTipData += orderTooltipData
return toolTipData
示例8: makeSortieVO
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
def makeSortieVO(unitFunctional, unitIdx = None, app = None):
fullData = unitFunctional.getUnitFullData(unitIdx=unitIdx)
if fullData is None:
return {}
(unit, unitState, unitStats, pInfo, slotsIter,) = fullData
division = getDivisionNameByType(unit.getRosterTypeID())
divisionTypeStr = i18n.makeString(FORTIFICATIONS.sortie_division_name(division))
divisionStr = i18n.makeString(FORTIFICATIONS.SORTIE_ROOM_DIVISION)
divisionLbl = TextManager.reference().concatStyles(((TextType.STANDARD_TEXT, divisionStr), (TextType.MAIN_TEXT, divisionTypeStr)))
isPlayerCreator = pInfo.isCreator()
(canDoAction, restriction,) = unitFunctional.validateLevels(stats=unitStats)
sumLevelsStr = makeTotalLevelLabel(unitStats, restriction)
return {'isCommander': isPlayerCreator,
'isFreezed': unitState.isLocked(),
'hasRestrictions': unit.isRosterSet(ignored=settings.CREATOR_ROSTER_SLOT_INDEXES),
'statusLbl': makeUnitStateLabel(unitState),
'statusValue': unitState.isOpened(),
'sumLevelsInt': unitStats.curTotalLevel,
'sumLevels': sumLevelsStr,
'sumLevelsError': canDoAction,
'slots': _getSlotsData(unitIdx, unit, unitState, pInfo, slotsIter, app, unitFunctional.getRosterSettings().getLevelsRange()),
'description': unitFunctional.getCensoredComment(unitIdx=unitIdx),
'divisionLbl': divisionLbl}
示例9: getDefResWithText
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
def getDefResWithText(mainTextValue, defResValue, addIcon):
mainText = TextManager.reference().getText(TEXT_MANAGER_STYLES.MAIN_TEXT, mainTextValue)
defResText = getDefRes(defResValue, addIcon)
return mainText + defResText
示例10: getBonusText
# 需要导入模块: from gui.Scaleform.framework.managers.TextManager import TextManager [as 别名]
# 或者: from gui.Scaleform.framework.managers.TextManager.TextManager import reference [as 别名]
def getBonusText(strValue, buildingID, textsStyle = None, ctx = None):
ctx = ctx or {}
textsStyle = textsStyle or (TEXT_MANAGER_STYLES.NEUTRAL_TEXT, TEXT_MANAGER_STYLES.MAIN_TEXT)
descrStr = i18n.makeString(FORTIFICATIONS.buildings_defresinfo(buildingID), **ctx)
resultDescr = TextManager.reference().concatStyles(((textsStyle[0], strValue + ' ' if strValue else ''), (textsStyle[1], descrStr)))
return resultDescr