-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModInit.cs
54 lines (46 loc) · 1.94 KB
/
ModInit.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
using System;
using System.Collections.Generic;
using System.Reflection;
using Newtonsoft.Json;
namespace ShellShuffler.Init
{
public static class ModInit
{
internal static Logger modLog;
internal static string modDir;
public static ShellShufflerSettings modSettings = new ShellShufflerSettings();
public const string HarmonyPackage = "us.tbone.ShellShuffler";
public static void Init(string directory, string settingsJSON)
{
modDir = directory;
try
{
ModInit.modSettings = JsonConvert.DeserializeObject<ShellShufflerSettings>(settingsJSON);
}
catch (Exception)
{
ModInit.modSettings = new ShellShufflerSettings();
}
modLog = new Logger(modDir, "ShellShuffler", modSettings.enableLogging);
//var harmony = HarmonyInstance.Create(HarmonyPackage);
//harmony.PatchAll(Assembly.GetExecutingAssembly());
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), HarmonyPackage);
}
}
public class ShellShufflerSettings
{
public bool enableLogging = false;
public bool shuffleMechs = false;
public bool shuffleVehicles = false;
public bool shuffleTurrets = false;
public bool tagSetsUnion = false;
public float chanceToShuffle = 1f;
public int unShuffledBins = 1;
public List<string> unitBlackList = new List<string>();
public List<string> blackListShuffleIn = new List<string>();
public List<string> blackListShuffleOut = new List<string>();
public Dictionary<string, List<string>> mechDefTagAmmoList = new Dictionary<string, List<string>>();
public Dictionary<string, int> ammoWeight = new Dictionary<string, int>();
public Dictionary<string, List<string>> factionAmmoList = new Dictionary<string, List<string>>();
}
}