-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItemWeights.cs
58 lines (41 loc) · 1.51 KB
/
ItemWeights.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
47
48
49
50
51
52
53
54
55
56
57
58
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using ItemWeights.Helpers;
using LethalConfig;
using LethalConfig.ConfigItems;
namespace ItemWeights;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("ainavt.lc.lethalconfig")]
[BepInDependency("com.rune580.LethalCompanyInputUtils")]
public class ItemWeights : BaseUnityPlugin
{
public static ItemWeights Instance { get; private set; } = null!;
public static ConfigFile Config_Data;
public static bool logTerminalNodes;
internal new static ManualLogSource Logger { get; private set; } = null!;
internal static Harmony? Harmony { get; set; }
internal static ItemWeightsKeybindHelper InputActionsInstance;
private void Awake()
{
Logger = base.Logger;
Instance = this;
Config_Data = Config;
// CONFIG
ItemWeightsConfigHelper.SetLethalConfig(Config_Data);
InputActionsInstance = new ItemWeightsKeybindHelper();
logTerminalNodes = ItemWeightsConfigHelper.LogTerminalNodes.Value;
//PATCHING
ItemWeightsCallbacks.StartKeybindCallbacks();
Patch();
Logger.LogInfo($"{MyPluginInfo.PLUGIN_GUID} v{MyPluginInfo.PLUGIN_VERSION} has loaded!");
}
internal static void Patch()
{
Harmony ??= new Harmony(MyPluginInfo.PLUGIN_GUID);
Logger.LogDebug("Patching...");
Harmony.PatchAll();
Logger.LogDebug("Finished patching!");
}
}