Skip to content

Commit

Permalink
Update to support ML 0.5.4; add BepInEx 5 and BepInEx 6 projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorsington committed Jul 31, 2022
1 parent 33e7e0f commit a2a61d7
Show file tree
Hide file tree
Showing 283 changed files with 19,581 additions and 18,397 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

.idea/

# User-specific files
*.rsuser
*.suo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>BepInEx.MelonLoader.Loader.IL2CPP</AssemblyName>
<Description>MelonLoader loader for Il2Cpp games</Description>
<Version>2.0.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<Configurations>BepInEx6</Configurations>
<Platforms>AnyCPU</Platforms>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(SolutionDir)Output\$(Configuration)\IL2CPP\</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.IL2CPP" Version="6.0.0-be.572" IncludeAssets="compile" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MelonLoader\MelonLoader.csproj" />
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions BepInEx.MelonLoader.Loader.IL2CPP/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using BepInEx.IL2CPP;
using MLCore = MelonLoader.Core;


namespace BepInEx.MelonLoader.Loader.IL2CPP
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BasePlugin
{
public override void Load()
{
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
if (args.Name.Contains("MelonLoader"))
return typeof(MLCore).Assembly;
return null;
};

MLCore.Initialize(Config, false);
MLCore.PreStart();
MLCore.Start();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net35</TargetFramework>
<Description>MelonLoader loader for UnityMono games</Description>
<Version>2.0.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>BepInEx.MelonLoader.Loader.UnityMono</PackageId>
<RootNamespace>BepInEx.MelonLoader.Loader.UnityMono</RootNamespace>
<Configurations>BepInEx5;BepInEx6</Configurations>
<Platforms>AnyCPU</Platforms>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(SolutionDir)Output\$(Configuration)\UnityMono\</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.1.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="UnityEngine" Version="5.6.1" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'BepInEx5'">
<PackageReference Include="BepInEx.BaseLib" Version="5.4.21" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'BepInEx6'">
<PackageReference Include="BepInEx.Unity" Version="6.0.0-be.572" IncludeAssets="compile" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MelonLoader\MelonLoader.csproj" />
</ItemGroup>
</Project>
22 changes: 22 additions & 0 deletions BepInEx.MelonLoader.Loader.UnityMono/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using MLCore = MelonLoader.Core;

namespace BepInEx.MelonLoader.Loader.UnityMono;

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
private void Awake()
{
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
if (args.Name.Contains("MelonLoader"))
return typeof(MLCore).Assembly;
return null;
};

MLCore.Initialize(Config, false);
MLCore.PreStart();
MLCore.Start();
}
}
40 changes: 21 additions & 19 deletions BepInEx.MelonLoader.Loader.sln
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BepInEx.MelonLoader.Loader", "BepInEx.MelonLoader.Loader\BepInEx.MelonLoader.Loader.csproj", "{A994FBA1-50B9-4117-BCB8-E8307A106896}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BepInEx.MelonLoader.Loader.UnityMono", "BepInEx.MelonLoader.Loader.UnityMono\BepInEx.MelonLoader.Loader.UnityMono.csproj", "{FFC82F39-1B54-4A2F-B0B0-6B9A9E692ECF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MelonLoader", "MelonLoader\MelonLoader.csproj", "{F9700790-414B-431B-9F9C-1D9210FAD682}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MelonLoader", "MelonLoader\MelonLoader.csproj", "{88C9153F-1B73-43C3-840A-17A25B0499D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Il2CppAssemblyGenerator", "Il2CppAssemblyGenerator\Il2CppAssemblyGenerator.csproj", "{A6452A3F-4BD6-497A-97DA-24F7DF97B234}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extra", "Extra", "{01052632-2064-4BD2-82D0-80415903719E}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BepInEx.MelonLoader.Loader.IL2CPP", "BepInEx.MelonLoader.Loader.IL2CPP\BepInEx.MelonLoader.Loader.IL2CPP.csproj", "{39CE899F-DF83-4678-AB18-89C538F3550B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Any CPU = Release|Any CPU
BepInEx5|Any CPU = BepInEx5|Any CPU
BepInEx6|Any CPU = BepInEx6|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A994FBA1-50B9-4117-BCB8-E8307A106896}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A994FBA1-50B9-4117-BCB8-E8307A106896}.Release|Any CPU.Build.0 = Release|Any CPU
{F9700790-414B-431B-9F9C-1D9210FAD682}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9700790-414B-431B-9F9C-1D9210FAD682}.Release|Any CPU.Build.0 = Release|Any CPU
{A6452A3F-4BD6-497A-97DA-24F7DF97B234}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6452A3F-4BD6-497A-97DA-24F7DF97B234}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {22610235-9D7E-4B20-B180-26071ACC246C}
{FFC82F39-1B54-4A2F-B0B0-6B9A9E692ECF}.BepInEx5|Any CPU.ActiveCfg = BepInEx5|Any CPU
{FFC82F39-1B54-4A2F-B0B0-6B9A9E692ECF}.BepInEx5|Any CPU.Build.0 = BepInEx5|Any CPU
{FFC82F39-1B54-4A2F-B0B0-6B9A9E692ECF}.BepInEx6|Any CPU.ActiveCfg = BepInEx6|Any CPU
{FFC82F39-1B54-4A2F-B0B0-6B9A9E692ECF}.BepInEx6|Any CPU.Build.0 = BepInEx6|Any CPU
{88C9153F-1B73-43C3-840A-17A25B0499D6}.BepInEx5|Any CPU.ActiveCfg = BepInEx5|Any CPU
{88C9153F-1B73-43C3-840A-17A25B0499D6}.BepInEx5|Any CPU.Build.0 = BepInEx5|Any CPU
{88C9153F-1B73-43C3-840A-17A25B0499D6}.BepInEx6|Any CPU.ActiveCfg = BepInEx6|Any CPU
{88C9153F-1B73-43C3-840A-17A25B0499D6}.BepInEx6|Any CPU.Build.0 = BepInEx6|Any CPU
{39CE899F-DF83-4678-AB18-89C538F3550B}.BepInEx5|Any CPU.ActiveCfg = BepInEx6|Any CPU
{39CE899F-DF83-4678-AB18-89C538F3550B}.BepInEx6|Any CPU.ActiveCfg = BepInEx6|Any CPU
{39CE899F-DF83-4678-AB18-89C538F3550B}.BepInEx6|Any CPU.Build.0 = BepInEx6|Any CPU
EndGlobalSection
EndGlobal
69 changes: 0 additions & 69 deletions BepInEx.MelonLoader.Loader/BepInEx.MelonLoader.Loader.csproj

This file was deleted.

24 changes: 0 additions & 24 deletions BepInEx.MelonLoader.Loader/MLLoaderPlugin.cs

This file was deleted.

40 changes: 0 additions & 40 deletions Il2CppAssemblyGenerator/Config.cs

This file was deleted.

Loading

0 comments on commit a2a61d7

Please sign in to comment.