Skip to content

Library that provides an universal loader for distributing multiple implementations for different game versions within one module.

Notifications You must be signed in to change notification settings

BUTR/Bannerlord.ModuleLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 _.

About

Library that provides an universal loader for distributing multiple implementations for different game versions within one module.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages