diff --git a/MelonLoader/MelonLoader.Mono/MelonLoader.Mono.csproj b/MelonLoader/MelonLoader.Mono/MelonLoader.Mono.csproj new file mode 100644 index 000000000..ce738d5f6 --- /dev/null +++ b/MelonLoader/MelonLoader.Mono/MelonLoader.Mono.csproj @@ -0,0 +1,14 @@ + + + MelonLoader.Mono + net6 + Latest + $(SolutionDir)Output\$(Configuration)\MelonLoader\ + true + embedded + + + + + + \ No newline at end of file diff --git a/MelonLoader/Modules/Unity/Unity.Bootstrap/Mono/BootstrapMono.cs b/MelonLoader/MelonLoader.Mono/MonoLoader.cs similarity index 88% rename from MelonLoader/Modules/Unity/Unity.Bootstrap/Mono/BootstrapMono.cs rename to MelonLoader/MelonLoader.Mono/MonoLoader.cs index 3fe898ae8..b7f8aea7c 100644 --- a/MelonLoader/Modules/Unity/Unity.Bootstrap/Mono/BootstrapMono.cs +++ b/MelonLoader/MelonLoader.Mono/MonoLoader.cs @@ -1,15 +1,11 @@ using System; -using System.IO; -using System.Reflection; -using System.Runtime.InteropServices; -using MelonLoader.Bootstrap; using MelonLoader.Shared.NativeUtils; using MelonLoader.Shared.Utils; #pragma warning disable 0649 -namespace MelonLoader.Unity.Mono +namespace MelonLoader.Mono { - internal unsafe static class BootstrapMono + public unsafe static class MonoLoader { #region Private Members @@ -24,7 +20,7 @@ internal unsafe static class BootstrapMono #region Bootstrap - internal unsafe static void Startup(MonoRuntimeInfo runtimeInfo) + public unsafe static void Startup(MonoRuntimeInfo runtimeInfo) { // Apply the information monoRuntimeInfo = runtimeInfo; @@ -33,14 +29,10 @@ internal unsafe static void Startup(MonoRuntimeInfo runtimeInfo) if (monoRuntimeInfo == null || string.IsNullOrEmpty(monoRuntimeInfo.FilePath)) { - Assertion.ThrowInternalFailure($"Failed to find Mono or MonoBleedingEdge Library!"); + Assertion.ThrowInternalFailure($"Failed to find {runtimeInfo.Variant} Library!"); return; } - - // Log Engine Variant - MelonLogger.Msg($"Engine Variant: {monoRuntimeInfo.Variant}"); - // Check if there is a Posix Helper included with the Mono variant library if (!string.IsNullOrEmpty(monoRuntimeInfo.PosixPath)) { diff --git a/MelonLoader/Modules/Unity/Unity.Bootstrap/Mono/MonoRuntimeInfo.cs b/MelonLoader/MelonLoader.Mono/MonoRuntimeInfo.cs similarity index 94% rename from MelonLoader/Modules/Unity/Unity.Bootstrap/Mono/MonoRuntimeInfo.cs rename to MelonLoader/MelonLoader.Mono/MonoRuntimeInfo.cs index 4c8e223de..e0845b13b 100644 --- a/MelonLoader/Modules/Unity/Unity.Bootstrap/Mono/MonoRuntimeInfo.cs +++ b/MelonLoader/MelonLoader.Mono/MonoRuntimeInfo.cs @@ -1,4 +1,4 @@ -namespace MelonLoader.Unity.Mono +namespace MelonLoader.Mono { public class MonoRuntimeInfo { diff --git a/MelonLoader/MelonLoader.sln b/MelonLoader/MelonLoader.sln index 4ae0cfba4..30e13c44e 100644 --- a/MelonLoader/MelonLoader.sln +++ b/MelonLoader/MelonLoader.sln @@ -19,6 +19,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Godot.Bootstrap", "Modules\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.Bootstrap", "Modules\Unity\Unity.Bootstrap\Unity.Bootstrap.csproj", "{75F7B154-10E0-484F-A463-16376FFA5553}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MelonLoader.Mono", "MelonLoader.Mono\MelonLoader.Mono.csproj", "{712BC5B3-766A-4B44-9BF4-1012BE63D6F6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.Il2Cpp", "Modules\Unity\Unity.Il2Cpp\Unity.Il2Cpp.csproj", "{9EBD236C-42FC-4E98-8388-E763BA46FD10}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +49,14 @@ Global {75F7B154-10E0-484F-A463-16376FFA5553}.Debug|Any CPU.Build.0 = Debug|Any CPU {75F7B154-10E0-484F-A463-16376FFA5553}.Release|Any CPU.ActiveCfg = Release|Any CPU {75F7B154-10E0-484F-A463-16376FFA5553}.Release|Any CPU.Build.0 = Release|Any CPU + {712BC5B3-766A-4B44-9BF4-1012BE63D6F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {712BC5B3-766A-4B44-9BF4-1012BE63D6F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {712BC5B3-766A-4B44-9BF4-1012BE63D6F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {712BC5B3-766A-4B44-9BF4-1012BE63D6F6}.Release|Any CPU.Build.0 = Release|Any CPU + {9EBD236C-42FC-4E98-8388-E763BA46FD10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EBD236C-42FC-4E98-8388-E763BA46FD10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EBD236C-42FC-4E98-8388-E763BA46FD10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EBD236C-42FC-4E98-8388-E763BA46FD10}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -54,6 +66,7 @@ Global {3E7F5C09-221B-4492-9BA0-2D1ED9BEC58C} = {716CE800-E309-4104-ACA3-867BB8BF4FB0} {483E5B56-7308-4DAD-BF90-B27DC97116D0} = {A5293DFE-1E8A-4933-B3D6-F8B06D995A23} {75F7B154-10E0-484F-A463-16376FFA5553} = {3E7F5C09-221B-4492-9BA0-2D1ED9BEC58C} + {9EBD236C-42FC-4E98-8388-E763BA46FD10} = {3E7F5C09-221B-4492-9BA0-2D1ED9BEC58C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4490CB48-16CD-4D0A-858D-1484CB9DED02} diff --git a/MelonLoader/Modules/Godot/Godot.Bootstrap/Godot.Bootstrap.csproj b/MelonLoader/Modules/Godot/Godot.Bootstrap/Godot.Bootstrap.csproj index 1eb2e3fb0..482fb1134 100644 --- a/MelonLoader/Modules/Godot/Godot.Bootstrap/Godot.Bootstrap.csproj +++ b/MelonLoader/Modules/Godot/Godot.Bootstrap/Godot.Bootstrap.csproj @@ -3,13 +3,10 @@ MelonLoader.Godot net6 Latest - true - false false $(SolutionDir)Output\$(Configuration)\MelonLoader\Modules\Godot\ true embedded - false diff --git a/MelonLoader/Modules/Unity/Unity.Bootstrap/Bootstrap.cs b/MelonLoader/Modules/Unity/Unity.Bootstrap/Bootstrap.cs index 9b0d0a335..f93950280 100644 --- a/MelonLoader/Modules/Unity/Unity.Bootstrap/Bootstrap.cs +++ b/MelonLoader/Modules/Unity/Unity.Bootstrap/Bootstrap.cs @@ -1,6 +1,8 @@ using System.IO; +using MelonLoader.Mono; using MelonLoader.Shared.Interfaces; using MelonLoader.Shared.Utils; +using MelonLoader.Unity.Il2Cpp; namespace MelonLoader.Unity { @@ -40,12 +42,21 @@ public void Startup() // Check if GameAssembly exists string gameAssemblyPath = Path.Combine(MelonEnvironment.GameRootDirectory, gameAssemblyName); if (File.Exists(gameAssemblyPath)) - Il2Cpp.BootstrapIl2Cpp.Startup(gameAssemblyPath); // Start Il2Cpp Support + { + // Start Il2Cpp Support + MelonLogger.Msg("Engine Variant: Il2Cpp"); + Il2CppLoader.Startup(gameAssemblyPath); + } else - Mono.BootstrapMono.Startup(GetMonoRuntimeInfo()); // Start Mono Support + { + // Start Mono Support + MonoRuntimeInfo runtimeInfo = GetMonoRuntimeInfo(); + MelonLogger.Msg($"Engine Variant: {runtimeInfo.Variant}"); + MonoLoader.Startup(runtimeInfo); + } } - internal static Mono.MonoRuntimeInfo GetMonoRuntimeInfo() + internal static MonoRuntimeInfo GetMonoRuntimeInfo() { // Folders the Mono folders might be located in string[] directoriesToSearch = new string[] diff --git a/MelonLoader/Modules/Unity/Unity.Bootstrap/Il2Cpp/BootstrapIl2Cpp.cs b/MelonLoader/Modules/Unity/Unity.Bootstrap/Il2Cpp/BootstrapIl2Cpp.cs deleted file mode 100644 index 30942f2ec..000000000 --- a/MelonLoader/Modules/Unity/Unity.Bootstrap/Il2Cpp/BootstrapIl2Cpp.cs +++ /dev/null @@ -1,13 +0,0 @@ -using MelonLoader.Shared.Utils; - -namespace MelonLoader.Unity.Il2Cpp -{ - internal static class BootstrapIl2Cpp - { - internal static void Startup(string gameAssemblyPath) - { - // Log Engine Variant - MelonLogger.Msg("Engine Variant: Il2Cpp"); - } - } -} diff --git a/MelonLoader/Modules/Unity/Unity.Bootstrap/Unity.Bootstrap.csproj b/MelonLoader/Modules/Unity/Unity.Bootstrap/Unity.Bootstrap.csproj index d677df71b..b036b11d4 100644 --- a/MelonLoader/Modules/Unity/Unity.Bootstrap/Unity.Bootstrap.csproj +++ b/MelonLoader/Modules/Unity/Unity.Bootstrap/Unity.Bootstrap.csproj @@ -3,16 +3,15 @@ MelonLoader.Unity net6 Latest - true - false false $(SolutionDir)Output\$(Configuration)\MelonLoader\Modules\Unity\ true embedded - false - + + + \ No newline at end of file diff --git a/MelonLoader/Modules/Unity/Unity.Il2Cpp/Il2CppLoader.cs b/MelonLoader/Modules/Unity/Unity.Il2Cpp/Il2CppLoader.cs new file mode 100644 index 000000000..0844f5d62 --- /dev/null +++ b/MelonLoader/Modules/Unity/Unity.Il2Cpp/Il2CppLoader.cs @@ -0,0 +1,10 @@ +namespace MelonLoader.Unity.Il2Cpp +{ + public static class Il2CppLoader + { + public static void Startup(string gameAssemblyPath) + { + + } + } +} diff --git a/MelonLoader/Modules/Unity/Unity.Il2Cpp/Unity.Il2Cpp.csproj b/MelonLoader/Modules/Unity/Unity.Il2Cpp/Unity.Il2Cpp.csproj new file mode 100644 index 000000000..3f376098a --- /dev/null +++ b/MelonLoader/Modules/Unity/Unity.Il2Cpp/Unity.Il2Cpp.csproj @@ -0,0 +1,15 @@ + + + MelonLoader.Unity.Il2Cpp + net6 + Latest + false + $(SolutionDir)Output\$(Configuration)\MelonLoader\Modules\Unity\ + true + embedded + + + + + + \ No newline at end of file