Party view modding

Users who are viewing this thread

Hey there fellow bannerlords!

I am trying to change the partyVM (Party view model) to change the party viewer, but I'm running into some problems as my experience is lacking.

How do I find where the party screen is opening? So I can hook onto that call and know what model is called. (Been using dotPeek to try and find the place where the viewer is launched)

Thanks bunches!

Quick edit:
With lack of experience I mean the structure of how Bannerlord is build!
 
Last edited:
Solution
Hello there,

The actual method that's called when the Party screen gets opened is ExecuteOpenParty in TaleWorlds.CampaignSystem.ViewModelCollection.Map.MapNavigationVM, which calls OpenParty on the navigationHandler Interface, which initializes the SandBox.GauntletUI.GauntletPartyScreen.

I'm somewhat new to C# and (obviously) Bannerlord modding, but the way I understand it you should be able to override the respective classes in modules that come later in the load order, but I haven't managed to successfully override a default VM yet; the game just refuses to start.

So I think I may have found a somewhat hacky but probably safe workaround for that problem:

In...
Hello there,

The actual method that's called when the Party screen gets opened is ExecuteOpenParty in TaleWorlds.CampaignSystem.ViewModelCollection.Map.MapNavigationVM, which calls OpenParty on the navigationHandler Interface, which initializes the SandBox.GauntletUI.GauntletPartyScreen.

I'm somewhat new to C# and (obviously) Bannerlord modding, but the way I understand it you should be able to override the respective classes in modules that come later in the load order, but I haven't managed to successfully override a default VM yet; the game just refuses to start.

So I think I may have found a somewhat hacky but probably safe workaround for that problem:

In SandBox.GauntletUI.GauntletPartyScreen, and the respective equivalents for the other Screens, a TutorialContextChangedEvent is triggered with the screen type as a TutorialContexts argument each time a screen gets activated. You should be able to use that to add your own Gauntlet Layer on top of the screen with your own ViewModel and behaviour with the EventManager.

Considering the name of the event it's probably not supposed to be used that way, so let me know if anybody finds a better method.

Hope this helps!
 
Upvote 0
Solution
I've been as far as getting to know how all the hooks work, it's just a matter of where to hook onto which is causing massive headaches. I think modding support for this kind of UI isn't yet finished.

Imo your solution that is a bit too hacky of a way to do it haha
 
Upvote 0
I've been as far as getting to know how all the hooks work, it's just a matter of where to hook onto which is causing massive headaches. I think modding support for this kind of UI isn't yet finished.

Imo your solution that is a bit too hacky of a way to do it haha

Yes, I'm having the same issue here. I'd like to edit the menu and add actions to buttons I created but this seems maybe a little tricky.
 
Upvote 0
I've been as far as getting to know how all the hooks work, it's just a matter of where to hook onto which is causing massive headaches. I think modding support for this kind of UI isn't yet finished.

Imo your solution that is a bit too hacky of a way to do it haha

It's very hacky, but it's working for what I'm trying to do right now. I can still clean it up when it's properly supported or there's documentation on how to do it properly :wink:
 
Upvote 0
Hello there,

The actual method that's called when the Party screen gets opened is ExecuteOpenParty in TaleWorlds.CampaignSystem.ViewModelCollection.Map.MapNavigationVM, which calls OpenParty on the navigationHandler Interface, which initializes the SandBox.GauntletUI.GauntletPartyScreen.

I'm somewhat new to C# and (obviously) Bannerlord modding, but the way I understand it you should be able to override the respective classes in modules that come later in the load order, but I haven't managed to successfully override a default VM yet; the game just refuses to start.

So I think I may have found a somewhat hacky but probably safe workaround for that problem:

In SandBox.GauntletUI.GauntletPartyScreen, and the respective equivalents for the other Screens, a TutorialContextChangedEvent is triggered with the screen type as a TutorialContexts argument each time a screen gets activated. You should be able to use that to add your own Gauntlet Layer on top of the screen with your own ViewModel and behaviour with the EventManager.

Considering the name of the event it's probably not supposed to be used that way, so let me know if anybody finds a better method.

Hope this helps!

Thanks for the idea, gonna use it, I couldn't find any other way to know which dialog is open... Will see if there is a better solution later.
 
Upvote 0
Back
Top Bottom