using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using LimitPerkPool.UI; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("LimitPerkPool")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LimitPerkPool")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("fcd0a3b8-5916-4304-b2af-f66fbc68ff14")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace LimitPerkPool { [BepInPlugin("nachariah.whiteknuckle.limitperkpool", "LimitPerkPool", "2.0.2")] [BepInProcess("White Knuckle.exe")] public class Plugin : BaseUnityPlugin { public const string GUID = "nachariah.whiteknuckle.limitperkpool"; public static Plugin Instance; public MenuUI drawer; public Dictionary AllowedPerks = new Dictionary(); private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown Instance = this; ((BaseUnityPlugin)this).Logger.LogInfo((object)"[LimitPerkPool] Patching..."); Harmony val = new Harmony("nachariah.whiteknuckle.limitperkpool"); val.PatchAll(); SceneManager.sceneLoaded += OnSceneLoaded; ((BaseUnityPlugin)this).Logger.LogInfo((object)"[LimitPerkPool] Loaded"); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if ((Object)(object)drawer == (Object)null) { drawer = MenuUI.Create(); } if ((Object)(object)drawer != (Object)null) { ((Behaviour)drawer.rootCanvas).enabled = ((Scene)(ref scene)).name == "Main-Menu"; } if (((Scene)(ref scene)).name == "Game-Main") { CommandConsole.hasCheated = true; CL_GameManager.gamemode.allowAchievements = false; CL_GameManager.gamemode.allowCheatedScores = false; UpdateAllowedPerks(); } else if (((Scene)(ref scene)).name == "Main-Menu" && (Object)(object)drawer != (Object)null) { drawer.CloseDrawer(); drawer.PopulatePerkToggles(UpdateAllowedPerks()); } } public Dictionary UpdateAllowedPerks() { Debug.Log((object)"[LimitPerkPool] Updating Perks"); List perkAssets = CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets; if (perkAssets == null || perkAssets.Count == 0) { Debug.LogError((object)"[LimitPerkPool] Perk Update fail due to no/null perks"); return null; } string[] array = new string[6] { "_Injury", "_Rho", "_Binding", "_Trinket", "_Upgrade", "_Debuff" }; foreach (Perk item in perkAssets) { string name = ((Object)item).name; bool flag = name.Contains("_C") || name.Contains("_T"); bool flag2 = false; string[] array2 = array; foreach (string value in array2) { if (name.Contains(value)) { flag2 = true; break; } } if (!(!flag || flag2)) { ConfigEntry val = ((BaseUnityPlugin)Instance).Config.Bind("PerkToggles", name, true, "Enable or disable '" + name + "'"); AllowedPerks[name] = val.Value; } } return AllowedPerks; } } } namespace LimitPerkPool.UI { public class MenuUI : MonoBehaviour { public Canvas rootCanvas; public RectTransform drawerPanel; public RectTransform handleRect; public Button handleButton; private RectTransform scrollContent; private bool isOpen = false; private float drawerWidth = 400f; private float speed = 1800f; public static MenuUI Create() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("PerkDrawer"); Object.DontDestroyOnLoad((Object)(object)val); MenuUI menuUI = val.AddComponent(); menuUI.BuildUI(); return menuUI; } private void BuildUI() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Expected O, but got Unknown //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Expected O, but got Unknown //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Expected O, but got Unknown //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) rootCanvas = new GameObject("DrawerCanvas").AddComponent(); rootCanvas.renderMode = (RenderMode)0; rootCanvas.sortingOrder = 1; ((Component)rootCanvas).gameObject.AddComponent(); ((Component)rootCanvas).gameObject.AddComponent(); Object.DontDestroyOnLoad((Object)(object)((Component)rootCanvas).gameObject); GameObject val = new GameObject("DrawerPanel", new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent(((Component)rootCanvas).transform, false); drawerPanel = val.GetComponent(); drawerPanel.anchorMin = new Vector2(1f, 0f); drawerPanel.anchorMax = new Vector2(1f, 1f); drawerPanel.pivot = new Vector2(1f, 0.5f); drawerPanel.sizeDelta = new Vector2(drawerWidth, 0f); drawerPanel.anchoredPosition = new Vector2(0f, 0f); ((Graphic)val.GetComponent()).color = new Color(0f, 0f, 0f, 0.7f); GameObject val2 = new GameObject("HandleButton", new Type[3] { typeof(RectTransform), typeof(Image), typeof(Button) }); val2.transform.SetParent(((Component)rootCanvas).transform, false); handleRect = val2.GetComponent(); handleRect.sizeDelta = new Vector2(30f, 100f); handleRect.anchorMin = new Vector2(1f, 0.5f); handleRect.anchorMax = new Vector2(1f, 0.5f); handleRect.pivot = new Vector2(0f, 0.5f); handleRect.anchoredPosition = new Vector2(0f - drawerWidth, 0f); ((Graphic)val2.GetComponent()).color = Color.black; Outline val3 = val2.AddComponent(); ((Shadow)val3).effectColor = Color.white; ((Shadow)val3).effectDistance = new Vector2(1f, -1f); handleButton = val2.GetComponent