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

chore: Add BepInEx 5 project

This commit is contained in:
Repflez 2022-05-24 03:09:00 -06:00
parent b21cabb6dd
commit d3fb19aef8
4 changed files with 127 additions and 74 deletions

View File

@ -1,12 +1,18 @@
using BepInEx;
#if !BEPIN_5
using BepInEx.IL2CPP;
#endif
using BepInEx.Configuration;
using HarmonyLib;
namespace TaikoModStuff
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
#if !BEPIN_5
public class Plugin : BasePlugin
#else
public class Plugin : BaseUnityPlugin
#endif
{
public static ConfigEntry<bool> configForceFontChange;
@ -22,7 +28,11 @@ namespace TaikoModStuff
public static ConfigEntry<bool> configQuickRestart;
public static ConfigEntry<bool> configQuickQuitSong;
#if !BEPIN_5
public override void Load()
#else
private void Awake()
#endif
{
// Add configurations
configForceFontChange = Config.Bind("General.Toggles",
@ -87,7 +97,11 @@ namespace TaikoModStuff
instance.PatchAll(typeof(QuickQuitSong));
// Plugin startup logic
#if !BEPIN_5
Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
#else
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
#endif
}
}
}

View File

@ -1,5 +1,9 @@
using HarmonyLib;
#if !BEPIN_5
using Il2CppMicrosoft.Xbox;
#else
using Microsoft.Xbox;
#endif
namespace TaikoModStuff
{

View File

@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<AssemblyName>TaikoModStuff</AssemblyName>
<Description>My first plugin</Description>
<Version>1.3.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>TaikoModStuff</PackageId>
<Authors>TaikoModStuff</Authors>
<Product>TaikoModStuff</Product>
<RootNamespace>TaikoModStuff</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;BEPIN_5</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;BEPIN_5</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="UnityEngine.Modules" Version="2020.3.19" IncludeAssets="compile" />
<PackageReference Include="Taiko.GameLibs" Version="1.2.2-r.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>
</Project>