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

Merge pull request #18 from timedroid/master

Fix compatability with BepInEx BE
This commit is contained in:
Fluto 2023-01-06 20:55:29 +11:00 committed by GitHub
commit fd375f2659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 14 deletions

View File

@ -29,7 +29,7 @@
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Configurations>Release-BepInEx6;Release-BepInEx5;Debug-BepInEx6;Debug-BepInEx5</Configurations> <Configurations>Release-BepInEx6;Release-BepInEx5;Debug-BepInEx6;Debug-BepInEx5</Configurations>
<Platforms>AnyCPU</Platforms> <Platforms>AnyCPU</Platforms>
<TargetFrameworks>net48;netstandard2.1</TargetFrameworks> <TargetFrameworks>netstandard2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release-BepInEx5' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release-BepInEx5' ">

View File

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

View File

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

View File

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

View File

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

View File

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