some ui cleanups (minor)

This commit is contained in:
Sinai 2021-01-22 21:56:00 +11:00
parent f13068bf01
commit d1f4f74d32
5 changed files with 152 additions and 138 deletions

View File

@ -229,13 +229,9 @@ namespace UnityExplorer.Inspectors.Reflection
string toString;
if (m_toStringFormatMethod != null)
{
toString = (string)m_toStringFormatMethod.Invoke(Value, new object[] { "F3" });
}
else
{
toString = (string)m_toStringMethod.Invoke(Value, new object[0]);
}
var fullnametemp = valueType.ToString();
if (fullnametemp.StartsWith("Il2CppSystem"))

View File

@ -153,7 +153,7 @@ namespace UnityExplorer.UI.Modules
{
var name = UISyntaxHighlight.ParseFullSyntax(obj.GetActualType(), true);
if (unityObj && m_context != SearchContext.Singleton && m_context != SearchContext.StaticClass)
if (unityObj && m_context != SearchContext.Singleton)
{
if (unityObj && !string.IsNullOrEmpty(unityObj.name))
name += $": {unityObj.name}";
@ -301,8 +301,8 @@ namespace UnityExplorer.UI.Modules
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
{
// All non-static classes
foreach (var type in asm.TryGetTypes().Where(it => !it.IsSealed && !it.IsAbstract))
// Search all non-static, non-enum classes.
foreach (var type in asm.TryGetTypes().Where(it => !(it.IsSealed && it.IsAbstract) && !it.IsEnum))
{
try
{
@ -336,7 +336,7 @@ namespace UnityExplorer.UI.Modules
if (instance != null)
{
instances.Add(instance);
continue;
break;
}
}
}

View File

@ -33,6 +33,8 @@ namespace UnityExplorer.UI.Shared
this.sliderScroller = sliderScroller;
this.inputField = inputField;
sliderScroller.m_parentInputScroller = this;
inputField.onValueChanged.AddListener(OnTextChanged);
inputRect = inputField.GetComponent<RectTransform>();
@ -68,6 +70,17 @@ namespace UnityExplorer.UI.Shared
}
}
internal bool CheckDestroyed()
{
if (sliderScroller == null || sliderScroller.CheckDestroyed())
{
Instances.Remove(this);
return true;
}
return false;
}
internal void OnTextChanged(string text)
{
m_lastText = text;

View File

@ -8,9 +8,11 @@ using UnityExplorer;
using UnityExplorer.Helpers;
using UnityExplorer.UI;
// Basically just to fix an issue with Scrollbars, instead we use a Slider as the scrollbar.
public class SliderScrollbar
namespace UnityExplorer.UI.Shared
{
// Basically just to fix an issue with Scrollbars, instead we use a Slider as the scrollbar.
public class SliderScrollbar
{
internal static readonly List<SliderScrollbar> Instances = new List<SliderScrollbar>();
public bool IsActive { get; private set; }
@ -19,6 +21,8 @@ public class SliderScrollbar
internal readonly Slider m_slider;
internal readonly RectTransform m_scrollRect;
internal InputFieldScroller m_parentInputScroller;
public SliderScrollbar(Scrollbar scrollbar, Slider slider)
{
Instances.Add(this);
@ -150,7 +154,7 @@ public class SliderScrollbar
}
#endregion
}
}
#if MONO
public static class SliderExtensions
@ -176,3 +180,4 @@ public static class SliderExtensions
}
}
#endif
}

View File

@ -81,7 +81,7 @@ namespace UnityExplorer.UI
{
var input = InputFieldScroller.Instances[i];
if (input.sliderScroller.CheckDestroyed())
if (input.CheckDestroyed())
i--;
else
input.Update();