From 10f2b7e8493092b2eb8a32e696c55aca32f6f6ea Mon Sep 17 00:00:00 2001 From: Sinai <49360850+sinai-dev@users.noreply.github.com> Date: Thu, 3 Feb 2022 23:33:45 +1100 Subject: [PATCH] Bump UniverseLib and fix changes to CreatePanel --- src/ExplorerCore.cs | 2 +- src/Inspectors/InspectUnderMouse.cs | 4 +-- src/UI/Panels/CSConsolePanel.cs | 4 +-- src/UI/Panels/ClipboardPanel.cs | 4 +-- src/UI/Panels/HookManagerPanel.cs | 6 ++-- src/UI/Panels/InspectorPanel.cs | 8 +++--- src/UI/Panels/LogPanel.cs | 4 +-- src/UI/Panels/ObjectExplorerPanel.cs | 6 ++-- src/UI/Panels/OptionsPanel.cs | 4 +-- src/UI/Panels/UIPanel.cs | 28 +++++++++---------- src/UI/Panels/UiInspectorResultsPanel.cs | 2 +- .../Widgets/AutoComplete/AutoCompleteModal.cs | 4 +-- src/UnityExplorer.csproj | 4 +-- src/packages.config | 2 +- 14 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 24d912a..eb0f4c0 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -17,7 +17,7 @@ namespace UnityExplorer public static class ExplorerCore { public const string NAME = "UnityExplorer"; - public const string VERSION = "4.5.4"; + public const string VERSION = "4.5.5"; public const string AUTHOR = "Sinai"; public const string GUID = "com.sinai.unityexplorer"; diff --git a/src/Inspectors/InspectUnderMouse.cs b/src/Inspectors/InspectUnderMouse.cs index 0b2c533..618ae38 100644 --- a/src/Inspectors/InspectUnderMouse.cs +++ b/src/Inspectors/InspectUnderMouse.cs @@ -177,10 +177,10 @@ namespace UnityExplorer.Inspectors public override void ConstructPanelContent() { // hide title bar - this.titleBar.SetActive(false); + this.TitleBar.SetActive(false); this.UIRoot.transform.SetParent(UIManager.UIRoot.transform, false); - var inspectContent = UIFactory.CreateVerticalGroup(this.uiRoot, "InspectContent", true, true, true, true, 3, new Vector4(2, 2, 2, 2)); + var inspectContent = UIFactory.CreateVerticalGroup(this.uiContent, "InspectContent", true, true, true, true, 3, new Vector4(2, 2, 2, 2)); UIFactory.SetLayoutElement(inspectContent, flexibleWidth: 9999, flexibleHeight: 9999); // Title text diff --git a/src/UI/Panels/CSConsolePanel.cs b/src/UI/Panels/CSConsolePanel.cs index d88a54d..4585536 100644 --- a/src/UI/Panels/CSConsolePanel.cs +++ b/src/UI/Panels/CSConsolePanel.cs @@ -75,7 +75,7 @@ namespace UnityExplorer.UI.Panels { // Tools Row - var toolsRow = UIFactory.CreateHorizontalGroup(this.uiRoot, "ToggleRow", false, false, true, true, 5, new Vector4(8, 8, 10, 5), + var toolsRow = UIFactory.CreateHorizontalGroup(this.uiContent, "ToggleRow", false, false, true, true, 5, new Vector4(8, 8, 10, 5), default, TextAnchor.MiddleLeft); UIFactory.SetLayoutElement(toolsRow, minHeight: 25, flexibleHeight: 0, flexibleWidth: 9999); @@ -124,7 +124,7 @@ namespace UnityExplorer.UI.Panels // Console Input - var inputArea = UIFactory.CreateUIObject("InputGroup", uiRoot); + var inputArea = UIFactory.CreateUIObject("InputGroup", uiContent); UIFactory.SetLayoutElement(inputArea, flexibleWidth: 9999, flexibleHeight: 9999); UIFactory.SetLayoutGroup(inputArea, false, true, true, true); inputArea.AddComponent().color = Color.white; diff --git a/src/UI/Panels/ClipboardPanel.cs b/src/UI/Panels/ClipboardPanel.cs index a244485..28f81bf 100644 --- a/src/UI/Panels/ClipboardPanel.cs +++ b/src/UI/Panels/ClipboardPanel.cs @@ -89,7 +89,7 @@ namespace UnityExplorer.UI.Panels // Actual panel content - var firstRow = UIFactory.CreateHorizontalGroup(UIRoot, "FirstRow", false, false, true, true, 5, new(2,2,2,2), new(1,1,1,0)); + var firstRow = UIFactory.CreateHorizontalGroup(uiContent, "FirstRow", false, false, true, true, 5, new(2,2,2,2), new(1,1,1,0)); UIFactory.SetLayoutElement(firstRow, minHeight: 25, flexibleWidth: 999); // Title for "Current Paste:" @@ -102,7 +102,7 @@ namespace UnityExplorer.UI.Panels clearButton.OnClick += () => Copy(null); // Current Paste info row - var currentPasteHolder = UIFactory.CreateHorizontalGroup(UIRoot, "SecondRow", false, false, true, true, 0, + var currentPasteHolder = UIFactory.CreateHorizontalGroup(uiContent, "SecondRow", false, false, true, true, 0, new(2, 2, 2, 2), childAlignment: TextAnchor.UpperCenter); // Actual current paste info label diff --git a/src/UI/Panels/HookManagerPanel.cs b/src/UI/Panels/HookManagerPanel.cs index f0f5778..3bb492e 100644 --- a/src/UI/Panels/HookManagerPanel.cs +++ b/src/UI/Panels/HookManagerPanel.cs @@ -83,7 +83,7 @@ namespace UnityExplorer.UI.Panels { // ~~~~~~~~~ Active hooks scroll pool - currentHooksPanel = UIFactory.CreateUIObject("CurrentHooksPanel", this.uiRoot); + currentHooksPanel = UIFactory.CreateUIObject("CurrentHooksPanel", this.uiContent); UIFactory.SetLayoutElement(currentHooksPanel, flexibleHeight: 9999, flexibleWidth: 9999); UIFactory.SetLayoutGroup(currentHooksPanel, true, true, true, true); @@ -109,7 +109,7 @@ namespace UnityExplorer.UI.Panels // ~~~~~~~~~ Add hooks panel - addHooksPanel = UIFactory.CreateUIObject("AddHooksPanel", this.uiRoot); + addHooksPanel = UIFactory.CreateUIObject("AddHooksPanel", this.uiContent); UIFactory.SetLayoutElement(addHooksPanel, flexibleHeight: 9999, flexibleWidth: 9999); UIFactory.SetLayoutGroup(addHooksPanel, true, true, true, true); @@ -136,7 +136,7 @@ namespace UnityExplorer.UI.Panels // ~~~~~~~~~ Hook source editor panel - editorPanel = UIFactory.CreateUIObject("HookSourceEditor", this.uiRoot); + editorPanel = UIFactory.CreateUIObject("HookSourceEditor", this.uiContent); UIFactory.SetLayoutElement(editorPanel, flexibleHeight: 9999, flexibleWidth: 9999); UIFactory.SetLayoutGroup(editorPanel, true, true, true, true); diff --git a/src/UI/Panels/InspectorPanel.cs b/src/UI/Panels/InspectorPanel.cs index cddd771..46f6db5 100644 --- a/src/UI/Panels/InspectorPanel.cs +++ b/src/UI/Panels/InspectorPanel.cs @@ -54,7 +54,7 @@ namespace UnityExplorer.UI.Panels public override void ConstructPanelContent() { - var closeHolder = this.titleBar.transform.Find("CloseHolder").gameObject; + var closeHolder = this.TitleBar.transform.Find("CloseHolder").gameObject; // Inspect under mouse dropdown on title bar @@ -76,14 +76,14 @@ namespace UnityExplorer.UI.Panels // this.UIRoot.GetComponent().enabled = false; - UIFactory.SetLayoutGroup(this.uiRoot, true, true, true, true, 4, padLeft: 5, padRight: 5); + UIFactory.SetLayoutGroup(this.uiContent, true, true, true, true, 4, padLeft: 5, padRight: 5); - this.NavbarHolder = UIFactory.CreateGridGroup(this.uiRoot, "Navbar", new Vector2(200, 22), new Vector2(4, 4), + this.NavbarHolder = UIFactory.CreateGridGroup(this.uiContent, "Navbar", new Vector2(200, 22), new Vector2(4, 4), new Color(0.05f, 0.05f, 0.05f)); //UIFactory.SetLayoutElement(NavbarHolder, flexibleWidth: 9999, minHeight: 0, preferredHeight: 0, flexibleHeight: 9999); NavbarHolder.AddComponent().verticalFit = ContentSizeFitter.FitMode.PreferredSize; - this.ContentHolder = UIFactory.CreateVerticalGroup(this.uiRoot, "ContentHolder", true, true, true, true, 0, default, + this.ContentHolder = UIFactory.CreateVerticalGroup(this.uiContent, "ContentHolder", true, true, true, true, 0, default, new Color(0.1f, 0.1f, 0.1f)); UIFactory.SetLayoutElement(ContentHolder, flexibleHeight: 9999); ContentRect = ContentHolder.GetComponent(); diff --git a/src/UI/Panels/LogPanel.cs b/src/UI/Panels/LogPanel.cs index eb5e8b9..2b68374 100644 --- a/src/UI/Panels/LogPanel.cs +++ b/src/UI/Panels/LogPanel.cs @@ -161,13 +161,13 @@ namespace UnityExplorer.UI.Panels { // Log scroll pool - logScrollPool = UIFactory.CreateScrollPool(this.uiRoot, "Logs", out GameObject scrollObj, + logScrollPool = UIFactory.CreateScrollPool(this.uiContent, "Logs", out GameObject scrollObj, out GameObject scrollContent, new Color(0.03f, 0.03f, 0.03f)); UIFactory.SetLayoutElement(scrollObj, flexibleWidth: 9999, flexibleHeight: 9999); // Buttons and toggles - var optionsRow = UIFactory.CreateUIObject("OptionsRow", this.uiRoot); + var optionsRow = UIFactory.CreateUIObject("OptionsRow", this.uiContent); UIFactory.SetLayoutElement(optionsRow, minHeight: 25, flexibleWidth: 9999); UIFactory.SetLayoutGroup(optionsRow, false, false, true, true, 5, 2, 2, 2, 2); diff --git a/src/UI/Panels/ObjectExplorerPanel.cs b/src/UI/Panels/ObjectExplorerPanel.cs index 1ac4604..1e0762f 100644 --- a/src/UI/Panels/ObjectExplorerPanel.cs +++ b/src/UI/Panels/ObjectExplorerPanel.cs @@ -99,17 +99,17 @@ namespace UnityExplorer.UI.Panels public override void ConstructPanelContent() { // Tab bar - var tabGroup = UIFactory.CreateHorizontalGroup(uiRoot, "TabBar", true, true, true, true, 2, new Vector4(2, 2, 2, 2)); + var tabGroup = UIFactory.CreateHorizontalGroup(uiContent, "TabBar", true, true, true, true, 2, new Vector4(2, 2, 2, 2)); UIFactory.SetLayoutElement(tabGroup, minHeight: 25, flexibleHeight: 0); // Scene Explorer SceneExplorer = new SceneExplorer(this); - SceneExplorer.ConstructUI(uiRoot); + SceneExplorer.ConstructUI(uiContent); tabPages.Add(SceneExplorer); // Object search ObjectSearch = new ObjectSearch(this); - ObjectSearch.ConstructUI(uiRoot); + ObjectSearch.ConstructUI(uiContent); tabPages.Add(ObjectSearch); // set up tabs diff --git a/src/UI/Panels/OptionsPanel.cs b/src/UI/Panels/OptionsPanel.cs index 093f40e..7d0ae0a 100644 --- a/src/UI/Panels/OptionsPanel.cs +++ b/src/UI/Panels/OptionsPanel.cs @@ -71,13 +71,13 @@ namespace UnityExplorer.UI.Panels { // Save button - var saveBtn = UIFactory.CreateButton(this.uiRoot, "Save", "Save Options", new Color(0.2f, 0.3f, 0.2f)); + var saveBtn = UIFactory.CreateButton(this.uiContent, "Save", "Save Options", new Color(0.2f, 0.3f, 0.2f)); UIFactory.SetLayoutElement(saveBtn.Component.gameObject, flexibleWidth: 9999, minHeight: 30, flexibleHeight: 0); saveBtn.OnClick += ConfigManager.Handler.SaveConfig; // Config entries - var scrollPool = UIFactory.CreateScrollPool(this.uiRoot, "ConfigEntries", out GameObject scrollObj, + var scrollPool = UIFactory.CreateScrollPool(this.uiContent, "ConfigEntries", out GameObject scrollObj, out GameObject scrollContent); scrollPool.Initialize(this); diff --git a/src/UI/Panels/UIPanel.cs b/src/UI/Panels/UIPanel.cs index 88b3c5d..6aadd51 100644 --- a/src/UI/Panels/UIPanel.cs +++ b/src/UI/Panels/UIPanel.cs @@ -87,13 +87,14 @@ namespace UnityExplorer.UI.Panels public virtual bool CanDragAndResize => true; public virtual bool NavButtonWanted => true; - public ButtonRef NavButton; - public PanelDragger Dragger; + public ButtonRef NavButton { get; internal set; } + public PanelDragger Dragger { get; internal set; } public override GameObject UIRoot => uiRoot; protected GameObject uiRoot; - public RectTransform Rect; - public GameObject titleBar; + protected GameObject uiContent; + public RectTransform Rect { get; private set; } + public GameObject TitleBar { get; private set; } public virtual void OnFinishResize(RectTransform panel) { @@ -247,29 +248,28 @@ namespace UnityExplorer.UI.Panels } // create core canvas - uiRoot = UIFactory.CreatePanel(Name, UIManager.PanelHolder); + uiRoot = UIFactory.CreatePanel(Name, UIManager.PanelHolder, out uiContent); Rect = this.uiRoot.GetComponent(); - UIFactory.SetLayoutGroup(this.uiRoot, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft); + //UIFactory.SetLayoutGroup(this.uiRoot, false, false, true, true, 0, 2, 2, 2, 2, TextAnchor.UpperLeft); int id = this.uiRoot.transform.GetInstanceID(); transformToPanelDict.Add(id, this); - //content = panelContent; - //UIFactory.SetLayoutGroup(this.content, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft); + UIFactory.SetLayoutGroup(this.uiContent, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft); // Title bar - titleBar = UIFactory.CreateHorizontalGroup(uiRoot, "TitleBar", false, true, true, true, 2, + TitleBar = UIFactory.CreateHorizontalGroup(uiContent, "TitleBar", false, true, true, true, 2, new Vector4(2, 2, 2, 2), new Color(0.06f, 0.06f, 0.06f)); - UIFactory.SetLayoutElement(titleBar, minHeight: 25, flexibleHeight: 0); + UIFactory.SetLayoutElement(TitleBar, minHeight: 25, flexibleHeight: 0); // Title text - var titleTxt = UIFactory.CreateLabel(titleBar, "TitleBar", Name, TextAnchor.MiddleLeft); + var titleTxt = UIFactory.CreateLabel(TitleBar, "TitleBar", Name, TextAnchor.MiddleLeft); UIFactory.SetLayoutElement(titleTxt.gameObject, minWidth: 250, minHeight: 25, flexibleHeight: 0); // close button - var closeHolder = UIFactory.CreateUIObject("CloseHolder", titleBar); + var closeHolder = UIFactory.CreateUIObject("CloseHolder", TitleBar); UIFactory.SetLayoutElement(closeHolder, minHeight: 25, flexibleHeight: 0, minWidth: 30, flexibleWidth: 9999); UIFactory.SetLayoutGroup(closeHolder, false, false, true, true, 3, childAlignment: TextAnchor.MiddleRight); var closeBtn = UIFactory.CreateButton(closeHolder, "CloseButton", "—"); @@ -283,11 +283,11 @@ namespace UnityExplorer.UI.Panels }; if (!CanDragAndResize) - titleBar.SetActive(false); + TitleBar.SetActive(false); // Panel dragger - Dragger = new PanelDragger(titleBar.GetComponent(), Rect, this); + Dragger = new PanelDragger(TitleBar.GetComponent(), Rect, this); Dragger.OnFinishResize += OnFinishResize; Dragger.OnFinishDrag += OnFinishDrag; diff --git a/src/UI/Panels/UiInspectorResultsPanel.cs b/src/UI/Panels/UiInspectorResultsPanel.cs index fec5139..11761f6 100644 --- a/src/UI/Panels/UiInspectorResultsPanel.cs +++ b/src/UI/Panels/UiInspectorResultsPanel.cs @@ -61,7 +61,7 @@ namespace UnityExplorer.UI.Panels { dataHandler = new ButtonListHandler(buttonScrollPool, GetEntries, SetCell, ShouldDisplayCell, OnCellClicked); - buttonScrollPool = UIFactory.CreateScrollPool(this.uiRoot, "ResultsList", out GameObject scrollObj, + buttonScrollPool = UIFactory.CreateScrollPool(this.uiContent, "ResultsList", out GameObject scrollObj, out GameObject scrollContent); buttonScrollPool.Initialize(dataHandler); diff --git a/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs b/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs index a72f0b1..e2b14c2 100644 --- a/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs +++ b/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs @@ -305,13 +305,13 @@ namespace UnityExplorer.UI.Widgets.AutoComplete { dataHandler = new ButtonListHandler(scrollPool, GetEntries, SetCell, ShouldDisplay, OnCellClicked); - scrollPool = UIFactory.CreateScrollPool(this.uiRoot, "AutoCompleter", out GameObject scrollObj, + scrollPool = UIFactory.CreateScrollPool(this.uiContent, "AutoCompleter", out GameObject scrollObj, out GameObject scrollContent); scrollPool.Initialize(dataHandler); UIFactory.SetLayoutElement(scrollObj, flexibleHeight: 9999); UIFactory.SetLayoutGroup(scrollContent, true, false, true, false); - navigationTipRow = UIFactory.CreateHorizontalGroup(this.uiRoot, "BottomRow", true, true, true, true, 0, new Vector4(2, 2, 2, 2)); + navigationTipRow = UIFactory.CreateHorizontalGroup(this.uiContent, "BottomRow", true, true, true, true, 0, new Vector4(2, 2, 2, 2)); UIFactory.SetLayoutElement(navigationTipRow, minHeight: 20, flexibleWidth: 9999); UIFactory.CreateLabel(navigationTipRow, "HelpText", "Up/Down to select, Enter to use, Esc to close", TextAnchor.MiddleLeft, Color.grey, false, 13); diff --git a/src/UnityExplorer.csproj b/src/UnityExplorer.csproj index f9e6d3c..1723408 100644 --- a/src/UnityExplorer.csproj +++ b/src/UnityExplorer.csproj @@ -175,13 +175,13 @@ False - packages\UniverseLib.1.2.2\lib\net35\UniverseLib.Mono.dll + packages\UniverseLib.1.2.3\lib\net35\UniverseLib.Mono.dll - packages\UniverseLib.1.2.2\lib\net472\UniverseLib.IL2CPP.dll + packages\UniverseLib.1.2.3\lib\net472\UniverseLib.IL2CPP.dll packages\Il2CppAssemblyUnhollower.BaseLib.0.4.22\lib\net472\UnhollowerBaseLib.dll diff --git a/src/packages.config b/src/packages.config index 339ea40..412e152 100644 --- a/src/packages.config +++ b/src/packages.config @@ -6,6 +6,6 @@ - + \ No newline at end of file