forked from ajkroeg/ShellShuffler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModInit.cs
76 lines (68 loc) · 2.81 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.Reflection;
using HBS.Collections;
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 int MaxTriesAmount = 10;
public List<string> blacklistAmmoboxOutTags = new List<string>();
private TagSet f_BlacklistAmmoboxOutTags = null;
public TagSet BlacklistAmmoboxOutTags
{
get
{
if (f_BlacklistAmmoboxOutTags == null) { f_BlacklistAmmoboxOutTags = new TagSet(blacklistAmmoboxOutTags); }
return f_BlacklistAmmoboxOutTags;
}
}
public List<string> blacklistAmmoboxInTags = new List<string>();
private TagSet f_BlacklistAmmoboxInTags = null;
public TagSet BlacklistAmmoboxInTags
{
get
{
if (f_BlacklistAmmoboxInTags == null) { f_BlacklistAmmoboxInTags = new TagSet(blacklistAmmoboxInTags); }
return f_BlacklistAmmoboxInTags;
}
}
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>>();
}
}