WKLib 0.2.3
A modding library for White Knuckle
Loading...
Searching...
No Matches
InputManagerPatch.cs
Go to the documentation of this file.
1using HarmonyLib;
2using ImuiBepInEx.API;
4using WKLib.Core.UI;
5
6namespace WKLib.Core.Patches;
7
8[PatchOnEntry]
9[HarmonyPatch]
10internal static class InputManagerPatch
11{
12 [HarmonyPatch(typeof(InputManager), nameof(InputManager.Start)), HarmonyPostfix]
13 private static void InputManager_Start(InputManager __instance)
14 {
15 if (RootPanel.Instance != null)
16 return;
17
18 var imuiPanel = ImuiBepInExAPI.CreateImuiPanel();
19 imuiPanel.Backend.gameObject.SetActive(false);
20
21 var rootPanel = imuiPanel.Backend.gameObject.AddComponent<RootPanel>();
22 rootPanel.ImuiPanel = imuiPanel;
23
24 imuiPanel.Backend.gameObject.SetActive(true);
25 }
26}