Display Severity - KonradHeinser/EBSGFramework GitHub Wiki
Sometimes a hediff's label is intended to just store things like a number of charges or the amount of progress made. This allows you to add this information to the end of the description instead to make it easier to convey this information without needing a bunch of stage labels. The basic comp doesn't technically need anything else, but would just display the severity rounded to 3 digits past the decimal:
<comps>
<li Class="EBSGFramework.HediffCompProperties_DisplaySeverity">
</li>
</comps>
Tags available for customizing the output line:
- postFactor : Default (1) : The multiplier used on the severity for the displayed number. If this display is intended to show a % progress and the hediff's maxSeverity isn't 100, put 100 / maxSeverity into a calculator, and the output is the factor you want
- roundDigits : Default (3) : The number of digits after the decimal place. If 0, there is no decimal, and if negative it will start rounding to leave a number of 0s equal to the negative number
- prependString : The text before the number. Any spaces after this need to be manually included
- appendString : The text after the number. Any spaces before this need to be manually included
Example from SHG - Just the Radiomancer. The ever evolving hediffs use a severity from 0 to 100 to assign bonuses, but instead of making special labels for the dozen of stages to let people know how close they are to the maximum, this is used to add the progress to the description (i.e. Evolution progress : 50%)
<HediffDef Name="SHG_EverEvolvingBase" Abstract="True">
<everCurableByItem>false</everCurableByItem>
<initialSeverity>1</initialSeverity>
<hediffClass>HediffWithComps</hediffClass>
<scenarioCanAdd>false</scenarioCanAdd>
<maxSeverity>100</maxSeverity>
<comps>
<li Class="EBSGFramework.HediffCompProperties_DisplaySeverity">
<prependString>Evolution progress : </prependString>
<appendString>%</appendString>
<roundDigits>0</roundDigits>
</li>
</comps>
</HediffDef>