def construct(self): blocks = [] for parameter in params_formatters.getRelativeDiffParams( self.__comparator): delta = parameter.state[1] value = parameter.value if delta > 0: value -= delta blocks.append( formatters.packStatusDeltaBlockData( title=text_styles.middleTitle( MENU.tank_params(parameter.name)), valueStr=params_formatters.simplifiedDeltaParameter( parameter), statusBarData=SimplifiedBarVO( value=value, delta=delta, markerValue=self.__stockParams[parameter.name]), padding=self.__padding)) return blocks
def _makeSimpleParamBottomVO(self, param, vehIntCD=None): stockParams = getParameters( self.itemsCache.items.getStockVehicle(vehIntCD)) data = getCommonParam( HANGAR_ALIASES.VEH_PARAM_RENDERER_STATE_SIMPLE_BOTTOM, param.name) delta = 0 state, diff = param.state if state == PARAM_STATE.WORSE: delta = -abs(diff) data.update({ 'isEnabled': True, 'tooltip': self._tooltipType, 'indicatorVO': SimplifiedBarVO(value=param.value, delta=delta, markerValue=stockParams[param.name], useAnim=self.useAnim) }) return data
def construct(self): block = [] if self.configuration.params: for parameter in params_formatters.getRelativeDiffParams( self.__comparator): delta = parameter.state[1] value = parameter.value if delta > 0: value -= delta block.append( formatters.packStatusDeltaBlockData( title=text_styles.middleTitle( MENU.tank_params(parameter.name)), valueStr=params_formatters.simlifiedDeltaParameter( parameter, self.__isSituational), statusBarData=SimplifiedBarVO( value=value, delta=delta, markerValue=self.__stockParams[parameter.name], isOptional=self.__isSituational), padding=formatters.packPadding(left=105, top=8))) return block
def extendBlocks(cls, blocks, curEq, compareEq, eqsRange, param, title, higherIsBetter=True): value, delta, maxValue = cls._getDisplayParams(curEq, compareEq, eqsRange, param) tmpVal = value + (delta if delta < 0 else 0) progressBar = SimplifiedBarVO(value=tmpVal, delta=delta, markerValue=value) progressBar['maxValue'] = maxValue blocks.append(formatters.packStatusDeltaBlockData(title=text_styles.middleTitle(title), valueStr=cls._formatDeltaString(delta, value + delta, higherIsBetter), statusBarData=progressBar, padding=formatters.packPadding(left=85, top=0)))
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