1
0
mirror of synced 2024-11-23 22:00:56 +01:00

Moved patches to a patches folder

This commit is contained in:
Fluto 2022-08-20 13:10:57 +10:00
parent 4c9dd810e1
commit 5daea91e06
8 changed files with 21 additions and 39 deletions

View File

@ -1,20 +0,0 @@

#if TAIKO_IL2CPP
using System;
using System.Runtime.InteropServices;
// using Il2CppSystem.Runtime.InteropServices;
using UnhollowerBaseLib;
namespace TakoTako;
public class ReferenceObject<T> : Il2CppObjectBase
{
public T Value { get; private set; }
public ReferenceObject(IntPtr pointer) : base(pointer)
{
Value = Marshal.PtrToStructure<T>(pointer);
}
public static implicit operator T (ReferenceObject<T> value) => value.Value;
}
#endif

View File

@ -23,14 +23,14 @@ using SongSelectRanking;
using TakoTako.Common;
using UnityEngine;
namespace TakoTako;
namespace TakoTako.Patches;
/// <summary>
/// This will allow custom songs to be read in
/// </summary>
[HarmonyPatch]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class MusicPatch
public class CustomMusicLoaderPatch
{
public static int SaveDataMax => DataConst.MusicMax;

View File

@ -1,9 +1,9 @@
using HarmonyLib;
namespace TakoTako;
namespace TakoTako.Patches;
[HarmonyPatch]
public class DisableScreenChangeOnFocus
public class DisableScreenChangeOnFocusPatch
{
[HarmonyPatch(typeof(FocusManager), "OnApplicationFocus")]
[HarmonyPrefix]
@ -18,4 +18,4 @@ public class DisableScreenChangeOnFocus
{
return false;
}
}
}

View File

@ -5,7 +5,8 @@ using Microsoft.Xbox;
#if TAIKO_IL2CPP
using Il2CppMicrosoft.Xbox;
#endif
namespace TakoTako;
namespace TakoTako.Patches;
/// <summary>
/// This patch will address the issue where signing with GDK is done correctly

View File

@ -1,11 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using HarmonyLib;
namespace TakoTako;
namespace TakoTako.Patches;
#if TAIKO_IL2CPP
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class SkipDLCCheck
public class SkipDLCCheckPatch
{
private static SongSelectManager songSelectManager;

View File

@ -1,11 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using HarmonyLib;
namespace TakoTako;
namespace TakoTako.Patches;
[HarmonyPatch]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class SkipSplashScreen
public class SkipSplashScreenPatch
{
/// <summary>
/// Simply load the next scene, I don't think this scene does anything specific?
@ -17,4 +17,4 @@ public class SkipSplashScreen
TaikoSingletonMonoBehaviour<CommonObjects>.Instance.MySceneManager.ChangeScene("Title", false);
__instance.gameObject.SetActive(false);
}
}
}

View File

@ -8,12 +8,12 @@ using Array = Il2CppSystem.Array;
using UnhollowerBaseLib;
#endif
namespace TakoTako;
namespace TakoTako.Patches;
[HarmonyPatch]
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("Member Access", "Publicizer001:Accessing a member that was not originally public")]
public class TaikoDrumSupport
public class TaikoDrumSupportPatch
{
private const float analogThreshold = 0.333f;

View File

@ -4,6 +4,7 @@ using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TakoTako.Patches;
using UnityEngine;
#if TAIKO_IL2CPP
using BepInEx.IL2CPP.Utils;
@ -132,26 +133,26 @@ namespace TakoTako
_harmony = new Harmony(PluginInfo.PLUGIN_GUID);
if (ConfigSkipSplashScreen.Value)
_harmony.PatchAll(typeof(SkipSplashScreen));
_harmony.PatchAll(typeof(SkipSplashScreenPatch));
if (ConfigFixSignInScreen.Value)
_harmony.PatchAll(typeof(SignInPatch));
if (ConfigDisableScreenChangeOnFocus.Value)
_harmony.PatchAll(typeof(DisableScreenChangeOnFocus));
_harmony.PatchAll(typeof(DisableScreenChangeOnFocusPatch));
if (ConfigEnableTaikoDrumSupport.Value)
_harmony.PatchAll(typeof(TaikoDrumSupport));
_harmony.PatchAll(typeof(TaikoDrumSupportPatch));
#if TAIKO_IL2CPP
if (ConfigSkipDLCCheck.Value)
_harmony.PatchAll(typeof(SkipDLCCheck));
_harmony.PatchAll(typeof(SkipDLCCheckPatch));
#endif
if (ConfigEnableCustomSongs.Value)
{
_harmony.PatchAll(typeof(MusicPatch));
MusicPatch.Setup(_harmony);
_harmony.PatchAll(typeof(CustomMusicLoaderPatch));
CustomMusicLoaderPatch.Setup(_harmony);
}
}