-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
42 lines (38 loc) · 1.26 KB
/
Plugin.cs
File metadata and controls
42 lines (38 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Reflection;
using HarmonyLib;
using IPA;
using IPA.Config.Stores;
using IPALogger = IPA.Logging.Logger;
using SiraUtil.Zenject;
namespace BSNightcore
{
[Plugin(RuntimeOptions.SingleStartInit)]
public class Plugin
{
internal static Plugin Instance { get; private set; }
internal static IPALogger Log { get; private set; }
internal static Harmony HarmonyInstance { get; private set; }
[Init]
public Plugin(IPALogger logger, IPA.Config.Config config, Zenjector zenjector)
{
Instance = this;
Log = logger;
PluginConfig.Instance = config.Generated<PluginConfig>();
HarmonyInstance = new Harmony("com.lazycoder744.bsnightcore");
zenjector.Install<BSNightcoreInstaller>(Location.Menu);
}
[OnStart]
public void OnApplicationStart()
{
Log.Info("BSNightcore starting...");
HarmonyInstance.PatchAll(Assembly.GetExecutingAssembly());
Log.Info("BSNightcore started!");
}
[OnExit]
public void OnApplicationQuit()
{
Log.Info("BSNightcore stopping...");
HarmonyInstance.UnpatchSelf();
}
}
}