From ed0e840480718f9036fab73ec024348a3719e237 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Thu, 6 Jul 2023 22:18:47 +0300 Subject: [PATCH] * Support for v1.2.1 * Proper Watchdog disabling --- build/common.props | 2 +- changelog.txt | 5 +++++ .../HotKeys/HotKeyManagerImplementation.cs | 2 +- .../ObjectSystem/MBObjectExtensionDataStore.cs | 2 +- .../ExceptionHandler/ExceptionHandlerSubSystem.cs | 6 ++++++ supported-game-versions.txt | 1 + 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build/common.props b/build/common.props index 5dcb0377..8ef0d87e 100644 --- a/build/common.props +++ b/build/common.props @@ -4,7 +4,7 @@ - 2.8.7 + 2.8.8 2.2.2 3.2.0.77 diff --git a/changelog.txt b/changelog.txt index 3b560068..73b81af6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.8.8 +Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.2.0,v1.2.1 +* Support for v1.2.1 +* Proper Watchdog disabling +--------------------------------------------------------------------------------------------------- Version: 2.8.7 Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.2.0 * Small performance improvement diff --git a/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs b/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs index 3fe444ed..a69d31ce 100644 --- a/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs +++ b/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs @@ -53,7 +53,7 @@ public override IReadOnlyList Build() #if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 TWHotKeyManager.RegisterInitialContexts(new[] { hotKeyCategoryContainer }, true); -#elif v120 +#elif v120 || v121 TWHotKeyManager.RegisterInitialContexts(TWHotKeyManager.GetAllCategories().ToList().Concat(new[] { hotKeyCategoryContainer }), true); #else #error DEFINE diff --git a/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectExtensionDataStore.cs b/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectExtensionDataStore.cs index 7aeafafb..5b885942 100755 --- a/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectExtensionDataStore.cs +++ b/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectExtensionDataStore.cs @@ -124,7 +124,7 @@ private sealed class DataKey : IEquatable #if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 private sealed class SavedTypeDefiner : SaveableCampaignBehaviorTypeDefiner -#elif v120 +#elif v120 || v121 private sealed class SavedTypeDefiner : SaveableTypeDefiner #else #error DEFINE diff --git a/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs b/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs index 992ceeec..6a0675a6 100644 --- a/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs +++ b/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs @@ -3,6 +3,7 @@ using Bannerlord.ButterLib.SubSystems.Settings; using HarmonyLib; +using HarmonyLib.BUTR.Extensions; using System; using System.Collections.Generic; @@ -15,6 +16,10 @@ namespace Bannerlord.ButterLib.ExceptionHandler [BLSEInterceptor] internal sealed class ExceptionHandlerSubSystem : ISubSystem, ISubSystemSettings { + private delegate void DetachWatchdogDelegate(); + private static readonly DetachWatchdogDelegate DetachWatchdog = + AccessTools2.GetDelegate("TaleWorlds.Engine.Utilities:DetachWatchdog"); + public static ExceptionHandlerSubSystem? Instance { get; private set; } internal readonly Harmony Harmony = new("Bannerlord.ButterLib.ExceptionHandler.BEW"); @@ -76,6 +81,7 @@ public void Enable() if (!_wasButrLoaderInterceptorCalled) { BEWPatch.Enable(Harmony); + DetachWatchdog?.Invoke(); } } diff --git a/supported-game-versions.txt b/supported-game-versions.txt index d4d7322a..932b6f8c 100644 --- a/supported-game-versions.txt +++ b/supported-game-versions.txt @@ -1,3 +1,4 @@ +v1.2.1 v1.2.0 v1.1.5 v1.1.4