From 66dcb19e991e08675f630f19bdf7480439ff2e0b Mon Sep 17 00:00:00 2001 From: Xander Date: Thu, 12 Jan 2023 22:55:56 -0600 Subject: [PATCH] Add back hide nativeinfoptr option --- src/Config/ConfigManager.cs | 6 ++++++ src/Runtime/UERuntimeHelper.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/Config/ConfigManager.cs b/src/Config/ConfigManager.cs index 42df799..6a3d1a1 100644 --- a/src/Config/ConfigManager.cs +++ b/src/Config/ConfigManager.cs @@ -27,6 +27,7 @@ namespace UnityExplorer.Config public static ConfigElement UI_MouseInspect_Keybind; public static ConfigElement CSConsole_Assembly_Blacklist; public static ConfigElement Reflection_Signature_Blacklist; + public static ConfigElement Reflection_Hide_NativeInfoPtrs; // internal configs internal static InternalConfigHandler InternalHandler { get; private set; } @@ -139,6 +140,11 @@ namespace UnityExplorer.Config "Seperate signatures with a semicolon ';'.\r\n" + "For example, to blacklist Camera.main, you would add 'UnityEngine.Camera.main;'", ""); + + Reflection_Hide_NativeInfoPtrs = new("Hide NativeMethodInfoPtr_s and NativeFieldInfoPtr_s", + "Use this to blacklist NativeMethodPtr_s and NativeFieldInfoPtrs_s from the class inspector, mainly to reduce clutter.\r\n" + + "For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.", + false); } } } diff --git a/src/Runtime/UERuntimeHelper.cs b/src/Runtime/UERuntimeHelper.cs index 6786d42..737fb96 100644 --- a/src/Runtime/UERuntimeHelper.cs +++ b/src/Runtime/UERuntimeHelper.cs @@ -70,6 +70,12 @@ namespace UnityExplorer.Runtime public static bool IsBlacklisted(MemberInfo member) { + if (ConfigManager.Reflection_Hide_NativeInfoPtrs.Value) { + bool isNativeInfoPtr = member.Name.StartsWith("NativeFieldInfoPtr_") || member.Name.StartsWith("NativeMethodInfoPtr_"); + if (isNativeInfoPtr) + return true; + } + if (string.IsNullOrEmpty(member.DeclaringType?.Namespace)) return false;