コード例 #1
0
    def __getCommonStatsBlock(self, vehicle):
        _params = {VEHICLE_CLASS_NAME.LIGHT_TANK: ('enginePowerPerTon',
                                         'speedLimits',
                                         WHEELED_SPEED_MODE_SPEED,
                                         'chassisRotationSpeed',
                                         'circularVisionRadius',
                                         MAX_STEERING_LOCK_ANGLE,
                                         WHEELED_SWITCH_ON_TIME,
                                         WHEELED_SWITCH_OFF_TIME),
         VEHICLE_CLASS_NAME.MEDIUM_TANK: ('avgDamagePerMinute',
                                          'enginePowerPerTon',
                                          'speedLimits',
                                          'chassisRotationSpeed',
                                          TURBOSHAFT_SPEED_MODE_SPEED,
                                          TURBOSHAFT_ENGINE_POWER),
         VEHICLE_CLASS_NAME.HEAVY_TANK: ('avgDamage',
                                         'avgPiercingPower',
                                         'hullArmor',
                                         'turretArmor',
                                         DUAL_GUN_CHARGE_TIME),
         VEHICLE_CLASS_NAME.SPG: ('avgDamage', 'stunMinDuration', 'stunMaxDuration', 'reloadTimeSecs', 'aimingTime', 'explosionRadius'),
         VEHICLE_CLASS_NAME.AT_SPG: ('avgPiercingPower', 'shotDispersionAngle', 'avgDamagePerMinute', 'speedLimits', 'chassisRotationSpeed', 'switchOnTime', 'switchOffTime'),
         'default': ('speedLimits', 'enginePower', 'chassisRotationSpeed')}
        block = []
        paramsDict = params_helper.getParameters(vehicle)
        comparator = params_helper.idealCrewComparator(vehicle)
        for paramName in _params.get(vehicle.type, 'default'):
            if paramName in paramsDict:
                paramInfo = comparator.getExtendedData(paramName)
                fmtValue = param_formatter.colorizedFormatParameter(paramInfo, None)
                if fmtValue is not None:
                    block.append(formatters.packTextParameterBlockData(name=param_formatter.formatVehicleParamName(paramName), value=fmtValue, valueWidth=80, padding=formatters.packPadding(left=-1)))

        return block
コード例 #2
0
ファイル: tooltipsvehicle.py プロジェクト: Difrex/wotsdk
    def construct(self):
        paramsDict = dict(params_helper.getParameters(self.vehicle))
        block = []
        comparator = params_helper.idealCrewComparator(self.vehicle)
        if self.configuration.params and not self.configuration.simplifiedOnly:
            for paramName in self.PARAMS.get(self.vehicle.type, 'default'):
                if paramName in paramsDict:
                    paramInfo = comparator.getExtendedData(paramName)
                    fmtValue = param_formatter.colorizedFormatParameter(
                        paramInfo, param_formatter.BASE_FORMATTERS)
                    if fmtValue is not None:
                        block.append(
                            formatters.packTextParameterBlockData(
                                name=param_formatter.formatVehicleParamName(
                                    paramName),
                                value=fmtValue,
                                valueWidth=self._valueWidth,
                                padding=formatters.packPadding(left=-1)))

        if len(block) > 0:
            title = text_styles.middleTitle(
                TOOLTIPS.VEHICLEPARAMS_COMMON_TITLE)
            block.insert(
                0,
                formatters.packTextBlockData(
                    title, padding=formatters.packPadding(bottom=8)))
        return block
コード例 #3
0
ファイル: vehicle.py プロジェクト: webiumsk/WOT-0.9.15.1
    def construct(self):
        paramsDict = dict(params_helper.getParameters(self.vehicle))
        block = []
        comparator = params_helper.idealCrewComparator(self.vehicle)
        if self.configuration.params:
            for paramName in self.PARAMS.get(self.vehicle.type, 'default'):
                if paramName in paramsDict:
                    paramInfo = comparator.getExtendedData(paramName)
                    fmtValue = param_formatter.colorizedFormatParameter(paramInfo, param_formatter.BASE_FORMATTERS)
                    if fmtValue is not None:
                        block.append(formatters.packTextParameterBlockData(name=param_formatter.formatVehicleParamName(paramName), value=fmtValue, valueWidth=self._valueWidth, padding=formatters.packPadding(left=-1)))

        if len(block) > 0:
            title = text_styles.middleTitle(TOOLTIPS.VEHICLEPARAMS_COMMON_TITLE)
            block.insert(0, formatters.packTextBlockData(title, padding=formatters.packPadding(bottom=8)))
        return block
コード例 #4
0
ファイル: vehicle.py プロジェクト: kusaku/wot_scripts
    def construct(self):
        block = []
        if self.configuration.params:
            comparator = params_helper.idealCrewComparator(self.vehicle)
            stockParams = params_helper.getParameters(self.itemsCache.items.getStockVehicle(self.vehicle.intCD))
            for paramName in RELATIVE_PARAMS:
                paramInfo = comparator.getExtendedData(paramName)
                fmtValue = param_formatter.colorizedFormatParameter(paramInfo, param_formatter.NO_BONUS_SIMPLIFIED_SCHEME)
                if fmtValue is not None:
                    buffIconSrc = ''
                    if self.vehicle.isInInventory:
                        buffIconSrc = param_formatter.getGroupPenaltyIcon(paramInfo, comparator)
                    block.append(formatters.packStatusDeltaBlockData(title=param_formatter.formatVehicleParamName(paramName), valueStr=fmtValue, statusBarData=SimplifiedBarVO(value=paramInfo.value, markerValue=stockParams[paramName]), buffIconSrc=buffIconSrc, padding=formatters.packPadding(left=74, top=8)))

        if block:
            block.insert(0, formatters.packTextBlockData(text_styles.middleTitle(_ms(TOOLTIPS.VEHICLEPARAMS_SIMPLIFIED_TITLE)), padding=formatters.packPadding(top=-4)))
        return block
