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

@ -390,7 +390,7 @@ namespace Explorer
if (HasParameters) if (HasParameters)
{ {
GUILayout.BeginVertical(null); GUIUnstrip.BeginVertical();
if (m_isEvaluating) if (m_isEvaluating)
{ {
@ -406,16 +406,16 @@ namespace Explorer
label = $"<i>[{label} = {m_arguments[i].DefaultValue}]</i>"; label = $"<i>[{label} = {m_arguments[i].DefaultValue}]</i>";
} }
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label(i.ToString(), new GUILayoutOption[] { GUILayout.Width(20) }); GUILayout.Label(i.ToString(), new GUILayoutOption[] { GUILayout.Width(20) });
m_argumentInput[i] = GUILayout.TextField(input, new GUILayoutOption[] { GUILayout.Width(150) }); m_argumentInput[i] = GUILayout.TextField(input, new GUILayoutOption[] { GUILayout.Width(150) });
GUILayout.Label(label, null); GUILayout.Label(label, null);
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) })) if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
{ {
if (cm != null) if (cm != null)
@ -431,7 +431,7 @@ namespace Explorer
{ {
m_isEvaluating = false; m_isEvaluating = false;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
else else
{ {
@ -441,16 +441,16 @@ namespace Explorer
} }
} }
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
// new line and space // new line and space
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(labelWidth); GUIUnstrip.Space(labelWidth);
} }
else if (cm != null) else if (cm != null)
{ {
//GUILayout.BeginHorizontal(null); //GUIUnstrip.BeginHorizontal();
if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) })) if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
{ {
@ -458,8 +458,8 @@ namespace Explorer
} }
// new line and space // new line and space
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(labelWidth); GUIUnstrip.Space(labelWidth);
} }

View File

@ -243,8 +243,8 @@ namespace Explorer
if (count > Pages.ItemsPerPage) if (count > Pages.ItemsPerPage)
{ {
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
@ -273,8 +273,8 @@ namespace Explorer
var val = m_cachedValues[i]; var val = m_cachedValues[i];
//collapsing the BeginHorizontal called from ReflectionWindow.WindowFunction or previous array entry //collapsing the BeginHorizontal called from ReflectionWindow.WindowFunction or previous array entry
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
//GUIUnstrip.Space(whitespace); //GUIUnstrip.Space(whitespace);

View File

@ -305,8 +305,8 @@ namespace Explorer
if (count > Pages.ItemsPerPage) if (count > Pages.ItemsPerPage)
{ {
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
@ -334,8 +334,8 @@ namespace Explorer
var entry = m_cachedEntries[i]; var entry = m_cachedEntries[i];
//collapsing the BeginHorizontal called from ReflectionWindow.WindowFunction or previous array entry //collapsing the BeginHorizontal called from ReflectionWindow.WindowFunction or previous array entry
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);

View File

@ -56,44 +56,44 @@ namespace Explorer
if (CanWrite && IsExpanded) if (CanWrite && IsExpanded)
{ {
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
var whitespace = CalcWhitespace(window); var whitespace = CalcWhitespace(window);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("R:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("R:", new GUILayoutOption[] { GUILayout.Width(30) });
r = GUILayout.TextField(r, new GUILayoutOption[] { GUILayout.Width(120) }); r = GUILayout.TextField(r, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("G:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("G:", new GUILayoutOption[] { GUILayout.Width(30) });
g = GUILayout.TextField(g, new GUILayoutOption[] { GUILayout.Width(120) }); g = GUILayout.TextField(g, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("B:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("B:", new GUILayoutOption[] { GUILayout.Width(30) });
b = GUILayout.TextField(b, new GUILayoutOption[] { GUILayout.Width(120) }); b = GUILayout.TextField(b, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("A:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("A:", new GUILayoutOption[] { GUILayout.Width(30) });
a = GUILayout.TextField(a, new GUILayoutOption[] { GUILayout.Width(120) }); a = GUILayout.TextField(a, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
// draw set value button // draw set value button
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) })) if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
{ {
SetValueFromInput(); SetValueFromInput();
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
} }
} }

View File

@ -51,38 +51,38 @@ namespace Explorer
if (CanWrite && IsExpanded) if (CanWrite && IsExpanded)
{ {
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
var whitespace = CalcWhitespace(window); var whitespace = CalcWhitespace(window);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) }); x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) }); y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) });
z = GUILayout.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) }); z = GUILayout.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
// draw set value button // draw set value button
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) })) if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
{ {
SetValueFromInput(); SetValueFromInput();
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
} }
} }

View File

@ -53,44 +53,44 @@ namespace Explorer
if (CanWrite && IsExpanded) if (CanWrite && IsExpanded)
{ {
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
var whitespace = CalcWhitespace(window); var whitespace = CalcWhitespace(window);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) }); x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) }); y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) });
w = GUILayout.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) }); w = GUILayout.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("H:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("H:", new GUILayoutOption[] { GUILayout.Width(30) });
h = GUILayout.TextField(h, new GUILayoutOption[] { GUILayout.Width(120) }); h = GUILayout.TextField(h, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
// draw set value button // draw set value button
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) })) if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
{ {
SetValueFromInput(); SetValueFromInput();
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
} }
} }

View File

