1.4.5 finalize

Will be pushed when MelonLoader releases 0.2.7.
This commit is contained in:
sinaioutlander 2020-08-30 17:32:25 +10:00
parent 1ab41f5a30
commit abcb548706
4 changed files with 5 additions and 16 deletions

View File

@ -24,7 +24,7 @@ namespace Explorer
{ {
if (this.MemberInfo != null) if (this.MemberInfo != null)
{ {
switch (this.MemberInfoType) switch (this.MemberInfo.MemberType)
{ {
case MemberTypes.Field: case MemberTypes.Field:
m_entryType = (MemberInfo as FieldInfo).FieldType.GetGenericArguments()[0]; m_entryType = (MemberInfo as FieldInfo).FieldType.GetGenericArguments()[0];

View File

@ -152,8 +152,6 @@ namespace Explorer
private void Evaluate() private void Evaluate()
{ {
m_evaluated = true;
var mi = MemberInfo as MethodInfo; var mi = MemberInfo as MethodInfo;
object ret = null; object ret = null;
@ -161,6 +159,7 @@ namespace Explorer
if (!HasParameters) if (!HasParameters)
{ {
ret = mi.Invoke(mi.IsStatic ? null : DeclaringInstance, new object[0]); ret = mi.Invoke(mi.IsStatic ? null : DeclaringInstance, new object[0]);
m_evaluated = true;
} }
else else
{ {
@ -199,6 +198,7 @@ namespace Explorer
if (arguments.Count == m_arguments.Length) if (arguments.Count == m_arguments.Length)
{ {
ret = mi.Invoke(mi.IsStatic ? null : DeclaringInstance, arguments.ToArray()); ret = mi.Invoke(mi.IsStatic ? null : DeclaringInstance, arguments.ToArray());
m_evaluated = true;
} }
else else
{ {

View File

@ -41,17 +41,6 @@ namespace Explorer
} }
} }
public MemberTypes MemberInfoType
{
get
{
if (MemberInfo is FieldInfo) return MemberTypes.Field;
if (MemberInfo is PropertyInfo) return MemberTypes.Property;
if (MemberInfo is MethodInfo) return MemberTypes.Method;
return MemberTypes.All;
}
}
// methods // methods
public virtual void Init() { } public virtual void Init() { }
public abstract void DrawValue(Rect window, float width); public abstract void DrawValue(Rect window, float width);
@ -202,7 +191,7 @@ namespace Explorer
{ {
GUILayout.Label("<color=red>Reflection failed!</color> (" + ReflectionException + ")", null); GUILayout.Label("<color=red>Reflection failed!</color> (" + ReflectionException + ")", null);
} }
else if (Value == null && MemberInfoType != MemberTypes.Method) else if (Value == null && MemberInfo?.MemberType != MemberTypes.Method)
{ {
GUILayout.Label("<i>null (" + ValueType + ")</i>", null); GUILayout.Label("<i>null (" + ValueType + ")</i>", null);
} }

View File

@ -90,7 +90,7 @@ namespace Explorer
private bool ShouldProcessMember(CacheObjectBase holder) private bool ShouldProcessMember(CacheObjectBase holder)
{ {
if (m_filter != MemberTypes.All && m_filter != holder.MemberInfoType) return false; if (m_filter != MemberTypes.All && m_filter != holder.MemberInfo?.MemberType) return false;
if (!string.IsNullOrEmpty(holder.ReflectionException) && m_hideFailedReflection) return false; if (!string.IsNullOrEmpty(holder.ReflectionException) && m_hideFailedReflection) return false;