Mod Culture Data - ilikegoodfood/CommunityLib GitHub Wiki

Mod Culture Data (WIP)

The Community Library offers mods that add new cultures to the game, the ability to alsomake culture specific graphics for minor human settlements.

All of this data is passed to the Community Library within the CommunityLib.ModCultureData class, using the registerModCultureData function in the Community Library's mod kernel.

public void registerModCultureData(Culture culture, ModCultureData modCultureData)
{
    core.data.addCultureData(culture, modCultureData);
}

In order to make use of this feature, you must create an instance of ModCultureData for each of your mod's cultures, and then register it to the Community Library.

ModCultureData class

The Community Library uses the ModCultureData class to store information required to expand the functionality of thhe base games culture system.

The class currently contains the following elements:


    public class ModCultureData
    {
        public Sprite ophanimMinorSettlementIcon = null;

        public Sprite defaultMinorSettlementIcon = null;

        public Sprite defaultMinorSettlementCoastalIcon = null;

        public Dictionary<Type, Sprite> subsettlmentMinorSettlementIcons = new Dictionary<Type, Sprite>();
    }

When the corresponding base-game sprite is selected, the Community Library will check if the location's culture has an alternative graphic for that settlement, and, if it does, using that instead.