mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-01-04 00:23:29 +08:00
Bump UniverseLib and fix changes to CreatePanel
This commit is contained in:
parent
4602f07c34
commit
10f2b7e849
@ -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";
|
||||
|
||||
|
@ -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
|
||||
|
@ -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<HorizontalLayoutGroup>(inputArea, false, true, true, true);
|
||||
inputArea.AddComponent<Image>().color = Color.white;
|
||||
|
@ -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
|
||||
|
@ -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<VerticalLayoutGroup>(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<VerticalLayoutGroup>(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<VerticalLayoutGroup>(editorPanel, true, true, true, true);
|
||||
|
||||
|
@ -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<Mask>().enabled = false;
|
||||
|
||||
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.uiRoot, true, true, true, true, 4, padLeft: 5, padRight: 5);
|
||||
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(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<ContentSizeFitter>().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<RectTransform>();
|
||||
|
@ -161,13 +161,13 @@ namespace UnityExplorer.UI.Panels
|
||||
{
|
||||
// Log scroll pool
|
||||
|
||||
logScrollPool = UIFactory.CreateScrollPool<ConsoleLogCell>(this.uiRoot, "Logs", out GameObject scrollObj,
|
||||
logScrollPool = UIFactory.CreateScrollPool<ConsoleLogCell>(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<HorizontalLayoutGroup>(optionsRow, false, false, true, true, 5, 2, 2, 2, 2);
|
||||
|
||||
|
@ -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
|
||||
|
@ -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<ConfigEntryCell>(this.uiRoot, "ConfigEntries", out GameObject scrollObj,
|
||||
var scrollPool = UIFactory.CreateScrollPool<ConfigEntryCell>(this.uiContent, "ConfigEntries", out GameObject scrollObj,
|
||||
out GameObject scrollContent);
|
||||
|
||||
scrollPool.Initialize(this);
|
||||
|
@ -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<RectTransform>();
|
||||
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(this.uiRoot, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft);
|
||||
//UIFactory.SetLayoutGroup<VerticalLayoutGroup>(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<VerticalLayoutGroup>(this.content, false, false, true, true, 2, 2, 2, 2, 2, TextAnchor.UpperLeft);
|
||||
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(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<HorizontalLayoutGroup>(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<RectTransform>(), Rect, this);
|
||||
Dragger = new PanelDragger(TitleBar.GetComponent<RectTransform>(), Rect, this);
|
||||
Dragger.OnFinishResize += OnFinishResize;
|
||||
Dragger.OnFinishDrag += OnFinishDrag;
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace UnityExplorer.UI.Panels
|
||||
{
|
||||
dataHandler = new ButtonListHandler<GameObject, ButtonCell>(buttonScrollPool, GetEntries, SetCell, ShouldDisplayCell, OnCellClicked);
|
||||
|
||||
buttonScrollPool = UIFactory.CreateScrollPool<ButtonCell>(this.uiRoot, "ResultsList", out GameObject scrollObj,
|
||||
buttonScrollPool = UIFactory.CreateScrollPool<ButtonCell>(this.uiContent, "ResultsList", out GameObject scrollObj,
|
||||
out GameObject scrollContent);
|
||||
|
||||
buttonScrollPool.Initialize(dataHandler);
|
||||
|
@ -305,13 +305,13 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
|
||||
{
|
||||
dataHandler = new ButtonListHandler<Suggestion, ButtonCell>(scrollPool, GetEntries, SetCell, ShouldDisplay, OnCellClicked);
|
||||
|
||||
scrollPool = UIFactory.CreateScrollPool<ButtonCell>(this.uiRoot, "AutoCompleter", out GameObject scrollObj,
|
||||
scrollPool = UIFactory.CreateScrollPool<ButtonCell>(this.uiContent, "AutoCompleter", out GameObject scrollObj,
|
||||
out GameObject scrollContent);
|
||||
scrollPool.Initialize(dataHandler);
|
||||
UIFactory.SetLayoutElement(scrollObj, flexibleHeight: 9999);
|
||||
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(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);
|
||||
|
@ -175,13 +175,13 @@
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UniverseLib.Mono">
|
||||
<HintPath>packages\UniverseLib.1.2.2\lib\net35\UniverseLib.Mono.dll</HintPath>
|
||||
<HintPath>packages\UniverseLib.1.2.3\lib\net35\UniverseLib.Mono.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<!-- Il2Cpp refs -->
|
||||
<ItemGroup Condition="'$(IsCpp)'=='true'">
|
||||
<Reference Include="UniverseLib.IL2CPP">
|
||||
<HintPath>packages\UniverseLib.1.2.2\lib\net472\UniverseLib.IL2CPP.dll</HintPath>
|
||||
<HintPath>packages\UniverseLib.1.2.3\lib\net472\UniverseLib.IL2CPP.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnhollowerBaseLib, Version=0.4.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Il2CppAssemblyUnhollower.BaseLib.0.4.22\lib\net472\UnhollowerBaseLib.dll</HintPath>
|
||||
|
@ -6,6 +6,6 @@
|
||||
<package id="ILRepack.Lib.MSBuild.Task" version="2.0.18.2" targetFramework="net35" />
|
||||
<package id="Mono.Cecil" version="0.10.4" targetFramework="net35" />
|
||||
<package id="Samboy063.Tomlet" version="3.1.3" targetFramework="net472" />
|
||||
<package id="UniverseLib" version="1.2.2" targetFramework="net35" />
|
||||
<package id="UniverseLib" version="1.2.3" targetFramework="net35" />
|
||||
<package id="UniverseLib.Analyzers" version="1.0.3" targetFramework="net35" developmentDependency="true" />
|
||||
</packages>
|
Loading…
x
Reference in New Issue
Block a user