-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.cs
46 lines (39 loc) · 1.37 KB
/
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
40
41
42
43
44
45
46
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CrimsonFAQ.Services;
using CrimsonFAQ.Structs;
using CrimsonFAQ.Systems;
using HarmonyLib;
using System.IO;
using System.Reflection;
using VampireCommandFramework;
namespace CrimsonFAQ;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("gg.deca.VampireCommandFramework")]
public class Plugin : BasePlugin
{
Harmony _harmony;
internal static Plugin Instance { get; private set; }
public static Settings Settings { get; private set; }
public static Harmony Harmony => Instance._harmony;
public static ManualLogSource LogInstance => Instance.Log;
public static Database DB { get; internal set; }
public static PlayerService PlayerService { get; private set; }
public static string ConfigFiles => Path.Combine(Paths.ConfigPath, "CrimsonFAQ");
public override void Load()
{
Instance = this;
Settings = new Settings();
Settings.InitConfig();
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
CommandRegistry.RegisterAll();
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} version {MyPluginInfo.PLUGIN_VERSION} is loaded!");
DB = new Database();
}
public override bool Unload()
{
_harmony?.UnpatchSelf();
return true;
}
}