UIExtenderLib: library to extend standard UI

Users who are viewing this thread

shdwp

Recruit
I've made a library called UIExtenderLib which lets multiple mods modify standard game interface (apart from which is already supported by the API) like map bar or map info bar:

https://github.com/shdwp/UIExtenderLib

Because of the code architecture restrictions only single mod can add a button onto, for example, a navigation or info bar, the rest will effectively override the modifications, hence why the library was born.

It requires separate mod with actual runtime to be installed on user machine, it is recommended to use a dependency manager like Vortex or Community Launcher in order to automatically distribute latest version of the library:

There is also a couple of example projects which may interest you:
 
Very nice! Glanced through the readme and will be playing around with this a bit later. Given some more work on this do you reckon it would be possible to patch in a new menu in the EscapeMenu?

Something that I believe is sorely needed at the moment is an API where mods can easily gather their various settings and have them exposed in a user friendly interface directly ingame.

So mods that make use of the library would automatically show up in for example Escape Menu -> Mod Options, then those mods can read whatever changes the user makes from there at runtime.

It would help keep all various settings in one, uniform location instead of having to resort to external config editing and such.

Either way, thanks for this - should help me understand how all these things work together. Worked a fair bit with WPF and the MVVM, yet this seems so utterly alien to me. ?
 
Very nice! Glanced through the readme and will be playing around with this a bit later. Given some more work on this do you reckon it would be possible to patch in a new menu in the EscapeMenu?

Escape menu aren't described in XML, but in code, which means that simple Harmony Postfix to the `GauntletMissionSingleplayerEscapeMenu.GetEscapeMenuItems` should be able to add menu items. Multiple mods will be able to add their separate menu items which means that this library is not actually needed for this particular use case.
 
Escape menu aren't described in XML, but in code, which means that simple Harmony Postfix to the `GauntletMissionSingleplayerEscapeMenu.GetEscapeMenuItems` should be able to add menu items. Multiple mods will be able to add their separate menu items which means that this library is not actually needed for this particular use case.

Ah thanks for the clarification, appreciate it! I found a few EscapeMenu related XML files, but again, I'm only scratching the surface on how this system works so still working on grasping how exactly all of this comes together.
 
Hello, your mod library and mods look great! Also, thank you very much for including the sources and VS project, it's much easier to get started fiddling with them.

I'm trying to draw inspiration from your camp mod to add a button to the party menu allowing to recruit all prisoners and upgrade all 1 path troops. I compiled the lib and the mod itself, copied the GUI folder and xml. The game launches alright but I don't see the new button.

Could you perhaps upload the compiled version of your Camp Mod? Or do you know why the game would launch without a problem but the button doesn't appear?
 
Could you perhaps upload the compiled version of your Camp Mod? Or do you know why the game would launch without a problem but the button doesn't appear?

Have you actually installed and enabled `UIExtenderLibModule`? All runtime is in that module, `UIExtenderLib.dll` is just an API for it.
 
Ohh nice, I might use this for my Party Manager Extended mod. Any pointers on how to adjust the party manager screen? I'm struggling with finding the location where the party view is opened.
 
Have you actually installed and enabled `UIExtenderLibModule`? All runtime is in that module, `UIExtenderLib.dll` is just an API for it.

I haven't because I can't seem to find the xml :/. Maybe I'm an idiot, but I can't find it anywhere in the folder (with a version from a couple of days ago).

Ohh nice, I might use this for my Party Manager Extended mod. Any pointers on how to adjust the party manager screen? I'm struggling with finding the location where the party view is opened.

I might be trying to do something similar, the class PartyVM in TaleWorlds.CampaignSystem.ViewModelCollection.dll seems to be where things happen. Were you onto that already? What are you trying to do? I'd be curious to know if you managed to do something on that screen !
 
I haven't because I can't seem to find the xml :/. Maybe I'm an idiot, but I can't find it anywhere in the folder (with a version from a couple of days ago).



I might be trying to do something similar, the class PartyVM in TaleWorlds.CampaignSystem.ViewModelCollection.dll seems to be where things happen. Were you onto that already? What are you trying to do? I'd be curious to know if you managed to do something on that screen !

I haven't yet, but I am onto where the actual load and stuff is happening. I'm trying to do a Party Manager Extended where you have more control over you troops in the party screen: ordering labeling etc and more options/features.
 
First question, when do you stream? I'd like to watch.
Second, Can this only be used for the map screen so far? Or can this be used for Inventory, Party, Conversation, etc screens?
 
Hey everyone!

I've finished working on major UIExtenderLib update, now it doesn't require target machines to have a custom module installed, meaning that you can simply add it as a NuGet dependency and that's it!

API stayed the same, so it should be rather easy to migrate onto 2.0.
 
Awesome job! I can't wait to start using this.

This is exactly why Bannerlord *will* beat Warband modding over time, open source NuGet packages we can pile all of our cool boilerplate stuff into. Lots of work will get saved this way.
 
For some reason, when I use this, I can't make it work with any other mods. It works fine when I'm only using my mod. But no matter what the other mod does, won't work. Changing load order doesn't work either. Any tips?
 
For some reason, when I use this, I can't make it work with any other mods. It works fine when I'm only using my mod. But no matter what the other mod does, won't work. Changing load order doesn't work either. Any tips?

There is an issue in domain assembly loading scheme, where it will prioritize dependency assemblies that come first alphabetically during load. So, for example, if mod A depends on Harmony1.0 and mod B depends on Harmony2.0 only Harmony1.0 will be loaded and that will obviously wound't work for mod B.

I'm still investigating the issue and will probably have some workarounds in the near future. For the time being you can scan your bin folders to find (possibly) outdated `0Harmony.dll`s.

Update: I have made a temporary workaround by making a custom harmony dependency. This should resolve issues where different versions of harmony were used, but wouldn't prevent if those versions aren't runtime compatible (i.e. Harmony1 vs Harmony2).
 
Last edited:
There is an issue in domain assembly loading scheme, where it will prioritize dependency assemblies that come first alphabetically during load. So, for example, if mod A depends on Harmony1.0 and mod B depends on Harmony2.0 only Harmony1.0 will be loaded and that will obviously wound't work for mod B.

I'm still investigating the issue and will probably have some workarounds in the near future. For the time being you can scan your bin folders to find (possibly) outdated `0Harmony.dll`s.

Update: I have made a temporary workaround by making a custom harmony dependency. This should resolve issues where different versions of harmony were used, but wouldn't prevent if those versions aren't runtime compatible (i.e. Harmony1 vs Harmony2).
Awesome, this fixed the problem. Thanks!
 
Back
Top Bottom