-
Notifications
You must be signed in to change notification settings - Fork 5
/
Core.cs
34 lines (31 loc) · 1005 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
using System;
using System.Reflection;
using Harmony;
using Newtonsoft.Json;
namespace WeaponRealizer
{
public static partial class Core
{
public const string ModName = "WeaponRealizer";
public const string ModId = "com.joelmeador.WeaponRealizer";
internal static Settings ModSettings = new Settings();
internal static string ModDirectory;
public static void Init(string directory, string settingsJson)
{
ModDirectory = directory;
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());
Patches.Apply(harmony);
}
}
}