-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMedicalSystemExpansion.cs
97 lines (70 loc) · 2.81 KB
/
MedicalSystemExpansion.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using System;
using HugsLib;
using HugsLib.Settings;
using Verse;
namespace MSE2
{
public class MedicalSystemExpansion : ModBase
{
public override void Initialize ()
{
base.Initialize();
Instance = this;
}
public override void DefsLoaded ()
{
#if DEBUG
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
#endif
try
{
base.DefsLoaded();
AutoRecipeUserUtilities.ApplyAutoRecipeUsers();
IncludedPartsUtilities.CacheAllStandardParents();
IgnoreSubPartsUtilities.IgnoreAllNonCompedSubparts();
IgnoreSubPartsUtilities.IgnoreUnsupportedSubparts();
LimbRecipeDefGenerator.AddExtraRecipesToDefDatabase();
IncludedPartsUtilities.PrintIncompatibleVersionsReport();
this.SetupSettingHandles();
}
catch ( Exception ex )
{
Log.Error( "[MSE2] Exception caught running DefsLoaded(): " + ex );
}
#if DEBUG
finally
{
stopwatch.Stop();
Log.Message( "[MSE2] DefsLoaded completed in " + stopwatch.Elapsed );
}
#endif
}
public override string ModIdentifier => "MSE2";
public static MedicalSystemExpansion Instance { get; private set; }
// settings
private void SetupSettingHandles ()
{
this.hediffHideModeSetting = Settings.GetHandle( "hediffHideMode",
"HediffHideModeSetting_Title".Translate(),
"HediffHideModeSetting_Description".Translate(),
HediffHideMode.Clean, null,
"HediffHideModeSetting_" );
this.hideModuleSlotsSetting = Settings.GetHandle( "hideModuleSlots",
"HideModuleSlotsSetting_Title".Translate(),
"HideModuleSlotsSetting_Description".Translate(),
defaultValue: false );
this.removeAllFromSegmentSetting = Settings.GetHandle( "removeAllFromSegment",
"RemoveAllFromSegmentSetting_Title".Translate(),
"RemoveAllFromSegmentSetting_Description".Translate(),
defaultValue: false );
}
public enum HediffHideMode { Always, Never, Clean, CleanOrModules }
private SettingHandle<HediffHideMode> hediffHideModeSetting;
public HediffHideMode HediffHideModeSetting => this.hediffHideModeSetting;
private SettingHandle<bool> removeAllFromSegmentSetting;
public bool RemoveAllFromSegmentSetting { get => this.removeAllFromSegmentSetting; }
private SettingHandle<bool> hideModuleSlotsSetting;
public bool HideModuleSlotsSetting { get => this.hideModuleSlotsSetting; }
}
}