コード例 #5
0
ファイル: vehicle.py プロジェクト: webiumsk/WOT-0.9.15.1
    def construct(self):
        block = []
        comparator = params_helper.idealCrewComparator(self.vehicle)
        stockParams = params_helper.getParameters(g_itemsCache.items.getStockVehicle(self.vehicle.intCD))
        for paramName in RELATIVE_PARAMS:
            paramInfo = comparator.getExtendedData(paramName)
            fmtValue = param_formatter.simlifiedVehicleParameter(paramInfo)
            if fmtValue is not None:
                block.append(formatters.packStatusDeltaBlockData(title=param_formatter.formatVehicleParamName(paramName), valueStr=fmtValue, statusBarData={'value': paramInfo.value,
                 'delta': 0,
                 'minValue': 0,
                 'markerValue': stockParams[paramName],
                 'maxValue': MAX_RELATIVE_VALUE,
                 'useAnim': False}, showDecreaseArrow=any((penalty[1] != 0 for penalty in paramInfo.penalties)), padding=formatters.packPadding(left=74, top=8)))

        if len(block) > 0:
            block.insert(0, formatters.packTextBlockData(text_styles.middleTitle(_ms(TOOLTIPS.VEHICLEPARAMS_SIMPLIFIED_TITLE)), padding=formatters.packPadding(top=-4)))
        return block
コード例 #6
0
ファイル: tooltipsvehicle.py プロジェクト: Difrex/wotsdk
    def construct(self):
        block = []
        if self.configuration.params:
            comparator = params_helper.idealCrewComparator(self.vehicle)
            stockParams = params_helper.getParameters(
                g_itemsCache.items.getStockVehicle(self.vehicle.intCD))
            for paramName in RELATIVE_PARAMS:
                paramInfo = comparator.getExtendedData(paramName)
                fmtValue = param_formatter.simplifiedVehicleParameter(
                    paramInfo)
                if fmtValue is not None:
                    buffIconSrc = ''
                    if self.vehicle.isInInventory:
                        buffIconSrc = params_helper.getBuffIcon(
                            paramInfo, comparator)
                    block.append(
                        formatters.packStatusDeltaBlockData(
                            title=param_formatter.formatVehicleParamName(
                                paramName),
                            valueStr=fmtValue,
                            statusBarData={
                                'value': paramInfo.value,
                                'delta': 0,
                                'minValue': 0,
                                'markerValue': stockParams[paramName],
                                'maxValue': MAX_RELATIVE_VALUE,
                                'useAnim': False
                            },
                            buffIconSrc=buffIconSrc,
                            padding=formatters.packPadding(left=74, top=8)))

        if len(block) > 0:
            block.insert(
                0,
                formatters.packTextBlockData(
                    text_styles.middleTitle(
                        _ms(TOOLTIPS.VEHICLEPARAMS_SIMPLIFIED_TITLE)),
                    padding=formatters.packPadding(top=-4)))
        return block
コード例 #7
0
ファイル: tooltipsvehicle.py プロジェクト: aevitas/wotsdk
    def construct(self):
        block = []
        if self.configuration.params:
            comparator = params_helper.idealCrewComparator(self.vehicle)
            stockParams = params_helper.getParameters(g_itemsCache.items.getStockVehicle(self.vehicle.intCD))
            for paramName in RELATIVE_PARAMS:
                paramInfo = comparator.getExtendedData(paramName)
                fmtValue = param_formatter.simplifiedVehicleParameter(paramInfo)
                if fmtValue is not None:
                    buffIconSrc = ""
                    if self.vehicle.isInInventory:
                        buffIconSrc = params_helper.getBuffIcon(paramInfo, comparator)
                    block.append(
                        formatters.packStatusDeltaBlockData(
                            title=param_formatter.formatVehicleParamName(paramName),
                            valueStr=fmtValue,
                            statusBarData={
                                "value": paramInfo.value,
                                "delta": 0,
                                "minValue": 0,
                                "markerValue": stockParams[paramName],
                                "maxValue": MAX_RELATIVE_VALUE,
                                "useAnim": False,
                            },
                            buffIconSrc=buffIconSrc,
                            padding=formatters.packPadding(left=74, top=8),
                        )
                    )

        if len(block) > 0:
            block.insert(
                0,
                formatters.packTextBlockData(
                    text_styles.middleTitle(_ms(TOOLTIPS.VEHICLEPARAMS_SIMPLIFIED_TITLE)),
                    padding=formatters.packPadding(top=-4),
                ),
            )
        return block
コード例 #8
0
 def getComparator(self):
     return params_helper.idealCrewComparator(g_currentVehicle.item)
コード例 #9
0
ファイル: contexts.py プロジェクト: webiumsk/WOT-0.9.15-CT
 def getComparator(self):
     return params_helper.idealCrewComparator(g_currentVehicle.item)
コード例 #10
0
 def _getComparator(self):
     return params_helper.idealCrewComparator(self._cache.item)
コード例 #11
0
 def getComparator(self):
     return params_helper.idealCrewComparator(g_tankSetupVehicle.item)
コード例 #12
0
 def _getComparator(self):
     return params_helper.idealCrewComparator(self._cache.item)