diff --git a/.github/workflows/dotnet-format-daily.yml b/.github/workflows/dotnet-format-daily.yml
index 952e956..9db6fb1 100644
--- a/.github/workflows/dotnet-format-daily.yml
+++ b/.github/workflows/dotnet-format-daily.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Code Formatting
- uses: butr/actions-code-format-setup@v1.5
+ uses: butr/actions-code-format-setup@v1
with:
workspace: "src/Bannerlord.Harmony.sln"
github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index fe42aa5..861fff8 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -69,8 +69,8 @@ jobs:
Unpacking .7z files - https://www.nexusmods.com/mountandblade2bannerlord/articles/423
artifact_name: bannerlord
secrets:
- NEXUSMODS_APIKEY: ${{ secrets.NEXUSMODS_APIKEY }}
- NEXUSMODS_COOKIES: ${{ secrets.NEXUSMODS_COOKIES }}
+ NEXUSMODS_APIKEY: ${{ secrets.ARAGAS_NEXUSMODS_API_KEY }}
+ NEXUSMODS_COOKIES: ${{ secrets.ARAGAS_NEXUSMODS_COOKIE_SID_DEVELOP }}
###########################
# STEAM #
diff --git a/README.md b/README.md
index 517e217..2fe6176 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Bannerlord.Harmony/Bannerlord.Harmony.csproj b/src/Bannerlord.Harmony/Bannerlord.Harmony.csproj
index cfd6623..3fa5a88 100644
--- a/src/Bannerlord.Harmony/Bannerlord.Harmony.csproj
+++ b/src/Bannerlord.Harmony/Bannerlord.Harmony.csproj
@@ -56,12 +56,8 @@
+
-
$(HarmonyVersion)
diff --git a/src/Bannerlord.Harmony/SubModule.cs b/src/Bannerlord.Harmony/SubModule.cs
index 51e3ca2..b1ec6c1 100644
--- a/src/Bannerlord.Harmony/SubModule.cs
+++ b/src/Bannerlord.Harmony/SubModule.cs
@@ -36,6 +36,7 @@ public class SubModule : MBSubModuleBase
private const string SWarningExpectIssues = @"{=xTeLdSrXk4}{NL}This is not recommended. Expect issues!{NL}If your game crashes and you had this warning, please, mention it in the bug report!";
private static readonly HarmonyRef Harmony = new("Bannerlord.Harmony.GauntletUISubModule");
+ private static readonly HarmonyRef Harmony2 = new("Bannerlord.Harmony.UnpatchAll");
private readonly DebugUI _debugUI = new();
@@ -46,6 +47,10 @@ protected override void OnSubModuleLoad()
base.OnSubModuleLoad();
ValidateHarmony();
+
+ Harmony2.Patch(
+ SymbolExtensions2.GetMethodInfo((HarmonyLib.Harmony x) => x.UnpatchAll(null)),
+ prefix: new HarmonyMethod(typeof(SubModule), nameof(UnpatchAllPrefix)));
}
protected override void OnBeforeInitialModuleScreenSetAsRoot()
@@ -53,7 +58,7 @@ protected override void OnBeforeInitialModuleScreenSetAsRoot()
base.OnBeforeInitialModuleScreenSetAsRoot();
Harmony.Patch(
- AccessTools2.Method("TaleWorlds.MountAndBlade.MBSubModuleBase:OnBeforeInitialModuleScreenSetAsRoot"),
+ AccessTools2.Method(typeof(MBSubModuleBase), "OnBeforeInitialModuleScreenSetAsRoot"),
postfix: new HarmonyMethod(typeof(SubModule), nameof(OnBeforeInitialModuleScreenSetAsRootPostfix)));
}
@@ -80,12 +85,15 @@ private static void OnBeforeInitialModuleScreenSetAsRootPostfix(MBSubModuleBase
// will be able to initialize the chat system we use to log info.
ValidateLoadOrder();
Harmony.Unpatch(
- AccessTools2.Method("TaleWorlds.MountAndBlade.MBSubModuleBase:OnBeforeInitialModuleScreenSetAsRoot"),
+ AccessTools2.Method(typeof(MBSubModuleBase), "OnBeforeInitialModuleScreenSetAsRoot"),
HarmonyPatchType.All,
Harmony.Id);
}
}
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static bool UnpatchAllPrefix(string? harmonyID) => harmonyID is not null;
+
private static void ValidateLoadOrder()
{
var loadedModules = ModuleInfoHelper.GetLoadedModules().ToList();
diff --git a/src/Bannerlord.Harmony/_Module/ModuleData/Languages/JP/sta_strings.xml b/src/Bannerlord.Harmony/_Module/ModuleData/Languages/JP/sta_strings.xml
new file mode 100644
index 0000000..c6c9096
--- /dev/null
+++ b/src/Bannerlord.Harmony/_Module/ModuleData/Languages/JP/sta_strings.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+