Upload files to "Patches"
This commit is contained in:
1 parent
07baed88f8
commit
f1a53b1283
4 files changed
+149
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using HarmonyLib;
|
||||
using System.Reflection;
|
||||
|
||||
namespace FortniteEmoteWheel.Patches;
|
||||
|
||||
public class HarmonyPatches
|
||||
{
|
||||
private static Harmony instance;
|
||||
|
||||
public static bool IsPatched { get; private set; }
|
||||
public const string InstanceId = Constants.Guid;
|
||||
|
||||
internal static void ApplyHarmonyPatches()
|
||||
{
|
||||
if (!IsPatched)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new Harmony(InstanceId);
|
||||
}
|
||||
|
||||
instance.PatchAll(Assembly.GetExecutingAssembly());
|
||||
IsPatched = true;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void RemoveHarmonyPatches()
|
||||
{
|
||||
if (instance != null && IsPatched)
|
||||
{
|
||||
instance.UnpatchSelf();
|
||||
IsPatched = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user