-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCore.cs
35 lines (31 loc) · 965 Bytes
/
Core.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
using System;
using System.Reflection;
using Harmony;
using Newtonsoft.Json;
namespace CharlesB
{
public class Core
{
public const string ModName = "CharlesB";
public const string ModId = "com.joelmeador.CharlesB";
internal static Settings ModSettings = new Settings();
internal static string ModDirectory;
public static void Init(string directory, string settingsJSON)
{
ModDirectory = directory;
Logger.Setup();
try
{
ModSettings = JsonConvert.DeserializeObject<Settings>(settingsJSON);
}
catch (Exception ex)
{
Logger.Error(ex);
ModSettings = new Settings();
}
HarmonyInstance.DEBUG = ModSettings.debug;
var harmony = HarmonyInstance.Create(ModId);
harmony.PatchAll(Assembly.GetExecutingAssembly());
}
}
}