Bannerlord.UIExtenderEx

Logo
Lines Of Code CodeFactor Code Climate maintainability Documentation Crowdin
GitHub Workflow Status (event) CodeCov
NuGet Bannerlord.UIExtenderEx
NexusMods UIExtenderEx NexusMods UIExtenderEx NexusMods UIExtenderEx NexusMods UIExtenderEx NexusMods UIExtenderEx
Steam Mod Configuration Menu Steam Downloads Steam Views Steam Subscriptions Steam Favorites

A library that enables multiple mods to alter standard game interface.
Previously, a fork of UIExtenderLib that was de-forked.

Installation

This module should be one of the highest in loading order. Ideally, it should be loaded after Bannerlord.Harmony or Bannerlord.ButterLib.

For Players

This mod is a dependency mod that does not provide anything by itself. You need to additionally install mods that use it.

Usage

Check the Articles section of our documentation!

Current State of AutoGens

The game uses two Prefab systems - static (pre-compiled XML) C# prefabs and dynamically serialized XML prefabs.
The XML prefabs were introduced with the Early Access.
The C# prefabs were introduced in the middle of Early Access. Most likely for Console releases, since they use the Mono runtime.

We call AutoGens the XML prefabs that are pre-compiled into C# prefabs. The pre-compilation is achieved by using TaleWorlds.MountAndBlade.GauntletUI.CodeGenerator.exe. It generates C# code based on the XML file. The C# code can then be compiled into an assembly (.dll file) that can be loaded by the game.
This has the following benefits:

  • We have ready-to-use prefabs at the very start of the game, removing the serialization step of the XML prefabs, which reduces the load time.
  • We have static (typed) access to anything within the prefab. We do not need to use reflection to get/set data, which, again, speeds up the game. This is particularly noticeable on the Mono runtime.

In summary, AutoGens are faster than the raw XML prefabs. The most performance is gained on the Mono runtime. On .NET (Core) the difference is more or less neglectable.

UIExtenderEx modifies the raw XML prefabs. Since the game does not use XML prefabs and instead relies on the AutoGens, our modifications will not affect the game.
Currently, we just disable AutoGens globally. We are not able to do the pre-compilation at runtime. The issues are mostly not at our side - the CodeGenerator that the game provides doesn't support such scenarios.


This page was last modified at 08/26/2020 00:07:01 +03:00 (UTC).

Commit Message
Author:    Vitaly Mikhailov
Commit:    804d0990cbfbab4d50a20716d1c09c098de0fdf8
Removed .idea

Added docs