@ -88,52 +88,52 @@ namespace Explorer
if (CanWrite && IsExpanded) if (CanWrite && IsExpanded)
{ {
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
var whitespace = CalcWhitespace(window); var whitespace = CalcWhitespace(window);
// always draw x and y // always draw x and y
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) }); x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) }); y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
if (VectorSize > 2) if (VectorSize > 2)
{ {
// draw z // draw z
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) });
z = GUILayout.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) }); z = GUILayout.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
if (VectorSize > 3) if (VectorSize > 3)
{ {
// draw w // draw w
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
GUILayout.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) }); GUILayout.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) });
w = GUILayout.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) }); w = GUILayout.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) });
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
// draw set value button // draw set value button
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUIUnstrip.Space(whitespace); GUIUnstrip.Space(whitespace);
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) })) if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
{ {
SetValueFromInput(); SetValueFromInput();
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
} }
} }

View File

@ -36,6 +36,9 @@ namespace Explorer
public static bool IsEnumerable(Type t) public static bool IsEnumerable(Type t)
{ {
// Not needed for Il2Cpp at the moment. Don't want these to behave as Enumerables.
//if (typeof(Transform).IsAssignableFrom(t)) return false;
return typeof(IEnumerable).IsAssignableFrom(t); return typeof(IEnumerable).IsAssignableFrom(t);
} }

View File

@ -68,7 +68,7 @@ namespace Explorer
// ------ toggle active button ------ // ------ toggle active button ------
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUI.skin.button.alignment = TextAnchor.UpperLeft; GUI.skin.button.alignment = TextAnchor.UpperLeft;
GUI.color = activeColor; GUI.color = activeColor;
@ -103,7 +103,7 @@ namespace Explorer
SmallInspectButton(_obj); SmallInspectButton(_obj);
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
public static void SmallInspectButton(object obj) public static void SmallInspectButton(object obj)

View File

