def _status(i18nKey, style, icon = None):
    message = CLANS.clanprofile_summaryview_statusmsg(i18nKey)
    if icon is not None:
        message = i18n.makeString(message, icon=icons.makeImageTag(icon, 16, 16, -4, 0))
    else:
        message = i18n.makeString(message)
    return style(message)
예제 #2
0
def _status(i18nKey, style, icon = None):
    message = CLANS.clanprofile_summaryview_statusmsg(i18nKey)
    if icon is not None:
        message = i18n.makeString(message, icon=icons.makeImageTag(icon, 16, 16, -4, 0))
    else:
        message = i18n.makeString(message)
    return style(message)
예제 #3
0
    def __makeStatsBlock(self, listValues):
        lst = []
        for item in listValues:
            flag = item.get('flag', None)
            if flag is not None and not bool(self.__stateMask & flag):
                continue
            localKey = item.get('local', None)
            value = item.get('value', None)
            isTimeExpired = item.get('timeExpired', False)
            tooltipBody = item.get('tooltip', None)
            textStyle = item.get('textStyle', None)
            isHidden = item.get('isHidden', None)
            isUseTextStylePattern = textStyle is not None
            valueStyle = text_styles.stats
            localKey = i18n.makeString(
                CLANS.clanprofile_summaryview_blocklbl(localKey))
            tooltipHeader = localKey
            if isTimeExpired:
                valueStyle = text_styles.standard
                tooltipBody = CLANS.CLANPROFILE_SUMMARYVIEW_TOOLTIP_RATINGOUTDATED_BODY
            elif tooltipBody is None:
                tooltipBody = None
                tooltipHeader = None
            if not isinstance(value, str):
                value = BigWorld.wg_getIntegralFormat(value)
            icon = item.get('icon', None)
            if icon is not None:
                icon = icons.makeImageTag(icon, 16, 16, -4, 0)
                value = icon + ' ' + value
            if isUseTextStylePattern:
                truncateVo = {
                    'isUseTruncate': isUseTextStylePattern,
                    'textStyle': textStyle,
                    'maxWidthTF': 140
                }
            else:
                truncateVo = None
            lst.append({
                'label':
                text_styles.main(localKey),
                'value':
                valueStyle(str(value)) if not isUseTextStylePattern else value,
                'tooltipHeader':
                tooltipHeader,
                'tooltipBody':
                i18n.makeString(tooltipBody)
                if tooltipBody is not None else '',
                'isUseTextStyle':
                isUseTextStylePattern,
                'truncateVo':
                truncateVo,
                'isHidden':
                isHidden
            })

        return lst
    def __makeStatsBlock(self, listValues):
        lst = []
        for item in listValues:
            flag = item.get('flag', None)
            if flag is not None and not bool(self.__stateMask & flag):
                continue
            localKey = item.get('local', None)
            value = item.get('value', None)
            isTimeExpired = item.get('timeExpired', False)
            tooltipBody = item.get('tooltip', None)
            textStyle = item.get('textStyle', None)
            isUseTextStylePattern = textStyle is not None
            valueStyle = text_styles.stats
            localKey = i18n.makeString(CLANS.clanprofile_summaryview_blocklbl(localKey))
            tooltipHeader = localKey
            if isTimeExpired:
                valueStyle = text_styles.standard
                tooltipBody = CLANS.CLANPROFILE_SUMMARYVIEW_TOOLTIP_RATINGOUTDATED_BODY
            elif tooltipBody is None:
                tooltipBody = None
                tooltipHeader = None
            if not isinstance(value, str):
                value = BigWorld.wg_getIntegralFormat(value)
            icon = item.get('icon', None)
            if icon is not None:
                icon = icons.makeImageTag(icon, 16, 16, -4, 0)
                value = icon + ' ' + value
            if isUseTextStylePattern:
                truncateVo = {'isUseTruncate': isUseTextStylePattern,
                 'textStyle': textStyle,
                 'maxWidthTF': 140}
            else:
                truncateVo = None
            lst.append({'label': text_styles.main(localKey),
             'value': valueStyle(str(value)) if not isUseTextStylePattern else value,
             'tooltipHeader': tooltipHeader,
             'tooltipBody': i18n.makeString(tooltipBody) if tooltipBody is not None else '',
             'isUseTextStyle': isUseTextStylePattern,
             'truncateVo': truncateVo})

        return lst