In Progress General 1.6.5 Customization of EncyclopediaPage in modding

Users who are viewing this thread

Version number
e1.6.5
Branch
Beta
Modded/unmodded
Unmodded
The constructor code of TaleWorlds.CampaignSystem.Encyclopedia.EncyclopediaPage says:
C#:
public EncyclopediaPage()
{
    ...
    object[] list = GetType().GetCustomAttributes(typeof(EncyclopediaModel), inherit: true);
    foreach (object returnList in list)
    {
        if (returnList is EncyclopediaModel)
        {
            _identifierTypes = (returnList as EncyclopediaModel).PageTargetTypes;
            break;
        }
    }
    _identifiers = new Dictionary<Type, string>();
    Type[] enumerator = _identifierTypes;
    foreach (Type type in enumerator)
    ...
}

Here the class inheriting EncyclopediaPage is considered attributed by TaleWorlds.CampaignSystem.Encyclopedia.EncyclopediaModel, which is an internal class. But in modding scenario we can only attribute our new EncyclopediaPage class with TaleWorlds.CampaignSystem.Encyclopedia.OverrideEncyclopediaModel. I doubt if there is bug in the code above that EncyclopediaModel shall be replaced by TaleWorlds.CampaignSystem.Encyclopedia.EncyclopediaModelBase, which is base class of both EncyclopediaModel and OverrideEncyclopediaModel.
 
Back
Top Bottom