Fix BeginVertical and BeginHorizontal

This commit is contained in:
sinaioutlander
2020-09-13 23:16:12 +10:00
parent 065ab033c9
commit 653b4a2304
18 changed files with 305 additions and 179 deletions

View File

@ -159,7 +159,7 @@ MelonLogger.Log(""hello world"");";
GUILayout.Label("<b>Using directives:</b>", null);
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
GUILayout.Label("Add namespace:", new GUILayoutOption[] { GUILayout.Width(105) });
UsingInput = GUILayout.TextField(UsingInput, new GUILayoutOption[] { GUILayout.Width(150) });
if (GUILayout.Button("<b><color=lime>Add</color></b>", new GUILayoutOption[] { GUILayout.Width(120) }))
@ -170,7 +170,7 @@ MelonLogger.Log(""hello world"");";
{
ResetConsole();
}
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
foreach (var asm in UsingDirectives)
{

View File

@ -200,7 +200,7 @@ namespace Explorer
{
DrawHeaderArea();
GUILayout.BeginVertical(GUI.skin.box, null);
GUIUnstrip.BeginVertical(GUI.skin.box, null);
DrawPageButtons();
@ -213,7 +213,7 @@ namespace Explorer
DrawSearchResultsList();
}
GUILayout.EndVertical();
GUIUnstrip.EndVertical();
}
catch
{
@ -223,17 +223,17 @@ namespace Explorer
private void DrawHeaderArea()
{
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
// Current Scene label
GUILayout.Label("Current Scene:", new GUILayoutOption[] { GUILayout.Width(120) });
SceneChangeButtons();
GUILayout.Label("<color=cyan>" + m_currentScene + "</color>", null); //new GUILayoutOption[] { GUILayout.Width(250) });
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
// ----- GameObject Search -----
GUILayout.BeginHorizontal(GUI.skin.box, null);
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
GUILayout.Label("<b>Search Scene:</b>", new GUILayoutOption[] { GUILayout.Width(100) });
m_searchInput = GUILayout.TextField(m_searchInput, null);
@ -242,7 +242,7 @@ namespace Explorer
{
Search();
}
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
GUIUnstrip.Space(5);
}
@ -282,7 +282,7 @@ namespace Explorer
private void DrawPageButtons()
{
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
Pages.DrawLimitInputArea();
@ -305,7 +305,7 @@ namespace Explorer
}
}
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
GUI.skin.label.alignment = TextAnchor.UpperLeft;
}
@ -313,7 +313,7 @@ namespace Explorer
{
if (m_currentTransform != null)
{
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
if (GUILayout.Button("<-", new GUILayoutOption[] { GUILayout.Width(35) }))
{
TraverseUp();
@ -326,7 +326,7 @@ namespace Explorer
UIHelpers.SmallInspectButton(m_currentTransform);
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
}
else
{

View File

@ -84,20 +84,20 @@ namespace Explorer
try
{
// helpers
GUILayout.BeginHorizontal(GUI.skin.box, null);
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
GUILayout.Label("<b><color=orange>Helpers</color></b>", new GUILayoutOption[] { GUILayout.Width(70) });
if (GUILayout.Button("Find Static Instances", new GUILayoutOption[] { GUILayout.Width(180) }))
{
//m_searchResults = GetInstanceClassScanner().ToList();
CacheResults(GetInstanceClassScanner());
}
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
// search box
SearchBox();
// results
GUILayout.BeginVertical(GUI.skin.box, null);
GUIUnstrip.BeginVertical(GUI.skin.box, null);
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
GUILayout.Label("<b><color=orange>Results </color></b>" + " (" + m_searchResults.Count + ")", null);
@ -105,7 +105,7 @@ namespace Explorer
int count = m_searchResults.Count;
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
Pages.DrawLimitInputArea();
@ -129,7 +129,7 @@ namespace Explorer
}
}
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
resultsScroll = GUIUnstrip.BeginScrollView(resultsScroll);
@ -150,7 +150,7 @@ namespace Explorer
}
GUIUnstrip.EndScrollView();
GUILayout.EndVertical();
GUIUnstrip.EndVertical();
}
catch
{
@ -160,52 +160,52 @@ namespace Explorer
private void SearchBox()
{
GUILayout.BeginVertical(GUI.skin.box, null);
GUIUnstrip.BeginVertical(GUI.skin.box, null);
// ----- GameObject Search -----
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
GUILayout.Label("<b><color=orange>Search</color></b>", null);
GUI.skin.label.alignment = TextAnchor.UpperLeft;
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
GUILayout.Label("Name Contains:", new GUILayoutOption[] { GUILayout.Width(100) });
m_searchInput = GUILayout.TextField(m_searchInput, new GUILayoutOption[] { GUILayout.Width(200) });
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
GUILayout.Label("Class Filter:", new GUILayoutOption[] { GUILayout.Width(100) });
ClassFilterToggle(TypeFilter.Object, "Object");
ClassFilterToggle(TypeFilter.GameObject, "GameObject");
ClassFilterToggle(TypeFilter.Component, "Component");
ClassFilterToggle(TypeFilter.Custom, "Custom");
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
if (TypeMode == TypeFilter.Custom)
{
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
GUI.skin.label.alignment = TextAnchor.MiddleRight;
GUILayout.Label("Custom Class:", new GUILayoutOption[] { GUILayout.Width(250) });
GUI.skin.label.alignment = TextAnchor.UpperLeft;
m_typeInput = GUILayout.TextField(m_typeInput, new GUILayoutOption[] { GUILayout.Width(250) });
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
}
GUILayout.BeginHorizontal(null);
GUIUnstrip.BeginHorizontal();
GUILayout.Label("Scene Filter:", new GUILayoutOption[] { GUILayout.Width(100) });
SceneFilterToggle(SceneFilter.Any, "Any", 60);
SceneFilterToggle(SceneFilter.This, "This Scene", 100);
SceneFilterToggle(SceneFilter.DontDestroy, "DontDestroyOnLoad", 140);
SceneFilterToggle(SceneFilter.None, "No Scene", 80);
GUILayout.EndHorizontal();
GUIUnstrip.EndHorizontal();
if (GUILayout.Button("<b><color=cyan>Search</color></b>", null))
{
Search();
}
GUILayout.EndVertical();
GUIUnstrip.EndVertical();
}
private void ClassFilterToggle(TypeFilter mode, string label)