AddonPlugin System
Estimated reading time: 2 minutesAddons are special Mods that act as an extension layer. By centralizing common functionality in one Mod for others to call, Addons keep ModLoader lean and make updates easier.
Design Rationale
Similar to RimWorld "Body Extension" or "Combat Extension" Mods, Addons inject and modify the game and expose new functionality for other Mods.
Benefits of Addons:
- Keeps ModLoader core small and generic
- Separates game-specific features from SC2-tied ModLoader
- Enables fast iteration and upgrades
- Mod authors can fork and extend Addons without touching ModLoader
Registering an Addon
Addon Mods must register during EarlyLoad (or InjectEarlyLoad):
Using an Addon
Regular Mods declare the dependency in boot.json via addonPlugin:
After EarlyLoad and before PatchModToGame, ModLoader registers all Mods that declare addonPlugin with their Addon Mods.
Registration Flow
Addon Examples
ImageLoaderHook
ImageLoaderHook hooks DoL's image loader (Renderer.ImageLoader) so images from Mod zips are loaded into the game. Image loads are automatically replaced by Mod content.
ReplacePatch / TweeReplacer
ReplacePatch and TweeReplacer provide Passage and JS/CSS string replacement. Most Mods that need to change game logic can use them without writing custom patch code.
CheckDoLCompressorDictionaries
CheckDoLCompressorDictionaries checks DoL's compression dictionary structure and warns when it changes so developers and users can avoid save corruption.
