2020-08-07 22:19:03 +10:00
|
|
|
|
using System;
|
2020-08-18 17:11:58 +10:00
|
|
|
|
using System.CodeDom;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using MelonLoader;
|
|
|
|
|
using UnhollowerBaseLib;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Explorer
|
|
|
|
|
{
|
2020-08-13 00:06:39 +10:00
|
|
|
|
public class ReflectionWindow : UIWindow
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-30 01:08:48 +10:00
|
|
|
|
public override string Title => WindowManager.TabView
|
2020-09-01 18:03:44 +10:00
|
|
|
|
? $"<color=cyan>[R]</color> {TargetType.Name}"
|
|
|
|
|
: $"Reflection Inspector ({TargetType.Name})";
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-09-01 18:03:44 +10:00
|
|
|
|
public Type TargetType;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
private CacheObjectBase[] m_allCachedMembers;
|
|
|
|
|
private CacheObjectBase[] m_cachedMembersFiltered;
|
2020-08-22 00:16:05 +10:00
|
|
|
|
private int m_pageOffset;
|
2020-08-22 17:17:11 +10:00
|
|
|
|
private int m_limitPerPage = 20;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
|
|
|
|
private bool m_autoUpdate = false;
|
|
|
|
|
private string m_search = "";
|
2020-08-29 21:15:54 +10:00
|
|
|
|
public MemberTypes m_filter = MemberTypes.Property;
|
2020-08-24 01:42:19 +10:00
|
|
|
|
private bool m_hideFailedReflection = false;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-08-29 21:15:54 +10:00
|
|
|
|
// some extra caching
|
|
|
|
|
private UnityEngine.Object m_uObj;
|
|
|
|
|
private Component m_component;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
|
|
|
|
public override void Init()
|
|
|
|
|
{
|
2020-08-18 17:11:58 +10:00
|
|
|
|
var type = ReflectionHelpers.GetActualType(Target);
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-09-01 18:03:44 +10:00
|
|
|
|
TargetType = type;
|
2020-08-18 17:11:58 +10:00
|
|
|
|
|
|
|
|
|
var types = ReflectionHelpers.GetAllBaseTypes(Target);
|
2020-09-01 18:03:44 +10:00
|
|
|
|
|
2020-08-22 00:16:05 +10:00
|
|
|
|
CacheMembers(types);
|
2020-08-18 17:11:58 +10:00
|
|
|
|
|
2020-08-29 21:15:54 +10:00
|
|
|
|
if (Target is Il2CppSystem.Object ilObject)
|
|
|
|
|
{
|
|
|
|
|
var unityObj = ilObject.TryCast<UnityEngine.Object>();
|
|
|
|
|
if (unityObj)
|
|
|
|
|
{
|
|
|
|
|
m_uObj = unityObj;
|
|
|
|
|
|
|
|
|
|
var component = ilObject.TryCast<Component>();
|
|
|
|
|
if (component)
|
|
|
|
|
{
|
|
|
|
|
m_component = component;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_filter = MemberTypes.All;
|
|
|
|
|
m_autoUpdate = true;
|
|
|
|
|
Update();
|
|
|
|
|
|
|
|
|
|
m_autoUpdate = false;
|
|
|
|
|
m_filter = MemberTypes.Property;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Update()
|
|
|
|
|
{
|
2020-08-30 07:01:13 +10:00
|
|
|
|
m_cachedMembersFiltered = m_allCachedMembers.Where(x => ShouldProcessMember(x)).ToArray();
|
2020-08-22 00:16:05 +10:00
|
|
|
|
|
2020-08-07 22:19:03 +10:00
|
|
|
|
if (m_autoUpdate)
|
|
|
|
|
{
|
|
|
|
|
UpdateValues();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-22 00:16:05 +10:00
|
|
|
|
private void UpdateValues()
|
2020-08-18 17:11:58 +10:00
|
|
|
|
{
|
2020-08-30 07:01:13 +10:00
|
|
|
|
foreach (var member in m_cachedMembersFiltered)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-22 17:17:11 +10:00
|
|
|
|
member.UpdateValue();
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
2020-08-18 17:11:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-29 21:15:54 +10:00
|
|
|
|
private bool ShouldProcessMember(CacheObjectBase holder)
|
2020-08-18 17:11:58 +10:00
|
|
|
|
{
|
2020-09-01 18:03:44 +10:00
|
|
|
|
if (m_filter != MemberTypes.All && m_filter != holder.MemInfo?.MemberType) return false;
|
2020-08-18 17:11:58 +10:00
|
|
|
|
|
2020-08-22 17:17:11 +10:00
|
|
|
|
if (!string.IsNullOrEmpty(holder.ReflectionException) && m_hideFailedReflection) return false;
|
|
|
|
|
|
2020-09-01 18:03:44 +10:00
|
|
|
|
if (m_search == "" || holder.MemInfo == null) return true;
|
2020-08-22 00:16:05 +10:00
|
|
|
|
|
2020-09-01 18:03:44 +10:00
|
|
|
|
var name = holder.MemInfo.DeclaringType.Name + "." + holder.MemInfo.Name;
|
2020-08-31 23:28:44 +10:00
|
|
|
|
|
|
|
|
|
return name.ToLower().Contains(m_search.ToLower());
|
2020-08-18 17:11:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-22 17:17:11 +10:00
|
|
|
|
private void CacheMembers(Type[] types)
|
2020-08-18 17:11:58 +10:00
|
|
|
|
{
|
2020-08-29 21:15:54 +10:00
|
|
|
|
var list = new List<CacheObjectBase>();
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-08-22 17:17:11 +10:00
|
|
|
|
var names = new List<string>();
|
|
|
|
|
|
|
|
|
|
foreach (var declaringType in types)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-22 00:16:05 +10:00
|
|
|
|
MemberInfo[] infos;
|
2020-08-22 17:17:11 +10:00
|
|
|
|
string exception = null;
|
|
|
|
|
|
2020-08-18 17:11:58 +10:00
|
|
|
|
try
|
|
|
|
|
{
|
2020-08-22 17:17:11 +10:00
|
|
|
|
infos = declaringType.GetMembers(ReflectionHelpers.CommonFlags);
|
2020-08-18 17:11:58 +10:00
|
|
|
|
}
|
2020-08-22 00:16:05 +10:00
|
|
|
|
catch
|
2020-08-18 17:11:58 +10:00
|
|
|
|
{
|
2020-09-01 18:03:44 +10:00
|
|
|
|
MelonLogger.Log($"Exception getting members for type: {declaringType.FullName}");
|
2020-08-22 00:16:05 +10:00
|
|
|
|
continue;
|
2020-08-18 17:11:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-22 17:17:11 +10:00
|
|
|
|
object target = Target;
|
2020-08-29 21:15:54 +10:00
|
|
|
|
|
2020-08-22 17:17:11 +10:00
|
|
|
|
if (target is Il2CppSystem.Object ilObject)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-22 00:16:05 +10:00
|
|
|
|
try
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-22 17:17:11 +10:00
|
|
|
|
target = ilObject.Il2CppCast(declaringType);
|
2020-08-22 00:16:05 +10:00
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
2020-08-18 17:11:58 +10:00
|
|
|
|
{
|
2020-08-22 17:17:11 +10:00
|
|
|
|
exception = ReflectionHelpers.ExceptionToString(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var member in infos)
|
|
|
|
|
{
|
2020-08-29 21:15:54 +10:00
|
|
|
|
if (member.MemberType == MemberTypes.Field || member.MemberType == MemberTypes.Property || member.MemberType == MemberTypes.Method)
|
2020-08-22 17:17:11 +10:00
|
|
|
|
{
|
2020-09-01 18:03:44 +10:00
|
|
|
|
var name = $"{member.DeclaringType.Name}.{member.Name}";
|
|
|
|
|
|
|
|
|
|
// blacklist (should probably make a proper implementation)
|
|
|
|
|
if (name == "Type.DeclaringMethod" || member.Name.Contains("Il2CppType") || member.Name.StartsWith("get_") || member.Name.StartsWith("set_"))
|
|
|
|
|
{
|
2020-08-29 21:15:54 +10:00
|
|
|
|
continue;
|
2020-09-01 18:03:44 +10:00
|
|
|
|
}
|
2020-08-22 17:17:11 +10:00
|
|
|
|
|
2020-08-31 23:28:44 +10:00
|
|
|
|
if (member is MethodInfo mi)
|
|
|
|
|
{
|
|
|
|
|
name += " (";
|
|
|
|
|
foreach (var param in mi.GetParameters())
|
|
|
|
|
{
|
|
|
|
|
name += param.ParameterType.Name + ", ";
|
|
|
|
|
}
|
|
|
|
|
name += ")";
|
|
|
|
|
}
|
|
|
|
|
if (names.Contains(name))
|
2020-08-24 01:42:19 +10:00
|
|
|
|
{
|
2020-08-31 23:28:44 +10:00
|
|
|
|
continue;
|
|
|
|
|
}
|
2020-08-24 01:42:19 +10:00
|
|
|
|
|
2020-08-31 23:28:44 +10:00
|
|
|
|
try
|
|
|
|
|
{
|
2020-09-01 18:03:44 +10:00
|
|
|
|
var cached = CacheObjectBase.GetCacheObject(member, target);
|
2020-08-24 01:42:19 +10:00
|
|
|
|
if (cached != null)
|
|
|
|
|
{
|
2020-08-31 23:28:44 +10:00
|
|
|
|
names.Add(name);
|
2020-08-24 01:42:19 +10:00
|
|
|
|
list.Add(cached);
|
|
|
|
|
cached.ReflectionException = exception;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
2020-08-31 23:28:44 +10:00
|
|
|
|
MelonLogger.LogWarning($"Exception caching member {name}!");
|
2020-08-29 21:15:54 +10:00
|
|
|
|
MelonLogger.Log(e.ToString());
|
2020-08-24 01:42:19 +10:00
|
|
|
|
}
|
2020-08-18 17:11:58 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
m_allCachedMembers = list.ToArray();
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-18 17:11:58 +10:00
|
|
|
|
// =========== GUI DRAW =========== //
|
|
|
|
|
|
2020-08-07 22:19:03 +10:00
|
|
|
|
public override void WindowFunction(int windowID)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2020-08-30 07:01:13 +10:00
|
|
|
|
// ====== HEADER ======
|
|
|
|
|
|
2020-08-30 01:08:48 +10:00
|
|
|
|
var rect = WindowManager.TabView ? TabViewWindow.Instance.m_rect : this.m_rect;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-08-30 01:08:48 +10:00
|
|
|
|
if (!WindowManager.TabView)
|
|
|
|
|
{
|
|
|
|
|
Header();
|
|
|
|
|
GUILayout.BeginArea(new Rect(5, 25, rect.width - 10, rect.height - 35), GUI.skin.box);
|
|
|
|
|
}
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
|
|
|
|
GUILayout.BeginHorizontal(null);
|
2020-09-01 18:03:44 +10:00
|
|
|
|
GUILayout.Label("<b>Type:</b> <color=cyan>" + TargetType.FullName + "</color>", new GUILayoutOption[] { GUILayout.Width(245f) });
|
2020-08-29 21:15:54 +10:00
|
|
|
|
if (m_uObj)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-29 21:15:54 +10:00
|
|
|
|
GUILayout.Label("Name: " + m_uObj.name, null);
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
|
|
|
|
GUILayout.EndHorizontal();
|
|
|
|
|
|
2020-08-29 21:15:54 +10:00
|
|
|
|
if (m_uObj)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
|
|
|
|
GUILayout.BeginHorizontal(null);
|
|
|
|
|
GUILayout.Label("<b>Tools:</b>", new GUILayoutOption[] { GUILayout.Width(80) });
|
2020-08-29 21:15:54 +10:00
|
|
|
|
UIHelpers.InstantiateButton(m_uObj);
|
|
|
|
|
if (m_component && m_component.gameObject is GameObject obj)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
|
|
|
|
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
2020-08-30 01:08:48 +10:00
|
|
|
|
GUILayout.Label("GameObject:", new GUILayoutOption[] { GUILayout.Width(135) });
|
|
|
|
|
var charWidth = obj.name.Length * 15;
|
|
|
|
|
var maxWidth = rect.width - 350;
|
|
|
|
|
var labelWidth = charWidth < maxWidth ? charWidth : maxWidth;
|
|
|
|
|
if (GUILayout.Button("<color=#00FF00>" + obj.name + "</color>", new GUILayoutOption[] { GUILayout.Width(labelWidth) }))
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
|
|
|
|
WindowManager.InspectObject(obj, out bool _);
|
|
|
|
|
}
|
|
|
|
|
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
|
|
|
|
}
|
|
|
|
|
GUILayout.EndHorizontal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UIStyles.HorizontalLine(Color.grey);
|
|
|
|
|
|
|
|
|
|
GUILayout.BeginHorizontal(null);
|
|
|
|
|
GUILayout.Label("<b>Search:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
2020-08-30 01:08:48 +10:00
|
|
|
|
m_search = GUILayout.TextField(m_search, null);
|
2020-08-07 22:19:03 +10:00
|
|
|
|
GUILayout.EndHorizontal();
|
|
|
|
|
|
|
|
|
|
GUILayout.BeginHorizontal(null);
|
|
|
|
|
GUILayout.Label("<b>Filter:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
2020-08-29 21:15:54 +10:00
|
|
|
|
FilterToggle(MemberTypes.All, "All");
|
|
|
|
|
FilterToggle(MemberTypes.Property, "Properties");
|
|
|
|
|
FilterToggle(MemberTypes.Field, "Fields");
|
|
|
|
|
FilterToggle(MemberTypes.Method, "Methods");
|
2020-08-07 22:19:03 +10:00
|
|
|
|
GUILayout.EndHorizontal();
|
|
|
|
|
|
|
|
|
|
GUILayout.BeginHorizontal(null);
|
|
|
|
|
GUILayout.Label("<b>Values:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
|
|
|
|
if (GUILayout.Button("Update", new GUILayoutOption[] { GUILayout.Width(100) }))
|
|
|
|
|
{
|
|
|
|
|
UpdateValues();
|
|
|
|
|
}
|
|
|
|
|
GUI.color = m_autoUpdate ? Color.green : Color.red;
|
|
|
|
|
m_autoUpdate = GUILayout.Toggle(m_autoUpdate, "Auto-update?", new GUILayoutOption[] { GUILayout.Width(100) });
|
2020-08-22 17:17:11 +10:00
|
|
|
|
GUI.color = m_hideFailedReflection ? Color.green : Color.red;
|
|
|
|
|
m_hideFailedReflection = GUILayout.Toggle(m_hideFailedReflection, "Hide failed Reflection?", new GUILayoutOption[] { GUILayout.Width(150) });
|
2020-08-07 22:19:03 +10:00
|
|
|
|
GUI.color = Color.white;
|
|
|
|
|
GUILayout.EndHorizontal();
|
|
|
|
|
|
|
|
|
|
GUILayout.Space(10);
|
|
|
|
|
|
2020-08-30 01:08:48 +10:00
|
|
|
|
// prev/next page buttons
|
|
|
|
|
GUILayout.BeginHorizontal(null);
|
|
|
|
|
GUILayout.Label("<b>Limit per page:</b>", new GUILayoutOption[] { GUILayout.Width(125) });
|
|
|
|
|
var limitString = m_limitPerPage.ToString();
|
|
|
|
|
limitString = GUILayout.TextField(limitString, new GUILayoutOption[] { GUILayout.Width(60) });
|
2020-08-30 07:01:13 +10:00
|
|
|
|
if (int.TryParse(limitString, out int lim))
|
2020-08-30 01:08:48 +10:00
|
|
|
|
{
|
2020-08-30 07:01:13 +10:00
|
|
|
|
m_limitPerPage = lim;
|
2020-08-30 01:08:48 +10:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
int count = m_cachedMembersFiltered.Length;
|
2020-08-22 17:17:11 +10:00
|
|
|
|
if (count > m_limitPerPage)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-22 17:17:11 +10:00
|
|
|
|
int maxOffset = (int)Mathf.Ceil((float)(count / (decimal)m_limitPerPage)) - 1;
|
2020-08-30 01:08:48 +10:00
|
|
|
|
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
2020-08-22 00:16:05 +10:00
|
|
|
|
{
|
|
|
|
|
if (m_pageOffset > 0) m_pageOffset--;
|
2020-08-24 01:42:19 +10:00
|
|
|
|
scroll = Vector2.zero;
|
2020-08-22 00:16:05 +10:00
|
|
|
|
}
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-08-30 01:08:48 +10:00
|
|
|
|
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
2020-08-22 00:16:05 +10:00
|
|
|
|
GUILayout.Label($"Page {m_pageOffset + 1}/{maxOffset + 1}", new GUILayoutOption[] { GUILayout.Width(80) });
|
2020-08-30 01:08:48 +10:00
|
|
|
|
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
2020-08-22 00:16:05 +10:00
|
|
|
|
|
2020-08-30 01:08:48 +10:00
|
|
|
|
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
2020-08-22 00:16:05 +10:00
|
|
|
|
{
|
|
|
|
|
if (m_pageOffset < maxOffset) m_pageOffset++;
|
2020-08-24 01:42:19 +10:00
|
|
|
|
scroll = Vector2.zero;
|
2020-08-22 00:16:05 +10:00
|
|
|
|
}
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
2020-08-30 01:08:48 +10:00
|
|
|
|
GUILayout.EndHorizontal();
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
// ====== BODY ======
|
|
|
|
|
|
2020-08-22 00:16:05 +10:00
|
|
|
|
scroll = GUILayout.BeginScrollView(scroll, GUI.skin.scrollView);
|
|
|
|
|
|
|
|
|
|
GUILayout.Space(10);
|
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
UIStyles.HorizontalLine(Color.grey);
|
2020-08-22 00:16:05 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
GUILayout.BeginVertical(GUI.skin.box, null);
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
var members = this.m_cachedMembersFiltered;
|
2020-09-01 18:03:44 +10:00
|
|
|
|
int start = m_pageOffset * m_limitPerPage;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-09-01 18:03:44 +10:00
|
|
|
|
if (start >= count)
|
2020-08-30 07:01:13 +10:00
|
|
|
|
{
|
|
|
|
|
int maxOffset = (int)Mathf.Ceil((float)(m_cachedMembersFiltered.Length / (decimal)m_limitPerPage)) - 1;
|
|
|
|
|
if (m_pageOffset > maxOffset)
|
|
|
|
|
{
|
|
|
|
|
m_pageOffset = 0;
|
|
|
|
|
}
|
2020-08-30 01:08:48 +10:00
|
|
|
|
}
|
2020-08-07 22:19:03 +10:00
|
|
|
|
|
2020-09-01 18:03:44 +10:00
|
|
|
|
for (int j = start; (j < start + m_limitPerPage && j < members.Length); j++)
|
2020-08-30 07:01:13 +10:00
|
|
|
|
{
|
|
|
|
|
var holder = members[j];
|
2020-08-22 00:16:05 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
GUILayout.BeginHorizontal(new GUILayoutOption[] { GUILayout.Height(25) });
|
2020-09-01 18:03:44 +10:00
|
|
|
|
try
|
|
|
|
|
{
|
2020-08-30 07:01:13 +10:00
|
|
|
|
holder.Draw(rect, 180f);
|
2020-09-01 18:03:44 +10:00
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
GUILayout.EndHorizontal();
|
|
|
|
|
continue;
|
2020-08-30 07:01:13 +10:00
|
|
|
|
}
|
|
|
|
|
GUILayout.EndHorizontal();
|
2020-08-30 01:08:48 +10:00
|
|
|
|
|
2020-09-01 18:03:44 +10:00
|
|
|
|
// if not last element
|
|
|
|
|
if (!(j == (start + m_limitPerPage - 1) || j == (members.Length - 1)))
|
|
|
|
|
UIStyles.HorizontalLine(new Color(0.07f, 0.07f, 0.07f), true);
|
2020-08-30 07:01:13 +10:00
|
|
|
|
}
|
2020-08-13 18:43:34 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
GUILayout.EndVertical();
|
|
|
|
|
GUILayout.EndScrollView();
|
2020-08-13 18:43:34 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
if (!WindowManager.TabView)
|
|
|
|
|
{
|
|
|
|
|
m_rect = ResizeDrag.ResizeWindow(rect, windowID);
|
2020-08-22 00:16:05 +10:00
|
|
|
|
|
2020-08-30 07:01:13 +10:00
|
|
|
|
GUILayout.EndArea();
|
|
|
|
|
}
|
2020-08-22 00:16:05 +10:00
|
|
|
|
}
|
2020-08-30 07:01:13 +10:00
|
|
|
|
catch (Il2CppException e)
|
2020-08-22 00:16:05 +10:00
|
|
|
|
{
|
2020-08-30 07:01:13 +10:00
|
|
|
|
if (!e.Message.Contains("in a group with only"))
|
2020-08-22 00:16:05 +10:00
|
|
|
|
{
|
2020-08-30 07:01:13 +10:00
|
|
|
|
throw;
|
2020-08-22 00:16:05 +10:00
|
|
|
|
}
|
2020-08-30 07:01:13 +10:00
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
MelonLogger.LogWarning("Exception drawing ReflectionWindow: " + e.GetType() + ", " + e.Message);
|
|
|
|
|
DestroyWindow();
|
|
|
|
|
return;
|
2020-08-18 17:11:58 +10:00
|
|
|
|
}
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-29 21:15:54 +10:00
|
|
|
|
private void FilterToggle(MemberTypes mode, string label)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-18 17:11:58 +10:00
|
|
|
|
if (m_filter == mode)
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-18 17:11:58 +10:00
|
|
|
|
GUI.color = Color.green;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
2020-08-18 17:11:58 +10:00
|
|
|
|
else
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-18 17:11:58 +10:00
|
|
|
|
GUI.color = Color.white;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
2020-08-18 17:11:58 +10:00
|
|
|
|
if (GUILayout.Button(label, new GUILayoutOption[] { GUILayout.Width(100) }))
|
2020-08-07 22:19:03 +10:00
|
|
|
|
{
|
2020-08-18 17:11:58 +10:00
|
|
|
|
m_filter = mode;
|
2020-08-30 07:01:13 +10:00
|
|
|
|
m_pageOffset = 0;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
2020-08-18 17:11:58 +10:00
|
|
|
|
GUI.color = Color.white;
|
2020-08-07 22:19:03 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|