Mount & Blade II: Bannerlord

Mount & Blade II: Bannerlord

Mod Configuration Menu v5
 此主题已被置顶,因此可能具有重要性
Pinkie Arg  [开发者] 2022 年 12 月 6 日 上午 4:34
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
最后由 Pinkie Arg 编辑于; 2022 年 12 月 6 日 上午 4:35