Uses the new C# 9 Source Generator (could have used an MSBuild task) to generate a loader library for the implementation-loader technique.
- Will add a requirement to the
Bannerlord.Harmonymodule. - Requires the
ModuleIdandModuleNameMSBuild property widely used in our BUTR stack. Should be the same as the mod's Module Id and Name. - Requires standard
MSBuildProjectFullPathandOutputPathproperties. Tampering with them will break the injector.
Install the Bannerlord.ModuleLoader.Injector package.
Each build will create Bannerlord.ModuleLoader.$(ModuleId).dll|.pdb files.
<!-- Bannerlord Module Loader. Do not change the name! -->
<SubModule>
<Name value="Bannerlord Module Loader" />
<DLLName value="Bannerlord.ModuleLoader.$moduleid$.dll" />
<SubModuleClassType value="Bannerlord.ModuleLoader.$moduleid$" />
<Tags>
<Tag key="LoaderFilter" value ="$moduleid$.*.dll" />
</Tags>
</SubModule>ℹ️ NOTE
The$moduleid$and$modulename$properties is from BUTR's Bannerlord.BuildResources, it injects MSBuild's$(ModuleId) and $ (ModuleName) properties.
Just replace it with the actual Module Id if you don't use the package!
⚠️ ATTENTION
If the Module Id contains invalid C# identity symbols (like dot '.'), override theSubModuleClassTypeproperty manually, replacing each invalid char as underscore_.