From 1e6bacb32bb67d177657e9379dc18fc21d736b3f Mon Sep 17 00:00:00 2001 From: Sinai <49360850+sinai-dev@users.noreply.github.com> Date: Thu, 23 Sep 2021 16:21:47 +1000 Subject: [PATCH] manual unity libs no longer required for BepInEx --- README.md | 1 - src/Hooks/HookManager.cs | 67 ++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index a4fc16f..6dcde5c 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ | BIE 5.X | ✖️ n/a | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx5.Mono.zip) | 1. Take the `UnityExplorer.BIE.[version].dll` file and put it in `BepInEx\plugins\` -2. In IL2CPP, you will need to download the [Unity libs](https://github.com/LavaGang/Unity-Runtime-Libraries) for the game's Unity version, create a folder `BepInEx\unity-libs\`, then extract the Unity libs into this folder. Note: BepInEx 6 is obtainable via [BepisBuilds](https://builds.bepis.io/projects/bepinex_be) diff --git a/src/Hooks/HookManager.cs b/src/Hooks/HookManager.cs index 96b3e1c..9eb058d 100644 --- a/src/Hooks/HookManager.cs +++ b/src/Hooks/HookManager.cs @@ -68,6 +68,8 @@ namespace UnityExplorer.Hooks // Set current hook cell + public void OnCellBorrowed(HookCell cell) { } + public void SetCell(HookCell cell, int index) { if (index >= this.currentHooks.Count) @@ -163,6 +165,36 @@ namespace UnityExplorer.Hooks Panel.AddHooksScrollPool.Refresh(true, true); } + // Set eligable method cell + + public void OnCellBorrowed(AddHookCell cell) { } + + public void SetCell(AddHookCell cell, int index) + { + if (index >= this.filteredEligableMethods.Count) + { + cell.Disable(); + return; + } + + cell.CurrentDisplayedIndex = index; + var method = this.filteredEligableMethods[index]; + + cell.MethodNameLabel.text = HighlightMethod(method); + + var sig = method.FullDescription(); + if (hookedSignatures.Contains(sig)) + { + cell.HookButton.Component.gameObject.SetActive(false); + cell.HookedLabel.gameObject.SetActive(true); + } + else + { + cell.HookButton.Component.gameObject.SetActive(true); + cell.HookedLabel.gameObject.SetActive(false); + } + } + // ~~~~~~~~~~~ Hook source editor window ~~~~~~~~~~~ public void OnEditorInputChanged(string value) @@ -191,40 +223,7 @@ namespace UnityExplorer.Hooks } } - // OnBorrow methods not needed - public void OnCellBorrowed(HookCell cell) { } - public void OnCellBorrowed(AddHookCell cell) { } - - - // Set eligable method cell - - public void SetCell(AddHookCell cell, int index) - { - if (index >= this.filteredEligableMethods.Count) - { - cell.Disable(); - return; - } - - cell.CurrentDisplayedIndex = index; - var method = this.filteredEligableMethods[index]; - - cell.MethodNameLabel.text = HighlightMethod(method); - - var sig = method.FullDescription(); - if (hookedSignatures.Contains(sig)) - { - cell.HookButton.Component.gameObject.SetActive(false); - cell.HookedLabel.gameObject.SetActive(true); - } - else - { - cell.HookButton.Component.gameObject.SetActive(true); - cell.HookedLabel.gameObject.SetActive(false); - } - } - - // private static readonly string VOID_HIGHLIGHT = $"void "; + // ~~~~~~~~~~ Method syntax highlighting private static readonly Dictionary highlightedMethods = new Dictionary();