Skip to content

Commit

Permalink
* Switched back to Lib.Harmony
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Mar 31, 2023
1 parent 88bf027 commit d6108d0
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<!--Development Variables-->
<PropertyGroup>
<Version>1.2.4</Version>
<HarmonyVersion>2.10.1</HarmonyVersion>
<Version>1.3.0</Version>
<HarmonyVersion>2.2.2</HarmonyVersion>
<BUTRSharedVersion>3.0.0.135</BUTRSharedVersion>
<BUTRModuleManagerVersion>5.0.198</BUTRModuleManagerVersion>
<HarmonyExtensionsVersion>3.2.0.77</HarmonyExtensionsVersion>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---------------------------------------------------------------------------------------------------
Version: 1.3.0
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2
* Switched back to Lib.Harmony
---------------------------------------------------------------------------------------------------
Version: 1.2.4
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2
* Unblock Bannerlord.Harmony automatically
Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.BLSE.Shared/Bannerlord.BLSE.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>library</OutputType>
<AssemblyName>Bannerlord.BLSE.Shared</AssemblyName>

<DefineConstants>$(DefineConstants);HARMONYEXTENSIONS_HARMONYX</DefineConstants>
<DefineConstants>$(DefineConstants)</DefineConstants>

<ILRepackTargetConfigurations>$(Configurations);</ILRepackTargetConfigurations>
<ILRepackAllowDuplicateResources>false</ILRepackAllowDuplicateResources>
Expand Down
8 changes: 4 additions & 4 deletions src/Bannerlord.BLSE.Shared/ModuleInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private static HarmonyDiscoveryResult TryResolveHarmonyAssembliesFile(AssemblyNa
if (harmonyModuleInfo is null)
return HarmonyDiscoveryResult.ModuleSubModuleCorrupted;

if (new ApplicationVersionComparer().Compare(harmonyModuleInfo.Version, new ApplicationVersion(ApplicationVersionType.Release, 2, 10, 0, 0)) < 0)
if (new ApplicationVersionComparer().Compare(harmonyModuleInfo.Version, new ApplicationVersion(ApplicationVersionType.Release, 2, 2, 2, 0)) < 0)
return HarmonyDiscoveryResult.ModuleVersionWrong;

var harmonyBinFolder = Path.Combine(harmonyModuleFolder, "bin", configName);
Expand Down Expand Up @@ -210,7 +210,7 @@ Failed to read '{ModuleInfoHelper.SubModuleFile}'!
return null;
case HarmonyDiscoveryResult.ModuleVersionWrong:
MessageBoxDialog.Show(@"The Harmony module is wrong!
At least v2.10.1.x is required!
At least v2.2.2.x is required!
If the module was installed manually, find and install the latest version!
If Vortex is used, try to reinstall manually the latest version!
Expand Down Expand Up @@ -252,10 +252,10 @@ At least v2.10.1.x is required!
return null;

var harmonyX = AssemblyDefinition.ReadAssembly(assemblyFile);
if (harmonyX.Name.Version < new Version(2, 10, 1, 0))
if (harmonyX.Name.Version < new Version(2, 2, 2, 0))
{
MessageBoxDialog.Show(@"The Harmony module is corrupted!
Wrong 0Harmony.dll version! At least v2.10.1.x is required!
Wrong 0Harmony.dll version! At least v2.2.2.x is required!
If the module was installed manually, try to do a clean reinstall!
If Vortex is used, try to reinstall manually!
Expand Down
4 changes: 2 additions & 2 deletions src/Bannerlord.BLSE/Bannerlord.BLSE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>

<DefineConstants>$(DefineConstants);HARMONYEXTENSIONS_HARMONYX</DefineConstants>
<DefineConstants>$(DefineConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -28,7 +28,7 @@
<PackageReference Include="Bannerlord.BUTR.Shared" Version="$(BUTRSharedVersion)" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="Bannerlord.ModuleManager.Source" PrivateAssets="all" Version="$(BUTRModuleManagerVersion)" />
<PackageReference Include="Harmony.Extensions" Version="$(HarmonyExtensionsVersion)" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="HarmonyX" Version="$(HarmonyVersion)" IncludeAssets="compile" />
<PackageReference Include="Bannerlord.Lib.Harmony" Version="$(HarmonyVersion)-beta3" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.2.188-beta" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="IsExternalInit" Version="1.0.3" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Bannerlord.LauncherEx/Bannerlord.LauncherEx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<GameVersionConstant>v$(GameVersionFlat)</GameVersionConstant>
-->

<DefineConstants>$(DefineConstants);$(GameVersionConstant);HARMONYEXTENSIONS_HARMONYX</DefineConstants>
<DefineConstants>$(DefineConstants);$(GameVersionConstant)</DefineConstants>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -83,7 +83,7 @@
<PackageReference Include="Bannerlord.LauncherManager" Version="$(LauncherManagerVersion)" PrivateAssets="compile" />
<PackageReference Include="Bannerlord.BUTR.Shared" Version="$(BUTRSharedVersion)" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="Harmony.Extensions" Version="$(HarmonyExtensionsVersion)" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="HarmonyX" Version="$(HarmonyVersion)" PrivateAssets="compile" IncludeAssets="compile" />
<PackageReference Include="Bannerlord.Lib.Harmony" Version="$(HarmonyVersion)-beta3" PrivateAssets="compile" IncludeAssets="compile" />
<PackageReference Include="lz4net" Version="1.0.15.93" PrivateAssets="compile" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.2.188-beta" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="PolySharp" Version="1.12.1" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.LauncherEx/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static void Disable()
BrushFactoryManager.Clear();
WidgetFactoryManager.Clear();
BUTRLocalizationManager.Clear();
_launcherHarmony.UnpatchSelf();
_launcherHarmony.UnpatchAll(_launcherHarmony.Id);
}
}
}

0 comments on commit d6108d0

Please sign in to comment.