@ -83,7 +83,7 @@ namespace Explorer
private void MainHeader() private void MainHeader()
{ {
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
for (int i = 0; i < Pages.Count; i++) for (int i = 0; i < Pages.Count; i++)
{ {
if (m_currentPage == i) if (m_currentPage == i)
@ -96,9 +96,9 @@ namespace Explorer
m_currentPage = i; m_currentPage = i;
} }
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUI.color = Color.white; GUI.color = Color.white;
InspectUnderMouse.EnableInspect = GUILayout.Toggle(InspectUnderMouse.EnableInspect, "Inspect Under Mouse (Shift + RMB)", null); InspectUnderMouse.EnableInspect = GUILayout.Toggle(InspectUnderMouse.EnableInspect, "Inspect Under Mouse (Shift + RMB)", null);
@ -107,7 +107,7 @@ namespace Explorer
if (setMouse != mouseState) CursorControl.ForceUnlockMouse = setMouse; if (setMouse != mouseState) CursorControl.ForceUnlockMouse = setMouse;
WindowManager.TabView = GUILayout.Toggle(WindowManager.TabView, "Tab View", null); WindowManager.TabView = GUILayout.Toggle(WindowManager.TabView, "Tab View", null);
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
//GUIUnstrip.Space(10); //GUIUnstrip.Space(10);
GUIUnstrip.Space(10); GUIUnstrip.Space(10);

View File

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

View File

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

View File

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

View File

@ -217,7 +217,7 @@ namespace Explorer
scroll = GUIUnstrip.BeginScrollView(scroll); scroll = GUIUnstrip.BeginScrollView(scroll);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("Scene: <color=cyan>" + (m_scene == "" ? "n/a" : m_scene) + "</color>", null); GUILayout.Label("Scene: <color=cyan>" + (m_scene == "" ? "n/a" : m_scene) + "</color>", null);
if (m_scene == UnityHelpers.ActiveSceneName) if (m_scene == UnityHelpers.ActiveSceneName)
{ {
@ -231,9 +231,9 @@ namespace Explorer
{ {
WindowManager.InspectObject(Target, out _, true); WindowManager.InspectObject(Target, out _, true);
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("Path:", new GUILayoutOption[] { GUILayout.Width(50) }); GUILayout.Label("Path:", new GUILayoutOption[] { GUILayout.Width(50) });
string pathlabel = TargetGO.transform.GetGameObjectPath(); string pathlabel = TargetGO.transform.GetGameObjectPath();
if (TargetGO.transform.parent != null) if (TargetGO.transform.parent != null)
@ -244,25 +244,25 @@ namespace Explorer
} }
} }
GUILayout.TextArea(pathlabel, null); GUILayout.TextArea(pathlabel, null);
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("Name:", new GUILayoutOption[] { GUILayout.Width(50) }); GUILayout.Label("Name:", new GUILayoutOption[] { GUILayout.Width(50) });
GUILayout.TextArea(m_name, null); GUILayout.TextArea(m_name, null);
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
// --- Horizontal Columns section --- // --- Horizontal Columns section ---
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(rect.width / 2 - 17) }); GUIUnstrip.BeginVertical(new GUILayoutOption[] { GUILayout.Width(rect.width / 2 - 17) });
TransformList(rect); TransformList(rect);
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
GUILayout.BeginVertical(new GUILayoutOption[] { GUILayout.Width(rect.width / 2 - 17) }); GUIUnstrip.BeginVertical(new GUILayoutOption[] { GUILayout.Width(rect.width / 2 - 17) });
ComponentList(rect); ComponentList(rect);
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
GUILayout.EndHorizontal(); // end horiz columns GUIUnstrip.EndHorizontal(); // end horiz columns
GameObjectControls(); GameObjectControls();
@ -283,20 +283,20 @@ namespace Explorer
private void TransformList(Rect m_rect) private void TransformList(Rect m_rect)
{ {
GUILayout.BeginVertical(GUI.skin.box, null); GUIUnstrip.BeginVertical(GUI.skin.box, null);
m_transformScroll = GUIUnstrip.BeginScrollView(m_transformScroll); m_transformScroll = GUIUnstrip.BeginScrollView(m_transformScroll);
GUILayout.Label("<b><size=15>Children</size></b>", null); GUILayout.Label("<b><size=15>Children</size></b>", null);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
ChildPages.DrawLimitInputArea(); ChildPages.DrawLimitInputArea();
if (ChildPages.ItemCount > ChildPages.ItemsPerPage) if (ChildPages.ItemCount > ChildPages.ItemsPerPage)
{ {
ChildPages.CurrentPageLabel(); ChildPages.CurrentPageLabel();
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) })) if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
{ {
@ -307,7 +307,7 @@ namespace Explorer
ChildPages.TurnPage(Turn.Right, ref this.m_transformScroll); ChildPages.TurnPage(Turn.Right, ref this.m_transformScroll);
} }
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
if (m_children != null && m_children.Length > 0) if (m_children != null && m_children.Length > 0)
{ {
@ -332,24 +332,24 @@ namespace Explorer
} }
GUIUnstrip.EndScrollView(); GUIUnstrip.EndScrollView();
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
} }
private void ComponentList(Rect m_rect) private void ComponentList(Rect m_rect)
{ {
GUILayout.BeginVertical(GUI.skin.box, null); GUIUnstrip.BeginVertical(GUI.skin.box, null);
m_compScroll = GUIUnstrip.BeginScrollView(m_compScroll); m_compScroll = GUIUnstrip.BeginScrollView(m_compScroll);
GUILayout.Label("<b><size=15>Components</size></b>", null); GUILayout.Label("<b><size=15>Components</size></b>", null);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
CompPages.DrawLimitInputArea(); CompPages.DrawLimitInputArea();
if (CompPages.ItemCount > CompPages.ItemsPerPage) if (CompPages.ItemCount > CompPages.ItemsPerPage)
{ {
CompPages.CurrentPageLabel(); CompPages.CurrentPageLabel();
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) })) if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
{ {
@ -360,9 +360,9 @@ namespace Explorer
CompPages.TurnPage(Turn.Right, ref this.m_compScroll); CompPages.TurnPage(Turn.Right, ref this.m_compScroll);
} }
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
m_addComponentInput = GUILayout.TextField(m_addComponentInput, new GUILayoutOption[] { GUILayout.Width(130) }); m_addComponentInput = GUILayout.TextField(m_addComponentInput, new GUILayoutOption[] { GUILayout.Width(130) });
if (GUILayout.Button("Add Comp", null)) if (GUILayout.Button("Add Comp", null))
{ {
@ -382,7 +382,7 @@ namespace Explorer
MelonLogger.LogWarning($"Could not find a type by the name of '{m_addComponentInput}'!"); MelonLogger.LogWarning($"Could not find a type by the name of '{m_addComponentInput}'!");
} }
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUI.skin.button.alignment = TextAnchor.MiddleLeft; GUI.skin.button.alignment = TextAnchor.MiddleLeft;
if (m_cachedDestroyList.Count > 0) if (m_cachedDestroyList.Count > 0)
@ -402,7 +402,7 @@ namespace Explorer
var ilType = component.GetIl2CppType(); var ilType = component.GetIl2CppType();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
if (ReflectionHelpers.BehaviourType.IsAssignableFrom(ilType)) if (ReflectionHelpers.BehaviourType.IsAssignableFrom(ilType))
{ {
BehaviourEnabledBtn(component.TryCast<Behaviour>()); BehaviourEnabledBtn(component.TryCast<Behaviour>());
@ -419,7 +419,7 @@ namespace Explorer
{ {
m_cachedDestroyList.Add(component); m_cachedDestroyList.Add(component);
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
} }
@ -435,7 +435,7 @@ namespace Explorer
GUIUnstrip.EndScrollView(); GUIUnstrip.EndScrollView();
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
} }
private void BehaviourEnabledBtn(Behaviour obj) private void BehaviourEnabledBtn(Behaviour obj)
@ -465,28 +465,28 @@ namespace Explorer
{ {
if (m_hideControls) if (m_hideControls)
{ {
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) }); GUILayout.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) });
if (GUILayout.Button("^ Show ^", new GUILayoutOption[] { GUILayout.Width(75) })) if (GUILayout.Button("^ Show ^", new GUILayoutOption[] { GUILayout.Width(75) }))
{ {
m_hideControls = false; m_hideControls = false;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
return; return;
} }
GUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[] { GUILayout.Width(520) }); GUIUnstrip.BeginVertical(GUI.skin.box, new GUILayoutOption[] { GUILayout.Width(520) });
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) }); GUILayout.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) });
if (GUILayout.Button("v Hide v", new GUILayoutOption[] { GUILayout.Width(75) })) if (GUILayout.Button("v Hide v", new GUILayoutOption[] { GUILayout.Width(75) }))
{ {
m_hideControls = true; m_hideControls = true;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
bool m_active = TargetGO.activeSelf; bool m_active = TargetGO.activeSelf;
m_active = GUILayout.Toggle(m_active, (m_active ? "<color=lime>Enabled " : "<color=red>Disabled") + "</color>", m_active = GUILayout.Toggle(m_active, (m_active ? "<color=lime>Enabled " : "<color=red>Disabled") + "</color>",
new GUILayoutOption[] { GUILayout.Width(80) }); new GUILayoutOption[] { GUILayout.Width(80) });
@ -510,8 +510,8 @@ namespace Explorer
} }
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
m_setParentInput = GUILayout.TextField(m_setParentInput, null); m_setParentInput = GUILayout.TextField(m_setParentInput, null);
if (GUILayout.Button("Set Parent", new GUILayoutOption[] { GUILayout.Width(80) })) if (GUILayout.Button("Set Parent", new GUILayoutOption[] { GUILayout.Width(80) }))
@ -530,15 +530,15 @@ namespace Explorer
{ {
TargetGO.transform.parent = null; TargetGO.transform.parent = null;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginVertical(GUI.skin.box, null); GUIUnstrip.BeginVertical(GUI.skin.box, null);
m_cachedInput[0] = TranslateControl(TranslateType.Position, ref m_translateAmount, false); m_cachedInput[0] = TranslateControl(TranslateType.Position, ref m_translateAmount, false);
m_cachedInput[1] = TranslateControl(TranslateType.Rotation, ref m_rotateAmount, true); m_cachedInput[1] = TranslateControl(TranslateType.Rotation, ref m_rotateAmount, true);
m_cachedInput[2] = TranslateControl(TranslateType.Scale, ref m_scaleAmount, false); m_cachedInput[2] = TranslateControl(TranslateType.Scale, ref m_scaleAmount, false);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
if (GUILayout.Button("<color=lime>Apply to Transform</color>", null) || m_autoApplyTransform) if (GUILayout.Button("<color=lime>Apply to Transform</color>", null) || m_autoApplyTransform)
{ {
if (m_localContext) if (m_localContext)
@ -562,12 +562,12 @@ namespace Explorer
{ {
CacheTransformValues(); CacheTransformValues();
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
BoolToggle(ref m_autoApplyTransform, "Auto-apply to Transform?"); BoolToggle(ref m_autoApplyTransform, "Auto-apply to Transform?");
BoolToggle(ref m_autoUpdateTransform, "Auto-update from transform?"); BoolToggle(ref m_autoUpdateTransform, "Auto-update from transform?");
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
bool b = m_localContext; bool b = m_localContext;
b = GUILayout.Toggle(b, "<color=" + (b ? "lime" : "red") + ">Use local transform values?</color>", null); b = GUILayout.Toggle(b, "<color=" + (b ? "lime" : "red") + ">Use local transform values?</color>", null);
@ -581,7 +581,7 @@ namespace Explorer
} }
} }
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
if (GUILayout.Button("<color=red><b>Destroy</b></color>", new GUILayoutOption[] { GUILayout.Width(120) })) if (GUILayout.Button("<color=red><b>Destroy</b></color>", new GUILayoutOption[] { GUILayout.Width(120) }))
{ {
@ -590,7 +590,7 @@ namespace Explorer
return; return;
} }
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
} }
private void UpdateFreeze() private void UpdateFreeze()
@ -626,7 +626,7 @@ namespace Explorer
private Vector3 TranslateControl(TranslateType mode, ref float amount, bool multByTime) private Vector3 TranslateControl(TranslateType mode, ref float amount, bool multByTime)
{ {
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label($"<color=cyan><b>{(m_localContext ? "Local " : "")}{mode}</b></color>:", GUILayout.Label($"<color=cyan><b>{(m_localContext ? "Local " : "")}{mode}</b></color>:",
new GUILayoutOption[] { GUILayout.Width(m_localContext ? 110 : 65) }); new GUILayoutOption[] { GUILayout.Width(m_localContext ? 110 : 65) });
@ -645,11 +645,11 @@ namespace Explorer
GUILayout.Label(transform.localScale.ToString(), new GUILayoutOption[] { GUILayout.Width(250) }); GUILayout.Label(transform.localScale.ToString(), new GUILayoutOption[] { GUILayout.Width(250) });
break; break;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
Vector3 input = m_cachedInput[(int)mode]; Vector3 input = m_cachedInput[(int)mode];
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUI.skin.label.alignment = TextAnchor.MiddleRight; GUI.skin.label.alignment = TextAnchor.MiddleRight;
GUILayout.Label("<color=cyan>X:</color>", new GUILayoutOption[] { GUILayout.Width(20) }); GUILayout.Label("<color=cyan>X:</color>", new GUILayoutOption[] { GUILayout.Width(20) });
@ -670,7 +670,7 @@ namespace Explorer
} }
GUI.skin.label.alignment = TextAnchor.UpperLeft; GUI.skin.label.alignment = TextAnchor.UpperLeft;
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
return input; return input;
} }

