WKLib 0.2.3
A modding library for White Knuckle
Loading...
Searching...
No Matches
CL_GameManagerPatch.cs
Go to the documentation of this file.
1using HarmonyLib;
3using WKLib.Core.UI;
4using static WKLib.Core.Config.ConfigManager;
5
7
8[PatchOnEntry]
9[HarmonyPatch]
10internal static class CL_GameManagerPatch
11{
12 [HarmonyPatch(typeof(CL_GameManager), nameof(CL_GameManager.UnPause)), HarmonyPostfix]
13 private static void CL_GameManager_UnPause(CL_GameManager __instance)
14 {
15 if (RootPanel.Instance == null)
16 return;
17
18 if (!AutoCloseOverlay.Value
19 || !RootPanel.Instance.IsOpen
20 || __instance.isPaused)
21 return;
22
23 RootPanel.Instance.IsOpen = false;
24 }
25}