Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 2.06 KB

README.md

File metadata and controls

42 lines (34 loc) · 2.06 KB

Bannerlord.ModuleLoader

Uses the new C# 9 Source Generator (could have used an MSBuild task) to generate a loader library for the implementation-loader technique.

Requirements

  • Will add a requirement to the Bannerlord.Harmony module.
  • Requires the ModuleId and ModuleName MSBuild property widely used in our BUTR stack. Should be the same as the mod's Module Id and Name.
  • Requires standard MSBuildProjectFullPath and OutputPath properties. Tampering with them will break the injector.

Installation

Install the Bannerlord.ModuleLoader.Injector package.

Usage

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 the SubModuleClassType property manually, replacing each invalid char as underscore _.