Mount & Blade II: Bannerlord

Mount & Blade II: Bannerlord

Mod Configuration Menu v5
 This topic has been pinned, so it's probably important
Pinkie Arg  [developer] 6 Dec, 2022 @ 4:34am
v5.4.0 Announcement for Modders
MCM v5.4.0 introduced a new behavior that can unintentionally break your mods if OnPropertyChanged was used! The behavior will most likely be a CTD!
As you know, we have a custom "Property" SAVE_TRIGGERED that is fired when the UI saves the settings or they are saved programmatically.
We also added a new "Property" LOADING_COMPLETE that is fired when MCM deserialized the settings, but still haven't registered them to be available via the Instance property! This gives modders the ability to have the earliest entrypoint possible when you can already execute some logic with the settings, like validation, if, for example, a user intentionally changed the settings file manually and it created an undefined state after loading!
Be aware that if you call some static method within OnPropertyChanged when the property is LOADING_COMPLETE that accesses Settings.Instance then it will lead to a CTD because there will be an infinite recursion! We'll see what can be done here!

UPDATE: v5.4.1 will instead of the recursion return null when accessing Instance in this case
Last edited by Pinkie Arg; 6 Dec, 2022 @ 4:35am