-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlugin.cs
More file actions
45 lines (39 loc) · 1.32 KB
/
Plugin.cs
File metadata and controls
45 lines (39 loc) · 1.32 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
43
44
45
using BeatSaberMarkupLanguage.GameplaySetup;
using BeatSaberMarkupLanguage.Settings;
using HarmonyLib;
using IPA;
using IPA.Config.Stores;
using System.Reflection;
using IPALogger = IPA.Logging.Logger;
namespace NoteCutGuide {
[Plugin(RuntimeOptions.DynamicInit)]
public class Plugin {
internal static Plugin Instance;
internal static IPALogger Log;
internal static Harmony harmony;
// Rainbow
internal static float RainbowPls = 0f;
[Init]
public Plugin(IPALogger logger, IPA.Config.Config conf) {
Instance = this;
Log = logger;
Config.Instance = conf.Generated<Config>();
harmony = new Harmony("Kinsi55.BeatSaber.NoteCutGuide");
}
[OnEnable]
public void OnEnable() {
harmony.PatchAll(Assembly.GetExecutingAssembly());
BS_Utils.Utilities.BSEvents.lateMenuSceneLoadedFresh += LateMenuSceneLoadedFresh;
}
public void LateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO scene) {
BSMLSettings.Instance.AddSettingsMenu("NoteCutGuide", "NoteCutGuide.Views.settings.bsml", Config.Instance);
GameplaySetup.Instance.AddTab("NoteCutGuide", "NoteCutGuide.Views.settings.bsml", Config.Instance, MenuType.All);
}
[OnDisable]
public void OnDisable() {
harmony.UnpatchSelf();
BSMLSettings.Instance.RemoveSettingsMenu(Config.Instance);
GameplaySetup.Instance.RemoveTab("NoteCutGuide");
}
}
}