Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 10f2b7e

Browse files
committed
Bump UniverseLib and fix changes to CreatePanel
1 parent 4602f07 commit 10f2b7e

14 files changed

+41
-41
lines changed

src/ExplorerCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace UnityExplorer
1717
public static class ExplorerCore
1818
{
1919
public const string NAME = "UnityExplorer";
20-
public const string VERSION = "4.5.4";
20+
public const string VERSION = "4.5.5";
2121
public const string AUTHOR = "Sinai";
2222
public const string GUID = "com.sinai.unityexplorer";
2323

src/Inspectors/InspectUnderMouse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ protected internal override void DoSetDefaultPosAndAnchors()
177177
public override void ConstructPanelContent()
178178
{
179179
// hide title bar
180-
this.titleBar.SetActive(false);
180+
this.TitleBar.SetActive(false);
181181
this.UIRoot.transform.SetParent(UIManager.UIRoot.transform, false);
182182

183-
var inspectContent = UIFactory.CreateVerticalGroup(this.uiRoot, "InspectContent", true, true, true, true, 3, new Vector4(2, 2, 2, 2));
183+
var inspectContent = UIFactory.CreateVerticalGroup(this.uiContent, "InspectContent", true, true, true, true, 3, new Vector4(2, 2, 2, 2));
184184
UIFactory.SetLayoutElement(inspectContent, flexibleWidth: 9999, flexibleHeight: 9999);
185185

186186
// Title text

src/UI/Panels/CSConsolePanel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public override void ConstructPanelContent()
7575
{
7676
// Tools Row
7777

78-
var toolsRow = UIFactory.CreateHorizontalGroup(this.uiRoot, "ToggleRow", false, false, true, true, 5, new Vector4(8, 8, 10, 5),
78+
var toolsRow = UIFactory.CreateHorizontalGroup(this.uiContent, "ToggleRow", false, false, true, true, 5, new Vector4(8, 8, 10, 5),
7979
default, TextAnchor.MiddleLeft);
8080
UIFactory.SetLayoutElement(toolsRow, minHeight: 25, flexibleHeight: 0, flexibleWidth: 9999);
8181

@@ -124,7 +124,7 @@ public override void ConstructPanelContent()
124124

125125
// Console Input
126126

127-
var inputArea = UIFactory.CreateUIObject("InputGroup", uiRoot);
127+
var inputArea = UIFactory.CreateUIObject("InputGroup", uiContent);
128128
UIFactory.SetLayoutElement(inputArea, flexibleWidth: 9999, flexibleHeight: 9999);
129129
UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(inputArea, false, true, true, true);
130130
inputArea.AddComponent<Image>().color = Color.white;

src/UI/Panels/ClipboardPanel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public override void ConstructPanelContent()
8989

9090
// Actual panel content
9191

92-
var firstRow = UIFactory.CreateHorizontalGroup(UIRoot, "FirstRow", false, false, true, true, 5, new(2,2,2,2), new(1,1,1,0));
92+
var firstRow = UIFactory.CreateHorizontalGroup(uiContent, "FirstRow", false, false, true, true, 5, new(2,2,2,2), new(1,1,1,0));
9393
UIFactory.SetLayoutElement(firstRow, minHeight: 25, flexibleWidth: 999);
9494

9595
// Title for "Current Paste:"
@@ -102,7 +102,7 @@ public override void ConstructPanelContent()
102102
clearButton.OnClick += () => Copy(null);
103103

104104
// Current Paste info row
105-
var currentPasteHolder = UIFactory.CreateHorizontalGroup(UIRoot, "SecondRow", false, false, true, true, 0,
105+
var currentPasteHolder = UIFactory.CreateHorizontalGroup(uiContent, "SecondRow", false, false, true, true, 0,
106106
new(2, 2, 2, 2), childAlignment: TextAnchor.UpperCenter);
107107

108108
// Actual current paste info label

src/UI/Panels/HookManagerPanel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public override void ConstructPanelContent()
8383
{
8484
// ~~~~~~~~~ Active hooks scroll pool
8585

86-
currentHooksPanel = UIFactory.CreateUIObject("CurrentHooksPanel", this.uiRoot);
86+
currentHooksPanel = UIFactory.CreateUIObject("CurrentHooksPanel", this.uiContent);
8787
UIFactory.SetLayoutElement(currentHooksPanel, flexibleHeight: 9999, flexibleWidth: 9999);
8888
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(currentHooksPanel, true, true, true, true);
8989

@@ -109,7 +109,7 @@ public override void ConstructPanelContent()
109109

110110
// ~~~~~~~~~ Add hooks panel
111111

112-
addHooksPanel = UIFactory.CreateUIObject("AddHooksPanel", this.uiRoot);
112+
addHooksPanel = UIFactory.CreateUIObject("AddHooksPanel", this.uiContent);
113113
UIFactory.SetLayoutElement(addHooksPanel, flexibleHeight: 9999, flexibleWidth: 9999);
114114
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(addHooksPanel, true, true, true, true);
115115

@@ -136,7 +136,7 @@ public override void ConstructPanelContent()
136136

137137
// ~~~~~~~~~ Hook source editor panel
138138

139-
editorPanel = UIFactory.CreateUIObject("HookSourceEditor", this.uiRoot);
139+
editorPanel = UIFactory.CreateUIObject("HookSourceEditor", this.uiContent);
140140
UIFactory.SetLayoutElement(editorPanel, flexibleHeight: 9999, flexibleWidth: 9999);
141141
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(editorPanel, true, true, true, true);
142142

src/UI/Panels/InspectorPanel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected internal override void DoSetDefaultPosAndAnchors()
5454

5555
public override void ConstructPanelContent()
5656
{
57-
var closeHolder = this.titleBar.transform.Find("CloseHolder").gameObject;
57+
var closeHolder = this.TitleBar.transform.Find("CloseHolder").gameObject;
5858

5959
// Inspect under mouse dropdown on title bar
6060

@@ -76,14 +76,14 @@ public override void ConstructPanelContent()
7676

7777
// this.UIRoot.GetComponent<Mask>().enabled = false;
7878

79-
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.uiRoot, true, true, true, true, 4, padLeft: 5, padRight: 5);
79+
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.uiContent, true, true, true, true, 4, padLeft: 5, padRight: 5);
8080

81-
this.NavbarHolder = UIFactory.CreateGridGroup(this.uiRoot, "Navbar", new Vector2(200, 22), new Vector2(4, 4),
81+
this.NavbarHolder = UIFactory.CreateGridGroup(this.uiContent, "Navbar", new Vector2(200, 22), new Vector2(4, 4),
8282
new Color(0.05f, 0.05f, 0.05f));
8383
//UIFactory.SetLayoutElement(NavbarHolder, flexibleWidth: 9999, minHeight: 0, preferredHeight: 0, flexibleHeight: 9999);
8484
NavbarHolder.AddComponent<ContentSizeFitter>().verticalFit = ContentSizeFitter.FitMode.PreferredSize;
8585

86-
this.ContentHolder = UIFactory.CreateVerticalGroup(this.uiRoot, "ContentHolder", true, true, true, true, 0, default,
86+
this.ContentHolder = UIFactory.CreateVerticalGroup(this.uiContent, "ContentHolder", true, true, true, true, 0, default,
8787
new Color(0.1f, 0.1f, 0.1f));
8888
UIFactory.SetLayoutElement(ContentHolder, flexibleHeight: 9999);
8989
ContentRect = ContentHolder.GetComponent<RectTransform>();

src/UI/Panels/LogPanel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ public override void ConstructPanelContent()
161161
{
162162
// Log scroll pool
163163

164-
logScrollPool = UIFactory.CreateScrollPool<ConsoleLogCell>(this.uiRoot, "Logs", out GameObject scrollObj,
164+
logScrollPool = UIFactory.CreateScrollPool<ConsoleLogCell>(this.uiContent, "Logs", out GameObject scrollObj,
165165
out GameObject scrollContent, new Color(0.03f, 0.03f, 0.03f));
166166
UIFactory.SetLayoutElement(scrollObj, flexibleWidth: 9999, flexibleHeight: 9999);
167167

168168
// Buttons and toggles
169169

170-
var optionsRow = UIFactory.CreateUIObject("OptionsRow", this.uiRoot);
170+
var optionsRow = UIFactory.CreateUIObject("OptionsRow", this.uiContent);
171171
UIFactory.SetLayoutElement(optionsRow, minHeight: 25, flexibleWidth: 9999);
172172
UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(optionsRow, false, false, true, true, 5, 2, 2, 2, 2);
173173

src/UI/Panels/ObjectExplorerPanel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ protected internal override void DoSetDefaultPosAndAnchors()
9999
public override void ConstructPanelContent()
100100
{
101101
// Tab bar
102-
var tabGroup = UIFactory.CreateHorizontalGroup(uiRoot, "TabBar", true, true, true, true, 2, new Vector4(2, 2, 2, 2));
102+
var tabGroup = UIFactory.CreateHorizontalGroup(uiContent, "TabBar", true, true, true, true, 2, new Vector4(2, 2, 2, 2));
103103
UIFactory.SetLayoutElement(tabGroup, minHeight: 25, flexibleHeight: 0);
104104

105105
// Scene Explorer
106106
SceneExplorer = new SceneExplorer(this);
107-
SceneExplorer.ConstructUI(uiRoot);
107+
SceneExplorer.ConstructUI(uiContent);
108108
tabPages.Add(SceneExplorer);
109109

110110
// Object search
111111
ObjectSearch = new ObjectSearch(this);
112-
ObjectSearch.ConstructUI(uiRoot);
112+
ObjectSearch.ConstructUI(uiContent);
113113
tabPages.Add(ObjectSearch);
114114

115115
// set up tabs

src/UI/Panels/OptionsPanel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ public override void ConstructPanelContent()
7171
{
7272
// Save button
7373

74-
var saveBtn = UIFactory.CreateButton(this.uiRoot, "Save", "Save Options", new Color(0.2f, 0.3f, 0.2f));
74+
var saveBtn = UIFactory.CreateButton(this.uiContent, "Save", "Save Options", new Color(0.2f, 0.3f, 0.2f));
7575
UIFactory.SetLayoutElement(saveBtn.Component.gameObject, flexibleWidth: 9999, minHeight: 30, flexibleHeight: 0);
7676
saveBtn.OnClick += ConfigManager.Handler.SaveConfig;
7777

7878
// Config entries
7979

80-
var scrollPool = UIFactory.CreateScrollPool<ConfigEntryCell>(this.uiRoot, "ConfigEntries", out GameObject scrollObj,
80+
var scrollPool = UIFactory.CreateScrollPool<ConfigEntryCell>(this.uiContent, "ConfigEntries", out GameObject scrollObj,
8181
out GameObject scrollContent);
8282

8383
scrollPool.Initialize(this);

src/UI/Panels/UIPanel.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,14 @@ public UIPanel()
8787
public virtual bool CanDragAndResize => true;
8888
public virtual bool NavButtonWanted => true;
8989

90-
public ButtonRef NavButton;
91-
public PanelDragger Dragger;
90+
public ButtonRef NavButton { get; internal set; }
91+
public PanelDragger Dragger { get; internal set; }
9292

9393
public override GameObject UIRoot => uiRoot;
9494
protected GameObject uiRoot;
95-
public RectTransform Rect;
96-
public GameObject titleBar;
95+
protected GameObject uiContent;
96+
public RectTransform Rect { get; private set; }
97+
public GameObject TitleBar { get; private set; }
9798

9899
public virtual void OnFinishResize(RectTransform panel)
99100
{
@@ -247,29 +248,28 @@ public void ConstructUI()
247248
}
248249

249250
// create core canvas
250-
uiRoot = UIFactory.CreatePanel(Name, UIManager.PanelHolder);
251+
uiRoot = UIFactory.CreatePanel(Name, UIManager.PanelHolder, out uiContent);
251252
Rect = this.uiRoot.GetComponent<RectTransform>();
252-
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.uiRoot, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft);
253+
//UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.uiRoot, false, false, true, true, 0, 2, 2, 2, 2, TextAnchor.UpperLeft);
253254

254255
int id = this.uiRoot.transform.GetInstanceID();
255256
transformToPanelDict.Add(id, this);
256257

257-
//content = panelContent;
258-
//UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.content, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft);
258+
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.uiContent, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft);
259259

260260
// Title bar
261-
titleBar = UIFactory.CreateHorizontalGroup(uiRoot, "TitleBar", false, true, true, true, 2,
261+
TitleBar = UIFactory.CreateHorizontalGroup(uiContent, "TitleBar", false, true, true, true, 2,
262262
new Vector4(2, 2, 2, 2), new Color(0.06f, 0.06f, 0.06f));
263-
UIFactory.SetLayoutElement(titleBar, minHeight: 25, flexibleHeight: 0);
263+
UIFactory.SetLayoutElement(TitleBar, minHeight: 25, flexibleHeight: 0);
264264

265265
// Title text
266266

267-
var titleTxt = UIFactory.CreateLabel(titleBar, "TitleBar", Name, TextAnchor.MiddleLeft);
267+
var titleTxt = UIFactory.CreateLabel(TitleBar, "TitleBar", Name, TextAnchor.MiddleLeft);
268268
UIFactory.SetLayoutElement(titleTxt.gameObject, minWidth: 250, minHeight: 25, flexibleHeight: 0);
269269

270270
// close button
271271

272-
var closeHolder = UIFactory.CreateUIObject("CloseHolder", titleBar);
272+
var closeHolder = UIFactory.CreateUIObject("CloseHolder", TitleBar);
273273
UIFactory.SetLayoutElement(closeHolder, minHeight: 25, flexibleHeight: 0, minWidth: 30, flexibleWidth: 9999);
274274
UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(closeHolder, false, false, true, true, 3, childAlignment: TextAnchor.MiddleRight);
275275
var closeBtn = UIFactory.CreateButton(closeHolder, "CloseButton", "—");
@@ -283,11 +283,11 @@ public void ConstructUI()
283283
};
284284

285285
if (!CanDragAndResize)
286-
titleBar.SetActive(false);
286+
TitleBar.SetActive(false);
287287

288288
// Panel dragger
289289

290-
Dragger = new PanelDragger(titleBar.GetComponent<RectTransform>(), Rect, this);
290+
Dragger = new PanelDragger(TitleBar.GetComponent<RectTransform>(), Rect, this);
291291
Dragger.OnFinishResize += OnFinishResize;
292292
Dragger.OnFinishDrag += OnFinishDrag;
293293

0 commit comments

Comments
 (0)