-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUITools.cs
49 lines (43 loc) · 2.1 KB
/
GUITools.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
using BepInEx;
using BepInEx.Configuration;
using DevTools.Humankind.GUITools.UI;
using Modding.Humankind.DevTools;
namespace DevTools.Humankind.GUITools
{
// [BepInDependency("UniverseLib.Mono", BepInDependency.DependencyFlags.SoftDependency)]
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency("Modding.Humankind.DevTools")]
[BepInDependency("DevTools.Humankind.SharedAssets")]
public class GUITools : BaseUnityPlugin
{
ConfigEntry<bool> QuietMode { get; set; }
ConfigEntry<bool> DebugMode { get; set; }
ConfigEntry<bool> WriteLogToDisk { get; set; }
ConfigEntry<bool> LiveEditorInspectorTab { get; set; }
private void Awake()
{
QuietMode = Config.Bind("Logging", "QuietMode", true,
new ConfigDescription("Disables this plugin's own message logger."));
WriteLogToDisk = Config.Bind("Logging", "WriteLogToDisk", true,
new ConfigDescription("Enables writing plugin's logger output to BepInEx's log file."));
DebugMode = Config.Bind("Development", "DebugMode", false,
new ConfigDescription(
"Enables some development features like keeping/restoring ui state when hot-reloading changes."));
LiveEditorInspectorTab = Config.Bind("Development", "LiveEditorInspectorTab", true,
new ConfigDescription("Whether to display the Inspector tab in Live Editor Mode."));
FeatureFlags.QuietMode = QuietMode.Value;
FeatureFlags.WriteLogToDisk = WriteLogToDisk.Value;
FeatureFlags.DebugMode = DebugMode.Value;
FeatureFlags.Inspector = LiveEditorInspectorTab.Value;
MainTools.IsDebugModeEnabled = FeatureFlags.DebugMode;
Loggr.WriteLogToDisk = FeatureFlags.WriteLogToDisk;
Modding.Humankind.DevTools.DevTools.QuietMode = FeatureFlags.QuietMode;
MainTools.Main();
}
private void OnDestroy()
{
MainTools.Unload(false);
Destroy(gameObject);
}
}
}