WKLib 0.2.3
A modding library for White Knuckle
Loading...
Searching...
No Matches
ConfigManager.cs
Go to the documentation of this file.
1using BepInEx.Configuration;
2using UnityEngine;
3using WKLib.Core.UI;
4
6
7public static class ConfigManager
8{
9 public static ConfigEntry<KeyCode> OverlayKey;
10
11 public static ConfigEntry<bool> AutoCloseOverlay;
12 public static ConfigEntry<bool> EnableDemoWindow;
13
14 // Theme settings
15 public static ConfigEntry<bool> HighContrast;
16 public static ConfigEntry<Color> AccentColor;
17
18 public static void CreateEntries(ConfigFile Config)
19 {
20 OverlayKey = Config.Bind(
21 "General",
22 "Overlay Key",
23 KeyCode.F6,
24 "Keybind for opening and closing the overlay menu"
25 );
26
27 AutoCloseOverlay = Config.Bind(
28 "General",
29 "Auto Close Overlay",
30 true,
31 "Automatically close overlay on scene change");
32
33 EnableDemoWindow = Config.Bind(
34 "General",
35 "Enable Demo Window",
36 false,
37 "Enable demo window, used to showcase the WKLib UI");
38
39 // Theme
40 HighContrast = Config.Bind(
41 "Theme",
42 "High Contrast",
43 false,
44 "Apply high contrast to the UI");
45
46 AccentColor = Config.Bind(
47 "Theme",
48 "Accent color",
49 new Color(0.05f, 0.45f, 0.75f, 1f),
50 "Change accent color of the UI");
51
52 HighContrast.SettingChanged += (sender, args) =>
53 {
54 RootPanel.Instance?.ThemeController?.RegisterChanges();
55 };
56
57 AccentColor.SettingChanged += (sender, args) =>
58 {
59 RootPanel.Instance?.ThemeController?.RegisterChanges();
60 };
61 }
62}
static ConfigEntry< KeyCode > OverlayKey
static ConfigEntry< bool > AutoCloseOverlay
static ConfigEntry< bool > HighContrast
static ConfigEntry< Color > AccentColor
static ConfigEntry< bool > EnableDemoWindow
static void CreateEntries(ConfigFile Config)