View File

@ -235,17 +235,17 @@ namespace Explorer
GUIUnstrip.BeginArea(new Rect(5, 25, rect.width - 10, rect.height - 35), GUI.skin.box); GUIUnstrip.BeginArea(new Rect(5, 25, rect.width - 10, rect.height - 35), GUI.skin.box);
} }
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("<b>Type:</b> <color=cyan>" + TargetType.FullName + "</color>", new GUILayoutOption[] { GUILayout.Width(245f) }); GUILayout.Label("<b>Type:</b> <color=cyan>" + TargetType.FullName + "</color>", new GUILayoutOption[] { GUILayout.Width(245f) });
if (m_uObj) if (m_uObj)
{ {
GUILayout.Label("Name: " + m_uObj.name, null); GUILayout.Label("Name: " + m_uObj.name, null);
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
if (m_uObj) if (m_uObj)
{ {
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("<b>Tools:</b>", new GUILayoutOption[] { GUILayout.Width(80) }); GUILayout.Label("<b>Tools:</b>", new GUILayoutOption[] { GUILayout.Width(80) });
UIHelpers.InstantiateButton(m_uObj); UIHelpers.InstantiateButton(m_uObj);
if (m_component && m_component.gameObject is GameObject obj) if (m_component && m_component.gameObject is GameObject obj)
@ -261,25 +261,25 @@ namespace Explorer
} }
GUI.skin.label.alignment = TextAnchor.UpperLeft; GUI.skin.label.alignment = TextAnchor.UpperLeft;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
UIStyles.HorizontalLine(Color.grey); UIStyles.HorizontalLine(Color.grey);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("<b>Search:</b>", new GUILayoutOption[] { GUILayout.Width(75) }); GUILayout.Label("<b>Search:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
m_search = GUILayout.TextField(m_search, null); m_search = GUILayout.TextField(m_search, null);
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("<b>Filter:</b>", new GUILayoutOption[] { GUILayout.Width(75) }); GUILayout.Label("<b>Filter:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
FilterToggle(MemberTypes.All, "All"); FilterToggle(MemberTypes.All, "All");
FilterToggle(MemberTypes.Property, "Properties"); FilterToggle(MemberTypes.Property, "Properties");
FilterToggle(MemberTypes.Field, "Fields"); FilterToggle(MemberTypes.Field, "Fields");
FilterToggle(MemberTypes.Method, "Methods"); FilterToggle(MemberTypes.Method, "Methods");
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUILayout.Label("<b>Values:</b>", new GUILayoutOption[] { GUILayout.Width(75) }); GUILayout.Label("<b>Values:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
if (GUILayout.Button("Update", new GUILayoutOption[] { GUILayout.Width(100) })) if (GUILayout.Button("Update", new GUILayoutOption[] { GUILayout.Width(100) }))
{ {
@ -290,14 +290,14 @@ namespace Explorer
GUI.color = m_hideFailedReflection ? Color.green : Color.red; GUI.color = m_hideFailedReflection ? Color.green : Color.red;
m_hideFailedReflection = GUILayout.Toggle(m_hideFailedReflection, "Hide failed Reflection?", new GUILayoutOption[] { GUILayout.Width(150) }); m_hideFailedReflection = GUILayout.Toggle(m_hideFailedReflection, "Hide failed Reflection?", new GUILayoutOption[] { GUILayout.Width(150) });
GUI.color = Color.white; GUI.color = Color.white;
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUIUnstrip.Space(10); GUIUnstrip.Space(10);
Pages.ItemCount = m_cachedMembersFiltered.Length; Pages.ItemCount = m_cachedMembersFiltered.Length;
// prev/next page buttons // prev/next page buttons
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
Pages.DrawLimitInputArea(); Pages.DrawLimitInputArea();
@ -315,7 +315,7 @@ namespace Explorer
Pages.TurnPage(Turn.Right, ref this.scroll); Pages.TurnPage(Turn.Right, ref this.scroll);
} }
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
// ====== BODY ====== // ====== BODY ======
@ -325,7 +325,7 @@ namespace Explorer
UIStyles.HorizontalLine(Color.grey); UIStyles.HorizontalLine(Color.grey);
GUILayout.BeginVertical(GUI.skin.box, null); GUIUnstrip.BeginVertical(GUI.skin.box, null);
var members = this.m_cachedMembersFiltered; var members = this.m_cachedMembersFiltered;
int start = Pages.CalculateOffsetIndex(); int start = Pages.CalculateOffsetIndex();
@ -334,24 +334,24 @@ namespace Explorer
{ {
var holder = members[j]; var holder = members[j];
GUILayout.BeginHorizontal(new GUILayoutOption[] { GUILayout.Height(25) }); GUIUnstrip.BeginHorizontal(new GUILayoutOption[] { GUILayout.Height(25) });
try try
{ {
holder.Draw(rect, 180f); holder.Draw(rect, 180f);
} }
catch catch
{ {
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
continue; continue;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
// if not last element // if not last element
if (!(j == (start + Pages.ItemsPerPage - 1) || j == (members.Length - 1))) if (!(j == (start + Pages.ItemsPerPage - 1) || j == (members.Length - 1)))
UIStyles.HorizontalLine(new Color(0.07f, 0.07f, 0.07f), true); UIStyles.HorizontalLine(new Color(0.07f, 0.07f, 0.07f), true);
} }
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
GUIUnstrip.EndScrollView(); GUIUnstrip.EndScrollView();
if (!WindowManager.TabView) if (!WindowManager.TabView)

View File

@ -26,7 +26,7 @@ namespace Explorer
try try
{ {
GUILayout.BeginHorizontal(GUI.skin.box, null); GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.skin.label.alignment = TextAnchor.MiddleCenter;
GUILayout.Button(gcDrag, GUI.skin.label, new GUILayoutOption[] { GUILayout.Height(15) }); GUILayout.Button(gcDrag, GUI.skin.label, new GUILayoutOption[] { GUILayout.Height(15) });
@ -57,7 +57,7 @@ namespace Explorer
_rect.yMax = Mathf.Min(Screen.height, _rect.yMax); // modifying yMax affects height, not y _rect.yMax = Mathf.Min(Screen.height, _rect.yMax); // modifying yMax affects height, not y
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
} }
catch (Il2CppException e) when (e.Message.StartsWith("System.ArgumentException")) catch (Il2CppException e) when (e.Message.StartsWith("System.ArgumentException"))
{ {
@ -76,7 +76,7 @@ namespace Explorer
} }
else else
{ {
GUILayout.BeginHorizontal(GUI.skin.box, null); GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
GUILayout.Label("Resize window:", new GUILayoutOption[] { GUILayout.Width(100) }); GUILayout.Label("Resize window:", new GUILayoutOption[] { GUILayout.Width(100) });
@ -100,7 +100,7 @@ namespace Explorer
_rect.height += 5f; _rect.height += 5f;
} }
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUI.skin.label.alignment = TextAnchor.UpperLeft; GUI.skin.label.alignment = TextAnchor.UpperLeft;
} }

View File

@ -67,8 +67,8 @@ namespace Explorer
GUIUnstrip.BeginArea(new Rect(5, 25, m_rect.width - 10, m_rect.height - 35), GUI.skin.box); GUIUnstrip.BeginArea(new Rect(5, 25, m_rect.width - 10, m_rect.height - 35), GUI.skin.box);
GUILayout.BeginVertical(GUI.skin.box, null); GUIUnstrip.BeginVertical(GUI.skin.box, null);
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
GUI.skin.button.alignment = TextAnchor.MiddleLeft; GUI.skin.button.alignment = TextAnchor.MiddleLeft;
int tabPerRow = Mathf.FloorToInt((float)((decimal)m_rect.width / 238)); int tabPerRow = Mathf.FloorToInt((float)((decimal)m_rect.width / 238));
int rowCount = 0; int rowCount = 0;
@ -77,8 +77,8 @@ namespace Explorer
if (rowCount >= tabPerRow) if (rowCount >= tabPerRow)
{ {
rowCount = 0; rowCount = 0;
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.BeginHorizontal(null); GUIUnstrip.BeginHorizontal();
} }
rowCount++; rowCount++;
@ -97,8 +97,8 @@ namespace Explorer
} }
} }
GUI.color = Color.white; GUI.color = Color.white;
GUILayout.EndHorizontal(); GUIUnstrip.EndHorizontal();
GUILayout.EndVertical(); GUIUnstrip.EndVertical();
GUI.skin.button.alignment = TextAnchor.MiddleCenter; GUI.skin.button.alignment = TextAnchor.MiddleCenter;
m_targetWindow.WindowFunction(m_targetWindow.windowID); m_targetWindow.WindowFunction(m_targetWindow.windowID);

View File

@ -52,6 +52,8 @@ namespace Explorer
return m_scrollStack; return m_scrollStack;
} }
// ================= Fix for Space =================
public static void Space(float pixels) public static void Space(float pixels)
{ {
GUIUtility.CheckOnGUI(); GUIUtility.CheckOnGUI();
@ -67,7 +69,7 @@ namespace Explorer
} }
} }
// Fix for BeginArea // ================= Fix for BeginArea =================
static public void BeginArea(Rect screenRect) { BeginArea(screenRect, GUIContent.none, GUIStyle.none); } static public void BeginArea(Rect screenRect) { BeginArea(screenRect, GUIContent.none, GUIStyle.none); }
static public void BeginArea(Rect screenRect, string text) { BeginArea(screenRect, GUIContent.Temp(text), GUIStyle.none); } static public void BeginArea(Rect screenRect, string text) { BeginArea(screenRect, GUIContent.Temp(text), GUIStyle.none); }
@ -77,7 +79,6 @@ namespace Explorer
static public void BeginArea(Rect screenRect, string text, GUIStyle style) { BeginArea(screenRect, GUIContent.Temp(text), style); } static public void BeginArea(Rect screenRect, string text, GUIStyle style) { BeginArea(screenRect, GUIContent.Temp(text), style); }
static public void BeginArea(Rect screenRect, Texture image, GUIStyle style) { BeginArea(screenRect, GUIContent.Temp(image), style); } static public void BeginArea(Rect screenRect, Texture image, GUIStyle style) { BeginArea(screenRect, GUIContent.Temp(image), style); }
// Begin a GUILayout block of GUI controls in a fixed screen area.
static public void BeginArea(Rect screenRect, GUIContent content, GUIStyle style) static public void BeginArea(Rect screenRect, GUIContent content, GUIStyle style)
{ {
GUILayoutGroup g = GUILayoutUtility.BeginLayoutArea(style, Il2CppType.Of<GUILayoutGroup>()); GUILayoutGroup g = GUILayoutUtility.BeginLayoutArea(style, Il2CppType.Of<GUILayoutGroup>());
@ -92,7 +93,6 @@ namespace Explorer
GUI.BeginGroup(g.rect, content, style); GUI.BeginGroup(g.rect, content, style);
} }
// Close a GUILayout block started with BeginArea
static public void EndArea() static public void EndArea()
{ {
if (Event.current.type == EventType.Used) if (Event.current.type == EventType.Used)
@ -102,7 +102,7 @@ namespace Explorer
GUI.EndGroup(); GUI.EndGroup();
} }
// Fix for BeginGroup // ================= Fix for BeginGroup =================
public static void BeginGroup(Rect position) { BeginGroup(position, GUIContent.none, GUIStyle.none); } public static void BeginGroup(Rect position) { BeginGroup(position, GUIContent.none, GUIStyle.none); }
public static void BeginGroup(Rect position, string text) { BeginGroup(position, GUIContent.Temp(text), GUIStyle.none); } public static void BeginGroup(Rect position, string text) { BeginGroup(position, GUIContent.Temp(text), GUIStyle.none); }
@ -139,7 +139,130 @@ namespace Explorer
GUIClip.Internal_Pop(); GUIClip.Internal_Pop();
} }
// Fix for BeginScrollView. // ================= Fix for BeginVertical =================
public static void BeginVertical(params GUILayoutOption[] options) { BeginVertical(GUIContent.none, GUIStyle.none, options); }
public static void BeginVertical(GUIStyle style, params GUILayoutOption[] options) { BeginVertical(GUIContent.none, style, options); }
public static void BeginVertical(string text, GUIStyle style, params GUILayoutOption[] options) { BeginVertical(GUIContent.Temp(text), style, options); }
public static void BeginVertical(Texture image, GUIStyle style, params GUILayoutOption[] options) { BeginVertical(GUIContent.Temp(image), style, options); }
public static void BeginVertical(GUIContent content, GUIStyle style, params GUILayoutOption[] options)
{
var g = GUILayoutUtility.BeginLayoutGroup(style, options, Il2CppType.Of<GUILayoutGroup>());
g.isVertical = true;
if (style != GUIStyle.none || content != GUIContent.none)
GUI.Box(g.rect, content, style);
}
public static void EndVertical()
{
GUILayoutUtility.EndLayoutGroup();
}
// ================= Fix for BeginHorizontal ==================
public static void BeginHorizontal(params GUILayoutOption[] options) { BeginHorizontal(GUIContent.none, GUIStyle.none, options); }
public static void BeginHorizontal(GUIStyle style, params GUILayoutOption[] options) { BeginHorizontal(GUIContent.none, style, options); }
public static void BeginHorizontal(string text, GUIStyle style, params GUILayoutOption[] options) { BeginHorizontal(GUIContent.Temp(text), style, options); }
public static void BeginHorizontal(Texture image, GUIStyle style, params GUILayoutOption[] options)
{ BeginHorizontal(GUIContent.Temp(image), style, options); }
public static void BeginHorizontal(GUIContent content, GUIStyle style, params GUILayoutOption[] options)
{
GUILayoutGroup g = GUILayoutUtility.BeginLayoutGroup(style, options, Il2CppType.Of<GUILayoutGroup>());
g.isVertical = false;
if (style != GUIStyle.none || content != GUIContent.none)
GUI.Box(g.rect, content, style);
}
public static void EndHorizontal()
{
GUILayoutUtility.EndLayoutGroup();
}
// =========== Fix for GUI elements =============
static public void Label(Texture image, params GUILayoutOption[] options) { DoLabel(GUIContent.Temp(image), GUI.skin.label, options); }
static public void Label(string text, params GUILayoutOption[] options) { DoLabel(GUIContent.Temp(text), GUI.skin.label, options); }
static public void Label(GUIContent content, params GUILayoutOption[] options) { DoLabel(content, GUI.skin.label, options); }
static public void Label(Texture image, GUIStyle style, params GUILayoutOption[] options) { DoLabel(GUIContent.Temp(image), style, options); }
static public void Label(string text, GUIStyle style, params GUILayoutOption[] options) { DoLabel(GUIContent.Temp(text), style, options); }
// Make an auto-layout label.
static public void Label(GUIContent content, GUIStyle style, params GUILayoutOption[] options) { DoLabel(content, style, options); }
static void DoLabel(GUIContent content, GUIStyle style, GUILayoutOption[] options)
{ GUI.Label(LayoutUtilityUnstrip.GetRect(content, style, options), content, style); }
static public void Box(Texture image, params GUILayoutOption[] options) { DoBox(GUIContent.Temp(image), GUI.skin.box, options); }
static public void Box(string text, params GUILayoutOption[] options) { DoBox(GUIContent.Temp(text), GUI.skin.box, options); }
static public void Box(GUIContent content, params GUILayoutOption[] options) { DoBox(content, GUI.skin.box, options); }
static public void Box(Texture image, GUIStyle style, params GUILayoutOption[] options) { DoBox(GUIContent.Temp(image), style, options); }
static public void Box(string text, GUIStyle style, params GUILayoutOption[] options) { DoBox(GUIContent.Temp(text), style, options); }
// Make an auto-layout box.
static public void Box(GUIContent content, GUIStyle style, params GUILayoutOption[] options) { DoBox(content, style, options); }
static void DoBox(GUIContent content, GUIStyle style, GUILayoutOption[] options)
{ GUI.Box(LayoutUtilityUnstrip.GetRect(content, style, options), content, style); }
static public bool Button(Texture image, params GUILayoutOption[] options) { return DoButton(GUIContent.Temp(image), GUI.skin.button, options); }
static public bool Button(string text, params GUILayoutOption[] options) { return DoButton(GUIContent.Temp(text), GUI.skin.button, options); }
static public bool Button(GUIContent content, params GUILayoutOption[] options) { return DoButton(content, GUI.skin.button, options); }
static public bool Button(Texture image, GUIStyle style, params GUILayoutOption[] options) { return DoButton(GUIContent.Temp(image), style, options); }
static public bool Button(string text, GUIStyle style, params GUILayoutOption[] options) { return DoButton(GUIContent.Temp(text), style, options); }
// Make a single press button. The user clicks them and something happens immediately.
static public bool Button(GUIContent content, GUIStyle style, params GUILayoutOption[] options) { return DoButton(content, style, options); }
static bool DoButton(GUIContent content, GUIStyle style, GUILayoutOption[] options)
{ return GUI.Button(LayoutUtilityUnstrip.GetRect(content, style, options), content, style); }
static public bool RepeatButton(Texture image, params GUILayoutOption[] options) { return DoRepeatButton(GUIContent.Temp(image), GUI.skin.button, options); }
static public bool RepeatButton(string text, params GUILayoutOption[] options) { return DoRepeatButton(GUIContent.Temp(text), GUI.skin.button, options); }
static public bool RepeatButton(GUIContent content, params GUILayoutOption[] options) { return DoRepeatButton(content, GUI.skin.button, options); }
static public bool RepeatButton(Texture image, GUIStyle style, params GUILayoutOption[] options) { return DoRepeatButton(GUIContent.Temp(image), style, options); }
static public bool RepeatButton(string text, GUIStyle style, params GUILayoutOption[] options) { return DoRepeatButton(GUIContent.Temp(text), style, options); }
// Make a repeating button. The button returns true as long as the user holds down the mouse
static public bool RepeatButton(GUIContent content, GUIStyle style, params GUILayoutOption[] options) { return DoRepeatButton(content, style, options); }
static bool DoRepeatButton(GUIContent content, GUIStyle style, GUILayoutOption[] options)
{ return GUI.RepeatButton(LayoutUtilityUnstrip.GetRect(content, style, options), content, style); }
public static string TextField(string text, params GUILayoutOption[] options) { return DoTextField(text, -1, false, GUI.skin.textField, options); }
public static string TextField(string text, int maxLength, params GUILayoutOption[] options) { return DoTextField(text, maxLength, false, GUI.skin.textField, options); }
public static string TextField(string text, GUIStyle style, params GUILayoutOption[] options) { return DoTextField(text, -1, false, style, options); }
// Make a single-line text field where the user can edit a string.
public static string TextField(string text, int maxLength, GUIStyle style, params GUILayoutOption[] options) { return DoTextField(text, maxLength, false, style, options); }
public static string TextArea(string text, params GUILayoutOption[] options) { return DoTextField(text, -1, true, GUI.skin.textArea, options); }
public static string TextArea(string text, int maxLength, params GUILayoutOption[] options) { return DoTextField(text, maxLength, true, GUI.skin.textArea, options); }
public static string TextArea(string text, GUIStyle style, params GUILayoutOption[] options) { return DoTextField(text, -1, true, style, options); }
// Make a multi-line text field where the user can edit a string.
public static string TextArea(string text, int maxLength, GUIStyle style, params GUILayoutOption[] options) { return DoTextField(text, maxLength, true, style, options); }
static string DoTextField(string text, int maxLength, bool multiline, GUIStyle style, GUILayoutOption[] options)
{
int id = GUIUtility.GetControlID(FocusType.Keyboard);
GUIContent content;
Rect r;
if (GUIUtility.keyboardControl != id)
content = GUIContent.Temp(text);
else
content = GUIContent.Temp(text + GUIUtility.compositionString);
r = LayoutUtilityUnstrip.GetRect(content, style, options);
if (GUIUtility.keyboardControl == id)
content = GUIContent.Temp(text);
GUI.DoTextField(r, id, content, multiline, maxLength, style);
return content.text;
}
static public bool Toggle(bool value, Texture image, params GUILayoutOption[] options) { return DoToggle(value, GUIContent.Temp(image), GUI.skin.toggle, options); }
static public bool Toggle(bool value, string text, params GUILayoutOption[] options) { return DoToggle(value, GUIContent.Temp(text), GUI.skin.toggle, options); }
static public bool Toggle(bool value, GUIContent content, params GUILayoutOption[] options) { return DoToggle(value, content, GUI.skin.toggle, options); }
static public bool Toggle(bool value, Texture image, GUIStyle style, params GUILayoutOption[] options) { return DoToggle(value, GUIContent.Temp(image), style, options); }
static public bool Toggle(bool value, string text, GUIStyle style, params GUILayoutOption[] options) { return DoToggle(value, GUIContent.Temp(text), style, options); }
// Make an on/off toggle button.
static public bool Toggle(bool value, GUIContent content, GUIStyle style, params GUILayoutOption[] options) { return DoToggle(value, content, style, options); }
static bool DoToggle(bool value, GUIContent content, GUIStyle style, GUILayoutOption[] options)
{ return GUI.Toggle(LayoutUtilityUnstrip.GetRect(content, style, options), value, content, style); }
// ================= Fix for BeginScrollView. =======================
public static Vector2 BeginScrollView(Vector2 scroll, params GUILayoutOption[] options) public static Vector2 BeginScrollView(Vector2 scroll, params GUILayoutOption[] options)
{ {