mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2026-10-10 20:23:13 +08:00
starting reflection inspector filters, some fixes
This commit is contained in:
@@ -17,8 +17,8 @@ namespace UnityExplorer.Console.Lexer
|
||||
|
||||
public override bool IsImplicitMatch(CSharpLexer lexer)
|
||||
{
|
||||
if (!char.IsWhiteSpace(lexer.Previous) ||
|
||||
lexer.IsSpecialSymbol(lexer.Previous, DelimiterType.End))
|
||||
if (!char.IsWhiteSpace(lexer.Previous) &&
|
||||
!lexer.IsSpecialSymbol(lexer.Previous, DelimiterType.End))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
+6
-6
@@ -23,10 +23,10 @@ namespace UnityExplorer
|
||||
|
||||
public static bool ShowMenu
|
||||
{
|
||||
get => m_showMenu;
|
||||
get => s_showMenu;
|
||||
set => SetShowMenu(value);
|
||||
}
|
||||
public static bool m_showMenu;
|
||||
public static bool s_showMenu;
|
||||
|
||||
private static bool s_doneUIInit;
|
||||
private static float s_timeSinceStartup;
|
||||
@@ -100,13 +100,13 @@ namespace UnityExplorer
|
||||
#if CPP
|
||||
try
|
||||
{
|
||||
Application.add_logMessageReceived(new Action<string, string, LogType>(LogCallback));
|
||||
Application.add_logMessageReceived(new Action<string, string, LogType>(OnUnityLog));
|
||||
SceneManager.add_sceneLoaded(new Action<Scene, LoadSceneMode>((Scene a, LoadSceneMode b) => { OnSceneLoaded(); }));
|
||||
SceneManager.add_activeSceneChanged(new Action<Scene, Scene>((Scene a, Scene b) => { OnSceneLoaded(); }));
|
||||
}
|
||||
catch { }
|
||||
#else
|
||||
Application.logMessageReceived += LogCallback;
|
||||
Application.logMessageReceived += OnUnityLog;
|
||||
SceneManager.sceneLoaded += (Scene a, LoadSceneMode b) => { OnSceneLoaded(); };
|
||||
SceneManager.activeSceneChanged += (Scene a, Scene b) => { OnSceneLoaded(); };
|
||||
#endif
|
||||
@@ -119,7 +119,7 @@ namespace UnityExplorer
|
||||
|
||||
private static void SetShowMenu(bool show)
|
||||
{
|
||||
m_showMenu = show;
|
||||
s_showMenu = show;
|
||||
|
||||
if (UIManager.CanvasRoot)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ namespace UnityExplorer
|
||||
ForceUnlockCursor.UpdateCursorControl();
|
||||
}
|
||||
|
||||
private void LogCallback(string message, string stackTrace, LogType type)
|
||||
private void OnUnityLog(string message, string stackTrace, LogType type)
|
||||
{
|
||||
if (!DebugConsole.LogUnity)
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#if ML
|
||||
using System;
|
||||
using MelonLoader;
|
||||
using UnityExplorer.UI.Modules;
|
||||
|
||||
namespace UnityExplorer
|
||||
{
|
||||
|
||||
@@ -83,7 +83,14 @@ namespace UnityExplorer.Helpers
|
||||
if (type.Namespace.StartsWith("System.") || type.Namespace.StartsWith("Il2CppSystem."))
|
||||
return ilObject.GetType();
|
||||
|
||||
var getType = Type.GetType(ilObject.GetIl2CppType().AssemblyQualifiedName);
|
||||
var il2cppType = ilObject.GetIl2CppType();
|
||||
|
||||
// check if type is injected
|
||||
IntPtr classPtr = il2cpp_object_get_class(ilObject.Pointer);
|
||||
if (RuntimeSpecificsStore.IsInjected(classPtr))
|
||||
return GetTypeByName(il2cppType.FullName);
|
||||
|
||||
var getType = Type.GetType(il2cppType.AssemblyQualifiedName);
|
||||
|
||||
if (getType != null)
|
||||
return getType;
|
||||
|
||||
@@ -123,6 +123,7 @@ namespace UnityExplorer.Inspectors
|
||||
tabGroupObj.AddComponent<Mask>();
|
||||
|
||||
var targetButtonObj = UIFactory.CreateButton(tabGroupObj);
|
||||
targetButtonObj.AddComponent<Mask>();
|
||||
var targetButtonLayout = targetButtonObj.AddComponent<LayoutElement>();
|
||||
targetButtonLayout.minWidth = 165;
|
||||
targetButtonLayout.flexibleWidth = 0;
|
||||
|
||||
@@ -105,14 +105,14 @@ namespace UnityExplorer.Inspectors
|
||||
|
||||
public void SetInspectorTab(InspectorBase inspector)
|
||||
{
|
||||
MainMenu.Instance.SetPage(HomePage.Instance);
|
||||
|
||||
if (m_activeInspector == inspector)
|
||||
return;
|
||||
|
||||
UnsetInspectorTab();
|
||||
|
||||
MainMenu.Instance.SetPage(HomePage.Instance);
|
||||
m_activeInspector = inspector;
|
||||
|
||||
inspector.SetActive();
|
||||
|
||||
Color activeColor = new Color(0, 0.25f, 0, 1);
|
||||
|
||||
@@ -31,6 +31,9 @@ namespace UnityExplorer.Inspectors.Reflection
|
||||
public string RichTextName => m_richTextName ?? GetRichTextName();
|
||||
private string m_richTextName;
|
||||
|
||||
public string NameForFiltering => m_nameForFilter ?? (m_nameForFilter = $"{MemInfo.DeclaringType.Name}.{MemInfo.Name}".ToLower());
|
||||
private string m_nameForFilter;
|
||||
|
||||
public override bool CanWrite => m_canWrite ?? GetCanWrite();
|
||||
private bool? m_canWrite;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,7 @@ namespace UnityExplorer.Inspectors
|
||||
private int m_lastCount;
|
||||
|
||||
private Dropdown m_sceneDropdown;
|
||||
private Text m_sceneDropdownText;
|
||||
private Text m_scenePathText;
|
||||
private GameObject m_mainInspectBtn;
|
||||
private GameObject m_backButtonObj;
|
||||
@@ -135,9 +136,9 @@ namespace UnityExplorer.Inspectors
|
||||
m_sceneDropdown.options.Add(new Dropdown.OptionData { text = scene });
|
||||
}
|
||||
|
||||
if (!names.Contains(m_sceneDropdown.itemText.text))
|
||||
if (!names.Contains(m_sceneDropdownText.text))
|
||||
{
|
||||
m_sceneDropdown.transform.Find("Label").GetComponent<Text>().text = names[0];
|
||||
m_sceneDropdownText.text = names[0];
|
||||
SetTargetScene(handles[0]);
|
||||
}
|
||||
}
|
||||
@@ -317,6 +318,8 @@ namespace UnityExplorer.Inspectors
|
||||
dropdownLayout.minWidth = 320;
|
||||
dropdownLayout.flexibleWidth = 2;
|
||||
|
||||
m_sceneDropdownText = m_sceneDropdown.transform.Find("Label").GetComponent<Text>();
|
||||
|
||||
#if CPP
|
||||
m_sceneDropdown.onValueChanged.AddListener(new Action<int>((int val) => { SetSceneFromDropdown(val); }));
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user