-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Plugin.cs
39 lines (32 loc) · 891 Bytes
/
Plugin.cs
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
using BetterSongList.UI;
using BetterSongList.Util;
using HarmonyLib;
using IPA;
using IPA.Config.Stores;
using System.Reflection;
using IPALogger = IPA.Logging.Logger;
namespace BetterSongList {
[Plugin(RuntimeOptions.SingleStartInit)]
public class Plugin {
internal static Plugin Instance { get; private set; }
internal static IPALogger Log { get; private set; }
internal static Harmony harmony { get; private set; }
[Init]
public void Init(IPALogger logger, IPA.Config.Config conf) {
Instance = this;
Log = logger;
Config.Instance = conf.Generated<Config>();
}
[OnStart]
public void OnApplicationStart() {
harmony = new Harmony("Kinsi55.BeatSaber.BetterSongList");
harmony.PatchAll(Assembly.GetExecutingAssembly());
PlaylistsUtil.Init();
PPUtil.Init();
}
[OnExit]
public void OnApplicationQuit() {
harmony.UnpatchSelf();
}
}
}