1
0
mirror of synced 2025-02-17 11:18:31 +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 TakoTako.Common;
using UnityEngine; using UnityEngine;
namespace TakoTako; namespace TakoTako.Patches;
/// <summary> /// <summary>
/// This will allow custom songs to be read in /// This will allow custom songs to be read in
/// </summary> /// </summary>
[HarmonyPatch] [HarmonyPatch]
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
public class MusicPatch public class CustomMusicLoaderPatch
{ {
public static int SaveDataMax => DataConst.MusicMax; public static int SaveDataMax => DataConst.MusicMax;

View File

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

View File

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

View File

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

View File

@ -1,11 +1,11 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using HarmonyLib; using HarmonyLib;
namespace TakoTako; namespace TakoTako.Patches;
[HarmonyPatch] [HarmonyPatch]
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
public class SkipSplashScreen public class SkipSplashScreenPatch
{ {
/// <summary> /// <summary>
/// Simply load the next scene, I don't think this scene does anything specific? /// Simply load the next scene, I don't think this scene does anything specific?

View File

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

View File

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