AnimalStatExtension - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

<- Back

AnimalStatExtension allows you to add new entries to the animal stats that appear in the animal info panel (the one that gives you the amounts of meat they produce, their lifespan, etc).

public class AnimalStatExtension : DefModExtension
    {
        public List<string> statToAdd = null;
        public List<string> statValues = null;
        public List<string> statDescriptions = null;
    }

It also allows you to put an image of an animal in its info card

        public bool showImageInInfoCard = false;
        public string ImageToShowInInfoCard = "UI/EmptyImage";

Image is recommended to be 300 x 300 px and have a transparent background.

How to use this code?

As an example of AnimalStatExtension, the Aerofleet in Alpha Animals uses this to display details about its roles and abilities, as well as its art image. All entries point to translatable strings in Languages/English/Keyed/Misc_Gameplay.xml

<modExtensions>
	<li Class="VEF.AnimalBehaviours.AnimalStatExtension">
		<statToAdd>
			<li>AA_SecondaryRole</li>
			<li>AA_PrimaryRole</li>
			<li>AA_RangedAttacks</li>
		</statToAdd>
		<statValues>
			<li>AA_Utility</li>
			<li>AA_Boomer</li>
			<li>AA_No</li>
		</statValues>
		<statDescriptions>
			<li>AA_UtilityPowerDesc</li>
			<li>AA_BoomerDesc</li>
			<li>AA_NoRanged</li>
		</statDescriptions>
		<showImageInInfoCard>true</showImageInInfoCard>
		<ImageToShowInInfoCard>Art/AA_AerofleetArt</ImageToShowInInfoCard>
	</li>
</modExtensions>
⚠️ **GitHub.com Fallback** ⚠️