1
0
mirror of synced 2024-11-27 15:30:49 +01:00

Fix compatability with BepInEx BE

BepInEx.IL2CPP->BepInEx.Unity.IL2CPP
Requires switch to .NET 6 target
GetMusicInfoExAll pointer field name changes
Unhollower code namespace changed
This commit is contained in:
Matt 2022-12-03 17:35:20 -05:00
parent d2a3e3223f
commit 624258c6a7
5 changed files with 15 additions and 13 deletions

View File

@ -1,10 +1,9 @@
#if TAIKO_IL2CPP
using HarmonyLib;
using Il2CppInterop.Common.Attributes;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using UnhollowerBaseLib;
using UnhollowerBaseLib.Attributes;
using UnhollowerBaseLib.Runtime;
using Il2CppException = UnhollowerBaseLib.Il2CppException;
namespace TakoTako;
@ -20,7 +19,9 @@ public static class Il2cppRedirection
var outPtr = IntPtr.Zero;
numPtr[1] = (System.IntPtr) (&outPtr);
System.IntPtr exc = System.IntPtr.Zero;
var field = (System.IntPtr) AccessTools.Field(typeof(PlayDataManager), "NativeMethodInfoPtr_GetMusicInfoExAll_Public_Void_Int32_byref_ArrayOf_MusicInfoEx_0").GetValue(null);
var fieldInfo = AccessTools.Field(typeof(PlayDataManager), "NativeMethodInfoPtr_GetMusicInfoExAll_Public_Void_Int32_byref_Il2CppStructArray_1_MusicInfoEx_0") ??
AccessTools.Field(typeof(PlayDataManager), "NativeMethodInfoPtr_GetMusicInfoExAll_Public_Void_Int32_byref_ArrayOf_MusicInfoEx_0");
var field = (System.IntPtr)fieldInfo.GetValue(null);
IL2CPP.il2cpp_runtime_invoke(field, IL2CPP.Il2CppObjectBaseToPtrNotNull(instance), (void**) numPtr, ref exc);
dst = new Il2CppStructArray<MusicInfoEx>(outPtr);
Il2CppException.RaiseExceptionIfNecessary(exc);

View File

@ -12,8 +12,7 @@ using System.Threading.Tasks;
using BepInEx.Logging;
using HarmonyLib;
#if TAIKO_IL2CPP
using UnhollowerBaseLib;
using BepInEx.IL2CPP.Utils.Collections;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Object = Il2CppSystem.Object;
#endif
using Newtonsoft.Json;

View File

@ -3,9 +3,11 @@ using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using HarmonyLib;
using UnityEngine;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes;
#if TAIKO_IL2CPP
using Array = Il2CppSystem.Array;
using UnhollowerBaseLib;
#endif
namespace TakoTako.Patches;

View File

@ -7,8 +7,8 @@ using HarmonyLib;
using TakoTako.Patches;
using UnityEngine;
#if TAIKO_IL2CPP
using BepInEx.IL2CPP.Utils;
using BepInEx.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils;
using BepInEx.Unity.IL2CPP;
#endif
#pragma warning disable BepInEx002

View File

@ -27,7 +27,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFramework Condition="$(DefineConstants.Contains('TAIKO_IL2CPP'))">netstandard2.1</TargetFramework>
<TargetFramework Condition="$(DefineConstants.Contains('TAIKO_IL2CPP'))">net6.0</TargetFramework>
<TargetFramework Condition="$(DefineConstants.Contains('TAIKO_MONO'))">net48</TargetFramework>
<AssemblyName>com.fluto.takotako</AssemblyName>
<Description>A suite of mods that allow for Custom Songs and Taiko Drum support</Description>
@ -42,8 +42,8 @@
</PropertyGroup>
<ItemGroup Condition="$(DefineConstants.Contains('TAIKO_IL2CPP'))">
<PackageReference Include="BepInEx.IL2CPP" Version="6.0.0-be.574" IncludeAssets="compile" />
<Reference Include="$(GameDir)\BepInEx\unhollowed\*.dll" Private="false" />
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.663" />
<Reference Include="$(GameDir)\BepInEx\interop\*.dll" Private="false" />
</ItemGroup>
<ItemGroup Condition="$(DefineConstants.Contains('TAIKO_MONO'))">